Closed
Bug 1382102
Opened 6 years ago
Closed 6 years ago
stylo: :nth-child() shouldn't match element inside XBL anonymous subtree
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: xidorn, Assigned: TYLin)
References
Details
Attachments
(2 files, 1 obsolete file)
Test layout/style/test/test_selectors_on_anonymous_content.html checks that :nth-child() in the outer document doesn't match element inside XBL anonymous subtree.
Reporter | ||
Comment 1•6 years ago
|
||
This seems to be XBL-related. TYLin, could you have a look?
Flags: needinfo?(tlin)
Reporter | ||
Updated•6 years ago
|
Priority: -- → P3
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 4•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=178a0bfb74909b70336819aa367d9293ba87313d
Assignee: nobody → tlin
Status: NEW → ASSIGNED
Flags: needinfo?(tlin)
Comment 5•6 years ago
|
||
mozreview-review |
Comment on attachment 8897422 [details] style: Skip matching :nth-child if element is the root of anonymous subtree https://reviewboard.mozilla.org/r/168738/#review174164 r=me, with the method renamed. Thanks for fixing this! ::: servo/components/selectors/matching.rs:779 (Diff revision 1) > flags_setter: &mut F) > -> bool > where E: Element, > F: FnMut(&E, ElementSelectorFlags), > { > + if element.is_root_of_anonymous_subtree() { I don't think we should not call `is_root_of_anonymous_subtree` to this. Anon content is a very specific Gecko thing, and `selectors` is supposed to be a generic crate. It's somewhat annoying because they shouldn't match even `:nth-child(1)`, sigh... What about an `ignores_nth_child_selectors` kind of flag, that returns false by default, and returns `is_root_of_anonymous_subtree` in `gecko/wrapper.rs`? I can't think of a really better name, but if you do find one, that'd be great :)
Attachment #8897422 -
Flags: review?(emilio+bugs) → review+
Comment 6•6 years ago
|
||
mozreview-review |
Comment on attachment 8897423 [details] Bug 1382102 - Update mochitest expectation. https://reviewboard.mozilla.org/r/168740/#review174168
Attachment #8897423 -
Flags: review?(emilio+bugs) → review+
Assignee | ||
Comment 7•6 years ago
|
||
mozreview-review-reply |
Comment on attachment 8897422 [details] style: Skip matching :nth-child if element is the root of anonymous subtree https://reviewboard.mozilla.org/r/168738/#review174164 > I don't think we should not call `is_root_of_anonymous_subtree` to this. > > Anon content is a very specific Gecko thing, and `selectors` is supposed to be a generic crate. > > It's somewhat annoying because they shouldn't match even `:nth-child(1)`, sigh... > > What about an `ignores_nth_child_selectors` kind of flag, that returns false by default, and returns `is_root_of_anonymous_subtree` in `gecko/wrapper.rs`? > > I can't think of a really better name, but if you do find one, that'd be great :) > Anon content is a very specific Gecko thing, and selectors is supposed to be a generic crate. You're right. It's better to keep `selectors` generic. I think `ignores_nth_child_selectors` naming is good enough. Let's use that.
Comment hidden (mozreview-request) |
Assignee | ||
Updated•6 years ago
|
Attachment #8897422 -
Attachment is obsolete: true
Assignee | ||
Comment 9•6 years ago
|
||
Assignee | ||
Comment 10•6 years ago
|
||
https://hg.mozilla.org/integration/autoland/rev/4ee1bb020c9f
Comment 11•6 years ago
|
||
Pushed by tlin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a531a8c8f75a Update mochitest expectation. r=emilio
Comment 12•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a531a8c8f75a
Status: ASSIGNED → RESOLVED
Closed: 6 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
•