Closed
Bug 1384225
Opened 7 years ago
Closed 7 years ago
stylo: No error reporting for unknown media features
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: ferjm)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 5 obsolete files)
2.16 KB,
patch
|
jdm
:
review+
|
Details | Diff | Splinter Review |
Testcase: @media screen and (totally-unknown-feature) { * { color: green } } Gecko says: Expected media feature name but found ‘totally-unknown-feature’. Stylo says absolutely nothing. Note that this is NOT a parse error, by the way.
Comment 1•7 years ago
|
||
parse_media_query_list in components/style/media_queries.rs stops parsing media queries after an error is returned from MediaQuery::parse, but there is no code that reports an error anywhere. This would need a new ContextualParseError variant that could be passed to log_css_error from that code.
Reporter | ||
Updated•7 years ago
|
Priority: -- → P3
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → ferjmoreno
Assignee | ||
Comment 2•7 years ago
|
||
Servo PR https://github.com/servo/servo/pull/18341
Assignee | ||
Comment 3•7 years ago
|
||
Attachment #8904269 -
Flags: review?(josh)
Assignee | ||
Comment 4•7 years ago
|
||
Comment on attachment 8904269 [details] [diff] [review] Tests Actually, I think I can get more detailed errors.
Attachment #8904269 -
Flags: review?(josh)
Assignee | ||
Comment 5•7 years ago
|
||
Attachment #8904269 -
Attachment is obsolete: true
Attachment #8904565 -
Flags: review?(josh)
Comment 6•7 years ago
|
||
Comment on attachment 8904565 [details] [diff] [review] Tests Review of attachment 8904565 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/style/test/test_css_parse_error_smoketest.html @@ +33,5 @@ > { css: ". {}", error: "Expected identifier for class selector but found ‘ ’. Ruleset ignored due to bad selector." }, > > { css: ":not() {}", error: "Missing argument in negation pseudo-class ‘)’. Ruleset ignored due to bad selector." }, > + > + { css: "@media (totally-unknown-feature) {}", error: "Expected media feature name but found ‘ (totally-unknown-feature) ’." }, I suspect this does not pass if we run `./mach mochitest layout/style/test/test_css_parse_error_smoketest.html --setpref layout.css.servo.enabled=false`. Please check that?
Comment 7•7 years ago
|
||
Yes, the equivalent gecko warning is: "Expected media feature name but found ‘totally-unknown-feature’.": http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cstyle%3E%0A%40media%20(totally-unknown-feature)%20%7B%7D%0A%3C%2Fstyle%3E
Assignee | ||
Comment 8•7 years ago
|
||
I wasn't sure if we want the exact same output as Gecko, but I suspect we don't since you asked me to turn RangedExpressionWithNoValue into a more generic MediaQueryExpectedFeatureValue.
Attachment #8904565 -
Attachment is obsolete: true
Attachment #8904565 -
Flags: review?(josh)
Attachment #8905442 -
Flags: review?(josh)
Assignee | ||
Comment 9•7 years ago
|
||
Ugh... now with the updated patch.
Attachment #8905442 -
Attachment is obsolete: true
Attachment #8905442 -
Flags: review?(josh)
Attachment #8905444 -
Flags: review?(josh)
Assignee | ||
Comment 10•7 years ago
|
||
Attachment #8905444 -
Attachment is obsolete: true
Attachment #8905444 -
Flags: review?(josh)
Attachment #8905459 -
Flags: review?(josh)
Comment 11•7 years ago
|
||
Comment on attachment 8905459 [details] [diff] [review] Tests Review of attachment 8905459 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/style/test/test_css_parse_error_smoketest.html @@ +41,5 @@ > + : "Expected media feature name but found ‘totally-unknown-feature’." }, > + { css: "@media \"foo\" {}", > + error: isStylo > + ? "Expected identifier in media list but found ‘ \"foo\" ’." > + : "Expected identifier in media list but found ‘\"foo\"’." }, These differences suggest to me that we're not providing the actual token to the final error message. @@ +45,5 @@ > + : "Expected identifier in media list but found ‘\"foo\"’." }, > + { css: "@media (min-width) {}", > + error: isStylo > + ? "Found invalid value for media feature." > + : "Media features with min- or max- must have a value." }, Oops, I made a mistake when requesting this change. We do actually want identical output for Gecko and Stylo.
Attachment #8905459 -
Flags: review?(josh) → review-
Assignee | ||
Comment 12•7 years ago
|
||
Attachment #8905459 -
Attachment is obsolete: true
Attachment #8905877 -
Flags: review?(josh)
Comment 13•7 years ago
|
||
Comment on attachment 8905877 [details] [diff] [review] bug1384225.media.errors.test.patch Review of attachment 8905877 [details] [diff] [review]: ----------------------------------------------------------------- Thanks!
Attachment #8905877 -
Flags: review?(josh) → review+
Comment 14•7 years ago
|
||
Pushed by ferjmoreno@gmail.com: https://hg.mozilla.org/integration/autoland/rev/0dadc40f8fd5 stylo: Error reporting for unknown media features. Tests. r=jdm
Comment 15•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0dadc40f8fd5
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in
before you can comment on or make changes to this bug.
Description
•