Closed Bug 1705517 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 28525 - Revert "Include custom properties on computed CSSStyleDeclaration"

Categories

(Core :: DOM: CSS Object Model, task, P4)

task

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

b'Anders Hartvoll Ruud <andruud@chromium.org>' wrote:

Revert "Include custom properties on computed CSSStyleDeclaration"

This reverts commit 3b8999adcdc905f13b22bbde6b198f158cb9d6c7.

Reason for revert: Huge performance regressions.

Bug: 949807
Fixed: 1199142

Original change's description:

Include custom properties on computed CSSStyleDeclaration

Since we need a "stable" list of custom properties for length()
and item(), and we also need not-abysmal performance when calling
those functions, this CL caches a vector with the variables names
on ComputedStyle itself.

In CSSComputedStyleDeclaration::item(), we check if the incoming
index is in the range of the standard properties, and if so return
the appropriate one. Otherwise, we're in the variable range (which
is defined per spec to appear after the standard properties), and
we'll fetch the list of variable names.

Unfortunately the inclusion of custom properties requires a clean
style, which means length()/item() now updates style/layout as needed.
This might cause performance regressions, but I don't see a way around
this.

Note: ComputedStyle::StyleInheritedVariables/NonInheritedVariables
were changed to return const pointers, as to not "leak mutability",
which would have made it hard to invalidate the cache. (Nothing
requires those return values to be non-const after StyleCascade
anyway).

Note: ComputedStyle::GetVariableNames() has pretty good test coverage
in ComputedStyleTest already. Added a couple of new ones that target
cache invalidation.

Fixed: 949807
Change-Id: I6b181af5c4f025c4fd433de0a6ca221055c16693
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2822260
Commit-Queue: Anders Hartvoll Ruud \<andruud@chromium.org>
Reviewed-by: Rune Lillesveen \<futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#872446}

Change-Id: I071cc2e00838a17407fc0d1e5745db9894d59ceb

Reviewed-on: https://chromium-review.googlesource.com/2829151
WPT-Export-Revision: a8a8c3666cfbe889081ebca5638b0c2a8f897289

PR 28525 applied with additional changes from upstream: 72e8d5c2463fb0109f53a3a4357a998cb66d391b
Component: web-platform-tests → DOM: CSS Object Model
Product: Testing → Core

CI Results

Ran 15 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests and 7 subtests

Status Summary

Firefox

ERROR: 1

Chrome

OK : 1
PASS : 7

Safari

ERROR: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/css/css-typed-om/the-stylepropertymap/computed/computed.tentative.html: ERROR [GitHub], SKIP [Gecko-android-em-7.0-x86_64-debug-geckoview, Gecko-android-em-7.0-x86_64-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-debug, Gecko-linux1804-64-opt, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-linux1804-64-tsan-opt, Gecko-windows10-64-debug, Gecko-windows10-64-opt, Gecko-windows10-64-qr-debug, Gecko-windows10-64-qr-opt, Gecko-windows7-32-debug, Gecko-windows7-32-opt] (Chrome: OK, Safari: ERROR)

Tests Disabled in Gecko Infrastructure

/css/css-typed-om/the-stylepropertymap/computed/computed.tentative.html: ERROR [GitHub], SKIP [Gecko-android-em-7.0-x86_64-debug-geckoview, Gecko-android-em-7.0-x86_64-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-debug, Gecko-linux1804-64-opt, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-linux1804-64-tsan-opt, Gecko-windows10-64-debug, Gecko-windows10-64-opt, Gecko-windows10-64-qr-debug, Gecko-windows10-64-qr-opt, Gecko-windows7-32-debug, Gecko-windows7-32-opt] (Chrome: OK, Safari: ERROR)

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/128bb9ccf9c9
[wpt PR 28525] - Revert "Include custom properties on computed CSSStyleDeclaration", a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.