Closed
Bug 1388911
Opened 7 years ago
Closed 7 years ago
stylo: Invalid @namespace rule ending with {} is registered in ns map
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: xidorn, Assigned: xidorn)
References
(Blocks 1 open bug)
Details
In layout/reftests/w3c-css/received/css-namespaces-3/syntax-013.xml, something like
> @namespace "test" {}
> t { background:lime }
is broken. The style rule in the second line is not recognized, which causes this test to fail.
Assignee | ||
Updated•7 years ago
|
Priority: -- → P3
Comment 1•7 years ago
|
||
https://github.com/servo/rust-cssparser/blob/master/src/rules_and_declarations.rs should take care of ending an at-rule at the first semicolon or curly-braces block, whichever comes first. I’ll investigate tomorrow.
Assignee: nobody → simon.sapin
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•7 years ago
|
||
So at this moment, this reftest doesn't fail, because .xml files are not handled by stylo regardless of whether stylo is enabled. Enabling stylo for xml files is tracked in bug 1370508.
To reproduce this with a stylo build before bug 1370508 lands, you can change the extension of the test file to .html or .xhtml instead.
Comment 3•7 years ago
|
||
Fiddling with devtools after renaming the file to .xhtml, I found that CSSOM for that stylesheet looks as expected: one style rule, no @namespace rule. But the selector still doesn’t match.
This is because, in components/style/stylesheets/rule_parser.rs in <TopLevelRuleParser as AtRuleParser>::parse_prelude, we register a namespace prefix even though the @namespace rule can still be invalid by having a {} block instead of a ; semicolon. We need to either:
* Add to cssparser a callback (AtRuleParser trait method) for the semicolon case. There’s nothing to parse there, but we’d move the side effect of namespace registration there.
* Or move registration up the stack to the users of TopLevelRuleParser. There’s two, in components/style/stylesheets/stylesheet.rs and components/style/stylesheets/mod.rs.
Updated•7 years ago
|
Assignee: simon.sapin → nobody
Status: ASSIGNED → NEW
Updated•7 years ago
|
Summary: stylo: Invalid @namespace rule make parser ignore following content → stylo: Invalid @namespace rule ending with {} is registered in ns map
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → xidorn+moz
Assignee | ||
Comment 6•7 years ago
|
||
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c057e3b320f0
Update expectation for this bug after landing servo/servo#18336.
Comment 8•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in
before you can comment on or make changes to this bug.
Description
•