Closed
Bug 1382102
Opened 8 years ago
Closed 8 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•8 years ago
|
||
This seems to be XBL-related. TYLin, could you have a look?
Flags: needinfo?(tlin)
| Reporter | ||
Updated•8 years ago
|
Priority: -- → P3
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 4•8 years ago
|
||
Assignee: nobody → tlin
Status: NEW → ASSIGNED
Flags: needinfo?(tlin)
Comment 5•8 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•8 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•8 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•8 years ago
|
Attachment #8897422 -
Attachment is obsolete: true
| Assignee | ||
Comment 9•8 years ago
|
||
| Assignee | ||
Comment 10•8 years ago
|
||
Comment 11•8 years ago
|
||
Pushed by tlin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a531a8c8f75a
Update mochitest expectation. r=emilio
Comment 12•8 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 8 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
•