-
Notifications
You must be signed in to change notification settings - Fork 4
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
Test pass conditions wrong #1
Comments
TBH a handful of your tests I could just not wrap my head around, and that's probably my own shortcoming. I've also added a bunch of new tests, reorganized them into readable thematic groups, etc. Just for starters, in the fifth reference test, I don't understand why Are CSS-style comments supposed to be ignored/stripped? Before or after splitting on commas? Also, zero (and +0 and -0) are valid non-negative css lengths, correct? I could go on and on. There's a lot that doesn't make sense to me in these tests. I'm trying to avoid the code weight of a full-blown CSS parser while still doing a decent job at this. If you could point out the what I've bungled and explain a bit about what I'm misunderstanding I would be extremely grateful. |
The Similarly, the
That one would result in
Yes. Before. You're also supposed to tokenize into component values before splitting on commas, but I understand you don't want to do that. Given that, I would not bother doing anything about CSS comments either, and just say in documentation that you don't support things like CSS comments or CSS escapes, and have wrong behavior for invalid constructs like matching (), [] and {} per CSS rules. If you change your mind about using a CSS parser, I recommend https://github.com/tabatkins/parse-css
Yes. HTH, |
Thank you. Weirdly, in Chrome Canary, line 19 is actually selecting I've refactored to handle CSS-style comments correctly, which on reflection I think is important because handwritten markup might include helpful comments on breakpoints. Can you explain a bit about how compound media conditions are supposed to be handled? I'm having trouble unpacking this. E.g. is this test correct:
Or does a compound construct needs outer parens to pass?
|
Ah, the behavior in Canary is explained by it selecting the biggest image that is already available in cache (or as a data: URL). I guess I need to use a regular URL for these tests and use unique URLs for each one to avoid cache affecting the selection. Thanks for catching this.
http://dev.w3.org/csswg/mediaqueries-4/#typedef-media-condition |
Thanks, yes sounds good. Regarding compound queries, in both FF Aurora and Chrome Canary:
See: http://jsfiddle.net/9hqwmtdy/1/ Note that for the last two the http://dev.w3.org/csswg/mediaqueries4/#error-handling But it seems to be valid based on the spec. I don't see any error. Why does this work in stylesheets but not in matchMedia? Am I just doing this the wrong way? Should I be testing the component conditions atomically with my own logic? Or is it that browsers haven't implemented MQ level 4 yet, and this is a bug? |
Yeah. :( I think Blink is somewhere in-between L3 and L4. @yoavweiss |
Blink's MQ parser, which is used by |
Some tests don't have the same pass condition as the original test. e.g. the CSS comment test. Is that intentional? How did you decide on the expected value?
The text was updated successfully, but these errors were encountered: