Closed
Bug 1338982
Opened 8 years ago
Closed 8 years ago
stylo: NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS is not set correctly
Categories
(Core :: CSS Parsing and Computation, defect, P2)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
DUPLICATE
of bug 1345950
People
(Reporter: heycam, Assigned: heycam)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
Here is a test case that fails due to not setting NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS. It also fails in Servo.
Assignee | ||
Comment 2•8 years ago
|
||
Assignee | ||
Comment 3•8 years ago
|
||
Bobby, is there any fundamental reason why we can't allow RESTYLE_LATER_SIBLINGS to be stored in an element's RestyleData? Currently we allow snapshot expansion to produce RESTYLE_LATER_SIBLINGS, which we then notice and return back up to preprocess_children to expand out into (RESTYLE_SELF | RESTYLE_DESCENDANTS) on the later siblings. But we don't allow an eRestyleHint_LaterSiblings to be posted explicitly, which RestyleManager wants to do to handle DOM mutations. We could make RestyleManager post restyles for the later siblings manually, but that seems wasteful.
I guess it would make it hard for has_current_styles() to tell, though.
Flags: needinfo?(bobbyholley)
Assignee | ||
Comment 4•8 years ago
|
||
Although I guess that is already not accurate if a previous sibling has a snapshot that would expand to include RESTYLE_LATER_SIBLINGS?
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → cam
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•8 years ago
|
||
This fixes the "test 2" attachment.
Attachment #8836643 -
Flags: feedback?(bobbyholley)
Comment 6•8 years ago
|
||
Comment on attachment 8836643 [details] [diff] [review]
WIP v0.1
Review of attachment 8836643 [details] [diff] [review]:
-----------------------------------------------------------------
I think we should move this into StoredRestyleHint. Also, probably worth separating the selectors change into a separate commit and getting Simon or emilio to review it (I don't have the codepaths paged in enough to be sure that this is the right place for the check).
Attachment #8836643 -
Flags: feedback?(bobbyholley) → feedback+
Updated•8 years ago
|
Flags: needinfo?(bobbyholley)
Comment 7•8 years ago
|
||
Emilio, is this fixed with your recent latersiblings work?
Flags: needinfo?(emilio+bugs)
Comment 8•8 years ago
|
||
There's no chance the test case number 1 works on stylo because we don't properly implement :empty.
That being said, it doesn't work on servo too. I'll check if the patch fixes it on servo.
Flags: needinfo?(emilio+bugs)
Comment 9•8 years ago
|
||
So, right now only the selectors change is needed to fix that. The change doesn't fix the first test case, but that's just because it doesn't handle the HAS_EMPTY_SELECTOR flag.
Now, the fun stuff. Thinking whether that was the correct place to put the flag, I just realized that all the flag handling introduced in bug 1336646 is broken. Sorry, should've catched that during review :(
Mainly, the way we're doing it right now is that we get this `flags` outparam and apply it to the _original_ element we're matching again, but these selector flags can go arbitrarily around the DOM, for example:
.foo + bar baz baz baz {
color: red;
}
The flag for the slow selector should be inserted in the element we're trying to match the first `bar` again, which may be an arbitrary ancestor or sibling, etc. of the element we're matching against.
The best idea I have right now is using an outparam Vec<(Element, Flags)>, but that sounds quite terrible :(.
Comment 10•8 years ago
|
||
I guess the same is true for relations, but since they're only used for style sharing during the same restyle the worst thing that may happen is that we count more relations than needed.
Comment 11•8 years ago
|
||
The fix for the relations thing is straight-forward, but no so much for the element flags. I plan to fix the relations once I have the style cache working in sequential mode, because of test coverage.
Comment 12•8 years ago
|
||
(In reply to Emilio Cobos Álvarez [:emilio] from comment #9)
> So, right now only the selectors change is needed to fix that. The change
> doesn't fix the first test case, but that's just because it doesn't handle
> the HAS_EMPTY_SELECTOR flag.
>
> Now, the fun stuff. Thinking whether that was the correct place to put the
> flag, I just realized that all the flag handling introduced in bug 1336646
> is broken. Sorry, should've catched that during review :(
>
> Mainly, the way we're doing it right now is that we get this `flags`
> outparam and apply it to the _original_ element we're matching again, but
> these selector flags can go arbitrarily around the DOM, for example:
>
> .foo + bar baz baz baz {
> color: red;
> }
>
> The flag for the slow selector should be inserted in the element we're
> trying to match the first `bar` again, which may be an arbitrary ancestor or
> sibling, etc. of the element we're matching against.
I don't think the selector above would require any slow selectors flags (the later siblings restyle hint should take care of that). But in general I see your point. :-(
I've filed bug 1345950 for this issue.
Updated•8 years ago
|
Comment 13•8 years ago
|
||
(In reply to Bobby Holley (:bholley) (busy with Stylo) from comment #12)
> > .foo + bar baz baz baz {
> > color: red;
> > }
> >
> > The flag for the slow selector should be inserted in the element we're
> > trying to match the first `bar` again, which may be an arbitrary ancestor or
> > sibling, etc. of the element we're matching against.
>
> I don't think the selector above would require any slow selectors flags (the
> later siblings restyle hint should take care of that). But in general I see
> your point. :-(
How not? That would need the HAS_SLOW_SELECTOR_LATER_SIBLINGS flag, otherwise we don't post the LaterSiblings hint.
Comment 14•8 years ago
|
||
Yeah you're right - I was mixing it up with state/attr changes.
Comment 15•8 years ago
|
||
Self-reminder to look at the different tests skipped at https://hg.mozilla.org/integration/autoland/rev/ee95a66bea56e9b7044abab6f12b12257cb6b4b0, which this should fix.
Comment 16•8 years ago
|
||
With the recent :empty/:any/etc support and the recent flags patch, we now pass test_bug534804.html and test_bug73586.html, which test this extensively, so I believe we can close this.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Comment 17•8 years ago
|
||
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/6c10860d02ad
Re-enable no longer timing-dependent tests. r=emilio
Comment 18•8 years ago
|
||
bugherder |
You need to log in
before you can comment on or make changes to this bug.
Description
•