-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix StyleColor::UnresolvedColorMix::operator==
Bug: 1522095 Change-Id: Ib9b41c8b865aeb72ac1881503639231faaf68c40 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5245748 Commit-Queue: Kevin Ellis <[email protected]> Reviewed-by: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/main@{#1253884}
- Loading branch information
1 parent
0b1c92d
commit 49a46a3
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
css/css-backgrounds/animations/background-color-transition-colormix.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<title>currentColor in nested color-mix() with transition</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-color/#currentcolor-color"> | ||
<style> | ||
#parent { | ||
color: white; | ||
background-color: | ||
color-mix(in srgb, | ||
color-mix(in srgb, black, currentColor), | ||
black); | ||
height: 200px; | ||
width: 200px; | ||
} | ||
#child { | ||
background-color: inherit; | ||
transition: background-color; | ||
height: 100px; | ||
width: 100px; | ||
} | ||
</style> | ||
<div id="parent"> | ||
<div id="child"></div> | ||
</div> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/web-animations/testcommon.js"></script> | ||
<script> | ||
async function runTest() { | ||
promise_test(async t => { | ||
await waitForNextFrame(); | ||
const child = document.getElementById('child'); | ||
const parent = document.getElementById('parent'); | ||
let parentBG = getComputedStyle(parent).backgroundColor; | ||
let childBG = getComputedStyle(child).backgroundColor; | ||
|
||
assert_equals(parentBG, "color(srgb 0.25 0.25 0.25)"); | ||
assert_equals(childBG, "color(srgb 0.25 0.25 0.25)"); | ||
|
||
// Style change triggers a CSS transition. Wait for the | ||
// transition to start. | ||
await waitForNextFrame(); | ||
child.style = 'color:black'; | ||
await Promise.all(document.getAnimations().map(a => a.ready)); | ||
|
||
parentBG = getComputedStyle(parent).backgroundColor; | ||
childBG = getComputedStyle(child).backgroundColor; | ||
assert_equals(parentBG, "color(srgb 0.25 0.25 0.25)"); | ||
assert_equals(childBG, "color(srgb 0 0 0)"); | ||
}, 'Transition with currentColor in color-mix'); | ||
} | ||
window.onload = runTest(); | ||
</script> |