Closed Bug 1705128 Opened 4 years ago Closed 4 years ago

[wpt-sync] Sync PR 28476 - 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: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

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

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}

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 2 tests and 2 subtests

Status Summary

Firefox

OK : 1
FAIL : 2
ERROR: 1

Chrome

OK : 2
PASS : 6
FAIL : 3

Safari

OK : 1
FAIL : 2
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)
/css/cssom/cssstyledeclaration-registered-custom-properties.html
Registered custom properties are included in CSSComputedStyleDeclaration: FAIL (Chrome: FAIL, Safari: FAIL)
Only relevant custom properties are included: FAIL (Chrome: FAIL, Safari: FAIL)

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/4bc07eb6d697 [wpt PR 28476] - Include custom properties on computed CSSStyleDeclaration, a=testonly https://hg.mozilla.org/integration/autoland/rev/75d77c813120 [wpt PR 28476] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.