-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update inverted-colors UA styles to match spec
https://bugs.webkit.org/show_bug.cgi?id=259416 Reviewed by Tim Nguyen. Updated the style for the inverted-colors media query in html.css the new styles are taken directly from the spec. Spec: https://drafts.csswg.org/mediaqueries-5/#inverted * LayoutTests/fast/media/mq-inverted-colors-ua-styles-expected.txt: Added. * LayoutTests/fast/media/mq-inverted-colors-ua-styles-img-expected.html: Added. * LayoutTests/fast/media/mq-inverted-colors-ua-styles-img.html: Added. * LayoutTests/fast/media/mq-inverted-colors-ua-styles.html: Added. * Source/WebCore/css/html.css: (@media (inverted-colors) img:not(picture>img), picture, video): (@media (inverted-colors) img, picture, video): Deleted. Canonical link: https://commits.webkit.org/266234@main
- Loading branch information
1 parent
e31512b
commit 87011db
Showing
5 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
LayoutTests/fast/media/mq-inverted-colors-ua-styles-expected.txt
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,13 @@ | ||
inverted-colors ua style test | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS getComputedStyle(document.querySelector('img')).filter is 'invert(1)' | ||
PASS getComputedStyle(document.querySelector('picture')).filter is 'invert(1)' | ||
PASS getComputedStyle(document.querySelector('picture>img')).filter is 'none' | ||
PASS getComputedStyle(document.querySelector('video')).filter is 'invert(1)' | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
13 changes: 13 additions & 0 deletions
13
LayoutTests/fast/media/mq-inverted-colors-ua-styles-img-expected.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,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
|
||
<img src="resources/apple_logo_big.jpg"> | ||
|
||
<script> | ||
if (window.internals) { | ||
window.internals.settings.forcedColorsAreInvertedAccessibilityValue = "on"; | ||
} | ||
</script> | ||
</body> | ||
</html> |
14 changes: 14 additions & 0 deletions
14
LayoutTests/fast/media/mq-inverted-colors-ua-styles-img.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,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
|
||
<picture> | ||
<img src="resources/apple_logo_big.jpg"> | ||
</picture> | ||
<script> | ||
if (window.internals) { | ||
window.internals.settings.forcedColorsAreInvertedAccessibilityValue = "on"; | ||
} | ||
</script> | ||
</body> | ||
</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,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<script src="../../resources/js-test.js"></script> | ||
|
||
<img> | ||
<picture> | ||
<img> | ||
</picture> | ||
<video></video> | ||
|
||
<script> | ||
if (window.testRunner && window.internals) { | ||
window.testRunner.dumpAsText(); | ||
window.internals.settings.forcedColorsAreInvertedAccessibilityValue = "on"; | ||
description("inverted-colors ua style test"); | ||
shouldEvaluateTo("getComputedStyle(document.querySelector('img')).filter", "'invert(1)'"); | ||
shouldEvaluateTo("getComputedStyle(document.querySelector('picture')).filter", "'invert(1)'"); | ||
shouldEvaluateTo("getComputedStyle(document.querySelector('picture>img')).filter", "'none'"); | ||
shouldEvaluateTo("getComputedStyle(document.querySelector('video')).filter", "'invert(1)'"); | ||
} | ||
</script> | ||
</body> | ||
</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