Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump cssstyle to fix rgba() and hsl() color handling
- Loading branch information
Showing
3 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
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
49 changes: 49 additions & 0 deletions
49
test/web-platform-tests/to-upstream/cssom/element-style-color.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,49 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Computed visibility is inherited</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<!-- Test for https://github.com/jsdom/jsdom/issues/2639 --> | ||
<!-- Test for https://github.com/jsdom/jsdom/issues/825 --> | ||
|
||
<body> | ||
<p id="paragraph">Hello CSS Style</p> | ||
</body> | ||
|
||
<script> | ||
"use strict"; | ||
|
||
test(() => { | ||
const element = document.querySelector("#paragraph"); | ||
element.style.color = ""; | ||
element.style.color = "rgba(255, 255, 255, 0.5)"; | ||
|
||
assert_equals(element.style.color, "rgba(255, 255, 255, 0.5)"); | ||
}, "Setting a color with a decimal transparency should update the style"); | ||
|
||
test(() => { | ||
const element = document.querySelector("#paragraph"); | ||
element.style.color = ""; | ||
element.style.color = "rgb(0%, 100%, 100%)"; | ||
|
||
assert_equals(element.style.color, "rgb(0, 255, 255)"); | ||
}, "Setting a color with a nil value and percentages should update the style"); | ||
|
||
test(() => { | ||
const element = document.querySelector("#paragraph"); | ||
element.style.color = ""; | ||
element.style.color = "rgb(0, 100%, 100%)"; | ||
|
||
assert_equals(element.style.color, ""); | ||
}, "Setting a mixed percent and value color should NOT update the style"); | ||
|
||
test(() => { | ||
const element = document.querySelector("#paragraph"); | ||
element.style.color = ""; | ||
element.style.color = "hsl(0, 100%, 50%)"; | ||
|
||
assert_equals(element.style.color, "rgb(255, 0, 0)"); | ||
}, "Setting an hsl color should update the style"); | ||
|
||
</script> |
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