:not(:has(~ .item > :nth-child(2)) not getting invalidated correctly (was: CSS not applying correctly when element added/removed)
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
People
(Reporter: ben.ashton, Assigned: dshin)
References
(Blocks 1 open bug, Regression, )
Details
(Keywords: regression)
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Steps to reproduce:
- Use the following CSS to give an "item" a blue background whenever it is not followed by another item that has at least two children:
.item:not(:has(~ .item > :nth-child(2))) {
background: blue;
}
- Add/remove items with two children
Actual results:
When adding/removing items, the styling of dependent items does not update until some other change is made. Various actions can cause the styling to update like inspecting the element, resizing the browser window (only works sometimes), or adding/removing stylesheets.
Please see the attached minimal reproduction which includes buttons to add/remove an element, and refresh the styles.
Expected results:
When adding/removing items, the styling of dependent items should update immediately
Reporter | ||
Comment 1•6 months ago
|
||
Forgot to mention, if you uncomment the empty CSS rule in the attached file, that magically fixes the problem.
![]() |
||
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
![]() |
||
Comment 2•5 months ago
|
||
Regression window:
https://hg-edge.mozilla.org/integration/autoland/pushloghtml?fromchange=eccda51a6f68b20cfe9af1e94b9336b9856b103e&tochange=02f729ed8438c8611f8352364030fd59e24bd244
Suspect: Bug 1853258
Comment 3•5 months ago
|
||
Set release status flags based on info from the regressing bug 1853258
:dshin, since you are the author of the regressor, bug 1853258, could you take a look?
For more information, please visit BugBot documentation.
Updated•5 months ago
|
Assignee | ||
Comment 4•5 months ago
|
||
Ah, the :has
optimization path should not be taken if we find any unknown match.
Assignee | ||
Comment 5•5 months ago
|
||
Previous behaviour where we did not do compound matching is incorrect, but the
order invalidations are added bailed us out (Which makes it fragile).
Add a way to skip this "pull-up" behaviour for indexing selectors, since
element's poisition matters.
Updated•5 months ago
|
Updated•5 months ago
|
Comment 10•5 months ago
|
||
Perfherder has detected the following talos performance change. Do you think push 9a06e070b01f1b1f12a028220a940563efb6de75 could have caused it? At the moment some jobs are failing to run and it looks like either this bug or Bug 1966190 could have caused these regressions:
Regressions:
Ratio | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|
28% | perf_reftest_singletons append-nth-edge-has-pseudo.html | windows11-64-24h2-shippable | e10s fission stylo webrender | 4.41 -> 5.63 |
27% | perf_reftest_singletons append-nth-edge-has-pseudo.html | linux1804-64-shippable-qr | e10s fission stylo webrender | 15.14 -> 19.24 |
27% | perf_reftest_singletons append-nth-edge-has-pseudo.html | linux1804-64-shippable-qr | e10s fission stylo webrender | 14.93 -> 18.91 |
25% | perf_reftest_singletons append-nth-edge-has-pseudo.html | macosx1470-64-shippable | e10s fission stylo webrender | 8.40 -> 10.53 |
22% | perf_reftest_singletons remove-front-has-pseudo.html | linux1804-64-shippable-qr | e10s fission stylo webrender | 1.51 -> 1.84 |
22% | perf_reftest_singletons remove-front-has-pseudo.html | macosx1470-64-shippable | e10s fission stylo webrender | 1.12 -> 1.37 |
18% | perf_reftest_singletons remove-front-has-pseudo.html | windows11-64-24h2-shippable | e10s fission stylo webrender | 0.56 -> 0.66 |
Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.
Assignee | ||
Comment 11•5 months ago
|
||
Hmm. I'll have to investigate.
That said, this was an issue of correctness, so it may be something we have to take as a loss.
Further, bug 1875081 and bug 1874066 added these tests as part of bugs that caused delays in orders of seconds - I don't see such delay on today's Nightly, so I don't think it'll be a huge issue.
Updated•5 months ago
|
Assignee | ||
Updated•4 months ago
|
Comment 12•4 months ago
|
||
Updated•4 months ago
|
Description
•