Bug 1642560 [wpt PR 23906] - Set color-scheme-senstive initial color via cascade...
commitd042adf4dbadecd1bc0b5a2acdeebe5e9c212f4f
authorAnders Hartvoll Ruud <andruud@chromium.org>
Wed, 3 Jun 2020 04:25:53 +0000 (3 04:25 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Sun, 7 Jun 2020 13:36:23 +0000 (7 13:36 +0000)
tree001bcc013779831c5076c8b42bcc4fe82a9e2af8
parent55a0eb027e108b795acd954907438acd66b5dae5
Bug 1642560 [wpt PR 23906] - Set color-scheme-senstive initial color via cascade, a=testonly

Automatic update from web-platform-tests
Set color-scheme-senstive initial color via cascade

We currently adjust the computed value of 'color' on the document
element to simulate 'canvastext' behavior. However, there's an
incorrect assumption that it's safe to adjust whenever there are no
'color' declarations in the cascade.

During a transition, the base ComputedStyle is the destination style
for the transitioning element, and on the final frame of the
transition, the StyleEngine simply emits a copy of the base style,
without adding any declaration to the cascade. This causes color-
transitions on the document element to "snap back" to black (or white,
depending on color-scheme) when the transition ends.

This CL fixes this by adding an explicit value (CSSInitialColorValue)
which represents this behavior to the cascade. The value is added only
when computing the base style, which prevents incorrect adjustments on
top of the final transition frame.

Bug: 1087188
Change-Id: Ie0d95aaab5b93f1749e461fad0baf41a184f7cb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2224222
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Kevin Ellis <kevers@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774178}

--

wpt-commits: c20b45a0352c65db0ef7f141edfd68d01f1516e2
wpt-pr: 23906
testing/web-platform/tests/css/css-transitions/root-color-transition-ref.html [new file with mode: 0644]
testing/web-platform/tests/css/css-transitions/root-color-transition.html [new file with mode: 0644]