Closed
Bug 1345699
Opened 7 years ago
Closed 7 years ago
stylo: Ensure that we never optimize out recascading in NAC subtrees
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
People
(Reporter: bholley, Assigned: heycam)
References
Details
Attachments
(1 file)
This isn't so much a work item as it is a reminder to make sure we don't screw this up when we start optimizing the cascade more. Since NAC inherits style from the first non-NAC ancestor, we need to make sure that we don't mistakenly conclude that our direct children can't have inherited any of our properties and then cull the cascade.
Comment hidden (mozreview-request) |
Assignee | ||
Comment 2•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=bed716b3253d6238aba185ebdb2eb535781b2bb1
Comment 3•7 years ago
|
||
mozreview-review |
Comment on attachment 8874352 [details] Bug 1345699 - stylo: Always re-cascade in native anonymous subtrees. https://reviewboard.mozilla.org/r/145716/#review149678 ::: servo/components/style/traversal.rs:704 (Diff revision 1) > } > } > > + // We must always cascade native anonymous subtrees, since they inherit styles > + // from their first non-NAC ancestor. > + if element.is_native_anonymous() { This is somewhat sad for `::before/::after` pseudo-elements I guess... Could we guard it with something like: ``` element.is_native_anonymous() && self.parent_element() != self.closest_native_anonymous_ancestor() ``` Anyway. r=me. Is there a way to add a test for this? I guess it involves some of the number input pseudos, which may be annoying.
Attachment #8874352 -
Flags: review?(emilio+bugs) → review+
Assignee | ||
Comment 4•7 years ago
|
||
(In reply to Emilio Cobos Álvarez [:emilio] from comment #3) > Is there a way to add a test for this? I guess it involves some of the > number input pseudos, which may be annoying. Not only that, it requires a kind of restyle where we'll decide to stop cascading mid-way through the NAC subtree. I'm putting that test in the too hard basket...
Assignee | ||
Comment 5•7 years ago
|
||
(In reply to Emilio Cobos Álvarez [:emilio] from comment #3) > This is somewhat sad for `::before/::after` pseudo-elements I guess... Could > we guard it with something like: > > ``` > element.is_native_anonymous() && self.parent_element() != > self.closest_native_anonymous_ancestor() > ``` How does this help ::before / ::after?
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(emilio+bugs)
Comment 6•7 years ago
|
||
It would avoid forcibly recascading those, since they wouldn't match that (their DOM parent is their closest non-NAC ancestor). Of course I made a typo and the condition should read closest_non_native_anonymous_ancestor though.
Flags: needinfo?(emilio+bugs)
Assignee | ||
Comment 7•7 years ago
|
||
But isn't is the case for the root of any NAC subtree, that its parent is the closest non-NAC ancestor?
Comment 8•7 years ago
|
||
Oh, sure, but aren't we force are cascading those? You're right that we could check the root flag instead.
Assignee | ||
Comment 9•7 years ago
|
||
Per IRC discussion last night, we should move this check up into the "if compute_self" block so that we don't force cascade NAC subtrees when we didn't even restyle the originating element.
Assignee | ||
Comment 10•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=f44bb6fb61b800eb4c43662686f78003af4c7d68
Assignee: nobody → cam
Status: NEW → ASSIGNED
Assignee | ||
Comment 11•7 years ago
|
||
https://github.com/servo/servo/pull/17204
Assignee | ||
Updated•7 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•