-
Notifications
You must be signed in to change notification settings - Fork 60
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
Some comments on the viewport meta tag #2442
Comments
This is certainly doable. We can also change the reference to the new spec, as this is in an informative section.
We have to define a syntax because we require the height/width to be specified for HTML FXL docs. We can't reference the apple spec for the syntax so we can't jump over to parsing a tag we haven't defined for a value we require. That's the conundrum that led to having to define our own syntax. The reading system spec is more permissive than the authoring. An invalid authored tag doesn't mean a reading system can't still parse out the specific values it's looking for. We don't define a parsing algorithm, so a reading system could use the CSS algorithm.
Note, that reading systems have to ignore the tag for both FXL and reflowable docs per s. 8.3. I'm not sure if there's any practical gain in ensuring compatibility beyond avoiding errors where a tag is probably invalid anyway. |
Agreed
Exactly. We cannot get around this. Taking into account that the CSS spec may take ages to become (if it becomes) a standard, we are stuck with our normative definition.
We cannot/should not speculate on this. It may take a long time, we might have more implementation experience and, in a future EPUB 3.X we can see what we can do. Maybe the implementation experience is such that it will be all right to reduce "our" syntax even more (we had the discussion this summer and, if I remember well, we started with a much more restrictive syntax than what we have now). |
ok. Another possibly relevant ref is the WHATWG meta extension registry, which is a live doc and will likely be updated to point to the latest relevant
right, I understand. I was thinking that we could leave it open by simplifying the requirement to:
and then leave the work on how to extract the required info to the RS. This would make the EPUB spec compatible with whatever comes next on the My primary concern is the following:
for instance:
The devil is always in the details 😊 I'm wondering if the EPUB spec is not more strict than needed here (for the sake of spec theoretical completeness) when we lack data or testing to better understand the landscape. But then, it's my own not-so-well-informed questioning; if you're confident that the normative syntax restriction cannot hit us back, then I'm OK (except for the duplicate-property case that is still worth being clarified IMO). |
For me, the requirement for reading systems to ignore the tag makes any concerns moot. We'd have to return to the tag in the future, at the very least, to undo that restriction if we decide it should be used for rendering. The syntax matches valid viewport meta tags as they are now, and as we've defined them for FXLs, so I'm okay with leaving things as they are. |
Sure, for reflowable documents I totally agree the point is moot.
A couple examples to make it clear what concerns me:
|
I must admit I am a bit worried about turning the EBNF into an algorithmic specification; we know that it takes an awful lot of time to do that right, and we are a bit late in the process (wearing my W3C hat I have to worry about these things...)... To answer to the first issue, I am happy extending the specification by an additional constraint into the spec section whereby all property names MUST be unique. Which would "simply" make your first example invalid as well, and that would not keep me awake at night. Also reacting on your second remark, I am not sure if we should really go into the discussion on whether the RS processing may easily extract suitable values or not; being draconian may be the right way to go here. You are right that tests are missing on Interestingly, though, the RS spec says (in §8.1.2):
i.e., it is a SHOULD not a MUST. I guess the reason is that this is probably not widely implemented... |
It was only added this revision. Given that a reading system could opt to not display the document as FXL, or choose some other way to define the ICB, and that would have been valid for the last decade, a recommendation seems appropriate. |
Wow, a lot of content in this thread! Some thoughts / responses: Some current testing behavior for Apple Books:
Currently, Apple Books finds and uses the first width, height for this example.
Currently, the width and height are found and used for this example. For I'm guessing you all have been through discussions around the following, but here are some high level thoughts:
Some conclusions for the reading application:
|
Without checking the details... but one way forward would be:
|
The issue was discussed in a meeting on 2022-10-07 List of resolutions:
View the transcript1. Some comments on the viewport meta tag (issue epub-specs#2442)See github issue epub-specs#2442. Romain Deltour: I had a late review of new viewport spec. Ivan Herman: to pick up on what romain said.
Ivan Herman: for example Apple can make sense of an invalid viewport tag. Romain Deltour: I agree that the spec already set that device height/width should be used when faced with an invalid value.
Romain Deltour: if the reading system can do its best to render something, or make up a value that's good enough. David Hall: I like your rec there.
David Hall: separately, what to do when there isn't anything specced. Wendy Reid: as much as i like the idea of warning the user. Brady Duga: agree with David and Wendy. Ivan Herman: we have multiple viewports in the spec.
Ivan Herman: (different page sizes for different files). David Hall: when I think of users, do you think of author and publisher as the same user. Ivan Herman: we don't specify that. David Hall: I can see a publisher being interested in results from epubcheck. Ivan Herman: yes. Dave Cramer: We're talking a lot about the situation where the author messed up the viewport. Wendy Reid: if we reach any sort of consensus we don't want to put anything on the end user/reader.
Wendy Reid: but we want requirements around validity of viewport. Brady Duga: +1 to using may instead of should. Charles LaPierre: Q about checking viewport on mobile devices. Dave Cramer: viewport is property of EPUB not device, spec says how to adapt.
|
I checked with our team on what we (VitalSource Bookshelf) do if a viewport is missing: Our stand is that viewport is required to be specified by the standard for a fixed layout document. |
Thanks @rickj. That does mean that the strategy described in #2442 (comment) for missing viewport should be a SHOULD. (And would be a MAY report an error.) Is that ok? |
I agree. |
First, sorry about missing the discussion in #2292, #2341, and #2350 last summer. It went totally under my radar! 😅
A couple (late) comments:
@viewport
, and move theviewport
meta
tag definition to a new spec. A CSS Viewport draft was just created.viewport
meta
tag in EPUB 3.3 is somewhat restrictive when compared to the parsing algorithm defined in CSS Viewport (formerly CSS Device Adaptation).",invalid,,height=200,width=,width=100"
the algorithm returns the name/value pair list("height","200"),("width","100")
, when our spec just says the value is invalid.Some concerns:
is it ok to reference
css-device-adapt
(even informatively) when we know the spec is doomed?At least, I would rephrase the following:
to something along the lines of:
(so that we no longer reference the for-now-defunct
@viewport
at-rule.I have a (slightly) nagging feeling with having our own normative definition of the
viewport
meta
element in EPUB:The text was updated successfully, but these errors were encountered: