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

srcset parser should look for 'h' descriptors #176

Closed
zcorpan opened this issue May 19, 2014 · 2 comments
Closed

srcset parser should look for 'h' descriptors #176

zcorpan opened this issue May 19, 2014 · 2 comments

Comments

@zcorpan
Copy link

zcorpan commented May 19, 2014

Since we anticipate adding a h descriptor in the future (#85 #86) I think we should make the parser do the right thing now so that we don't get into a situation where Web compat expects 2x 100h to not drop the entire candidate (like we currently do with 2x 100w).

Step 12, add/change
[[
...
Let future-compat-h be absent.
...
(for "x" token)
If width, future-compat-h and density are not all absent, then let error be yes.
...
If the token consists of a valid non-negative integer followed by a "h" (U+0068 LATIN SMALL LETTER H) character
If future-compat-h and density are not both absent, let error be yes.
Apply the rules for parsing non-negative integers to the token. If the result is zero, let error be yes. Otherwise, let future-compat-h be the result.
]]

The only change here would be that specifying both h and x makes the candidate be dropped. The h descriptor is otherwise ignored like today.

@yoavweiss
Copy link
Member

Doesn't that mean that we need to be able to predict whatever descriptors we may want to add in the future?

@zcorpan
Copy link
Author

zcorpan commented May 20, 2014

No, we just predict that h is likely to be added in the future and that it's likely we want it to have the same parsing behavior as w. For anything else we don't know anything and the default behavior of dropping unknown descriptors seems reasonable to me.

yoavweiss added a commit that referenced this issue May 21, 2014
Make the srcset parser aware of 'h' descriptor. Fixes #176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants