Skip to content

implement updated viewport meta requirements #1401

Closed

Description

@rdeltour
  • viewport meta height and width must not be declared multiple times
  • viewport meta may have properties without values

Complements #1400

Activity

  1. added this to the v5.0.0 milestone on Dec 2, 2022
  2. self-assigned this
    on Dec 2, 2022
  3. modified the milestones: v5.0.0, v5.0.0-rc on Dec 8, 2022
  4. rdeltour commented on Dec 12, 2022

    @rdeltour
    MemberAuthor

    @mattgarrish I'm trying to implement a check for the post-CR viewport rules, notably the requirement that height and width properties are not defined several times, but I'm not sure how EPUBCheck should behave. Can you please help me clarify the following?

    The spec says:

    the initial containing block [css2] is obtained from the REQUIRED height and width definitions in a viewport meta tag

    and

    EPUB creators MUST NOT specify duplicate height or width definitions either within a single viewport meta tag or by specifying multiple viewport meta tags.

    but it does not explicitly say that there MUST be a single viewport meta tag.

    So strictly speaking, the following combinations are valid viewport definitions:

    <meta name="viewport" content="initial-scale=1.0"/>
    <meta name="viewport" content="width=1200,height=600"/>
    <meta name="viewport" content="width=1200"/>
    <meta name="viewport" content="height=600"/>

    (1) may be safe and working, but I definitely have doubts about (2). Should we fix the spec to disallow that and require viewport is defined in a single meta element, or at least both the (required) width and height values are defined in the same meta element?

    I'm hesitant to implement a strict interpretation of the spec (i.e. both (1) and (2) above considered valid); I think it would be more useful if EPUBCheck warned users there, as it is likely an authoring error that would lead to a viewport that may not be parsed by the RS.

    /cc @iherman

  5. mattgarrish commented on Dec 12, 2022

    @mattgarrish
    Member

    Reading systems have to ignore all but the first viewport meta declaration, so any permutation that requires compiling the information from multiple tags would be invalid.

  6. mattgarrish commented on Dec 12, 2022

    @mattgarrish
    Member

    but it does not explicitly say that there MUST be a single viewport meta tag.

    Ya, I believe that's intentional as whether there are other viewport meta tags isn't specifically an epub concern. Clarifying that only the first tag is processed for fxl purposes, so that's where the dimension declarations need to be, is a useful add. I'll open an issue and PR shortly.

  7. added a commit that references this issue on Dec 13, 2022
    9f75a1d
  8. added
    status: has PRThe issue is being processed in a pull request
    and removed on Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status: has PRThe issue is being processed in a pull requesttype: specThe issue is related to a Specification update

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址