Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement updated viewport meta requirements #1401

Closed
rdeltour opened this issue Dec 2, 2022 · 3 comments · Fixed by #1460
Closed

implement updated viewport meta requirements #1401

rdeltour opened this issue Dec 2, 2022 · 3 comments · Fixed by #1460
Assignees
Labels
status: has PR The issue is being processed in a pull request type: spec The issue is related to a Specification update
Milestone

Comments

@rdeltour
Copy link
Member

rdeltour commented Dec 2, 2022

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

Complements #1400

@rdeltour rdeltour added type: spec The issue is related to a Specification update status: ready for implem The issue is ready to be implemented labels Dec 2, 2022
@rdeltour rdeltour added this to the v5.0.0 milestone Dec 2, 2022
@rdeltour rdeltour self-assigned this Dec 2, 2022
@rdeltour rdeltour modified the milestones: v5.0.0, v5.0.0-rc Dec 8, 2022
@rdeltour
Copy link
Member Author

@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

@mattgarrish
Copy link
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.

@mattgarrish
Copy link
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.

@rdeltour rdeltour added status: has PR The issue is being processed in a pull request and removed status: ready for implem The issue is ready to be implemented labels Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: has PR The issue is being processed in a pull request type: spec The issue is related to a Specification update
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants