Closed Bug 1850894 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 41727 - Revert "Invalidation on stylesheet changes using selector matching"

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox119 fixed)

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 41727 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/41727
Details from upstream follow.

Jiewei Qian <qjw@chromium.org> wrote:

Revert "Invalidation on stylesheet changes using selector matching"

This reverts commit 5d12010188b8fd648efd2279956e8a6cbe20654e.

Reason for revert: Speculative revert for breaking mac11,12,13
https://ci.chromium.org/ui/b/8771281724277921585
https://ci.chromium.org/ui/b/8771284467376453201
https://ci.chromium.org/ui/b/8771287407119542833

Original change's description:

Invalidation on stylesheet changes using selector matching

When inserting, deleting or modifying stylesheets, we need to invalidate
style for some elements, even though the elements themselves did not
change. Currently, we reuse the concept of InvalidationSets, which are
mostly designed for changes to elements, for that. This can sometimes
cause overbroad invalidations, especially if the style is written in
a “modern” (read: less-than-ideal) fashion.

We replace this by a somewhat slower but more precise and probably
simpler system; for each candidate element in the DOM, we see if it
matches any selectors in the old or the new rulesets (by means of
the same bucketing logic we currently have during element rule
collection), and if so, we mark it for style recalc. This isn't perfect;
if we are e.g. adding a single rule to an existing stylesheet, we would
still invalidate based on all rules in the sheet. We hope to improve
this in a future patch, but even now, this shows significant
improvements over most of blink_perf.css, with only a few regressions.

Note that this means the experimental style invalidation information in
devtools becomes somewhat less useful; it will no longer give reasons
for invalidations when style sheets change. Fixing this would probably
involve extending the protocol, although I haven't looked deeply into
this.

Bug: 1444522
Change-Id: Ib95cf8d215bf4e7b58ab1955ebc1f3c7e31aead8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4783456
Commit-Queue: Steinar H Gunderson \<sesse@chromium.org>
Reviewed-by: Adithya Srinivasan \<adithyas@chromium.org>
Reviewed-by: Rune Lillesveen \<futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1190433}

Bug: 1444522
Change-Id: I8cf2323c0adb47e6a1dc202f5e63e878b650a1d9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4829305
Auto-Submit: Jiewei Qian \<qjw@chromium.org>
Owners-Override: Jiewei Qian \<qjw@chromium.org>
Bot-Commit: Rubber Stamper \<rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper \<rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1190518}

PR 41727 applied with additional changes from upstream: 1aaf432aa82f200f0aa06a9c34b9f494024e2831
The PR was not expected to affect any tests, but the try push wasn't a success. Check the try results for infrastructure issues
Test result changes from PR not available.
Test result changes from PR not available.
Test result changes from PR not available.
Test result changes from PR not available.
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8355d7938542 [wpt PR 41727] - Revert "Invalidation on stylesheet changes using selector matching", a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
You need to log in before you can comment on or make changes to this bug.