Commit 127ee4d5 authored by Alison Maher's avatar Alison Maher Committed by Commit Bot

Ship ActiveText, Field, and FieldText system color keywords

Set the NewSystemColors flag to stable and update test expectations.

Spec: https://drafts.csswg.org/css-color-4/#css-system-colors

Intent-to-ship:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/zv6k2X7Wr1M

Bug: 1015968
Change-Id: I754cf7daefe4a61cc76c4b074aa0641c56c92904
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1931268Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Alison Maher <almaher@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#720558}
parent 3868029c
...@@ -114,11 +114,11 @@ IN_PROC_BROWSER_TEST_F(WebThemeEngineImplDefaultBrowserTest, GetSystemColor) { ...@@ -114,11 +114,11 @@ IN_PROC_BROWSER_TEST_F(WebThemeEngineImplDefaultBrowserTest, GetSystemColor) {
std::vector<std::string> expected_colors; std::vector<std::string> expected_colors;
if (base::win::GetVersion() <= base::win::Version::WIN8_1) { if (base::win::GetVersion() <= base::win::Version::WIN8_1) {
expected_colors = { expected_colors = {
"rgb(255, 255, 255)", "rgb(204, 204, 204)", "rgb(0, 0, 0)", "rgb(255, 255, 255)", "rgb(204, 204, 204)", "rgb(0, 102, 204)",
"rgb(255, 255, 255)", "rgb(99, 99, 206)", "rgb(240, 240, 240)", "rgb(255, 255, 255)", "rgb(99, 99, 206)", "rgb(240, 240, 240)",
"rgb(221, 221, 221)", "rgb(136, 136, 136)", "rgb(0, 0, 0)", "rgb(221, 221, 221)", "rgb(136, 136, 136)", "rgb(0, 0, 0)",
"rgb(255, 255, 255)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(255, 255, 255)", "rgb(0, 0, 0)", "rgb(0, 0, 0)",
"rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(109, 109, 109)", "rgb(255, 255, 255)", "rgb(0, 0, 0)", "rgb(109, 109, 109)",
"rgb(51, 153, 255)", "rgb(255, 255, 255)", "rgb(255, 255, 255)", "rgb(51, 153, 255)", "rgb(255, 255, 255)", "rgb(255, 255, 255)",
"rgb(255, 255, 255)", "rgb(127, 127, 127)", "rgb(251, 252, 197)", "rgb(255, 255, 255)", "rgb(127, 127, 127)", "rgb(251, 252, 197)",
"rgb(0, 0, 0)", "rgb(0, 102, 204)", "rgb(247, 247, 247)", "rgb(0, 0, 0)", "rgb(0, 102, 204)", "rgb(247, 247, 247)",
...@@ -128,11 +128,11 @@ IN_PROC_BROWSER_TEST_F(WebThemeEngineImplDefaultBrowserTest, GetSystemColor) { ...@@ -128,11 +128,11 @@ IN_PROC_BROWSER_TEST_F(WebThemeEngineImplDefaultBrowserTest, GetSystemColor) {
"rgb(204, 204, 204)", "rgb(0, 0, 0)"}; "rgb(204, 204, 204)", "rgb(0, 0, 0)"};
} else { } else {
expected_colors = { expected_colors = {
"rgb(255, 255, 255)", "rgb(204, 204, 204)", "rgb(0, 0, 0)", "rgb(255, 255, 255)", "rgb(204, 204, 204)", "rgb(0, 102, 204)",
"rgb(255, 255, 255)", "rgb(99, 99, 206)", "rgb(240, 240, 240)", "rgb(255, 255, 255)", "rgb(99, 99, 206)", "rgb(240, 240, 240)",
"rgb(221, 221, 221)", "rgb(136, 136, 136)", "rgb(0, 0, 0)", "rgb(221, 221, 221)", "rgb(136, 136, 136)", "rgb(0, 0, 0)",
"rgb(255, 255, 255)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(255, 255, 255)", "rgb(0, 0, 0)", "rgb(0, 0, 0)",
"rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(109, 109, 109)", "rgb(255, 255, 255)", "rgb(0, 0, 0)", "rgb(109, 109, 109)",
"rgb(0, 120, 215)", "rgb(255, 255, 255)", "rgb(255, 255, 255)", "rgb(0, 120, 215)", "rgb(255, 255, 255)", "rgb(255, 255, 255)",
"rgb(255, 255, 255)", "rgb(127, 127, 127)", "rgb(251, 252, 197)", "rgb(255, 255, 255)", "rgb(127, 127, 127)", "rgb(251, 252, 197)",
"rgb(0, 0, 0)", "rgb(0, 102, 204)", "rgb(247, 247, 247)", "rgb(0, 0, 0)", "rgb(0, 102, 204)", "rgb(247, 247, 247)",
......
...@@ -1098,6 +1098,7 @@ ...@@ -1098,6 +1098,7 @@
}, },
{ {
name: "NewSystemColors", name: "NewSystemColors",
status: "stable",
}, },
{ {
name: "NoIdleEncodingForWebTests", name: "NoIdleEncodingForWebTests",
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<body> <body>
<div class="box"><div class="text">ActiveBorder</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div> <div class="box"><div class="text">ActiveBorder</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div>
<div class="box"><div class="text">ActiveCaption</div><div class="inner" style="background-color: rgb(204, 204, 204)">&nbsp;</div></div> <div class="box"><div class="text">ActiveCaption</div><div class="inner" style="background-color: rgb(204, 204, 204)">&nbsp;</div></div>
<div class="box"><div class="text">ActiveText</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div> <div class="box"><div class="text">ActiveText</div><div class="inner" style="background-color: rgb(255, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">AppWorkspace</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div> <div class="box"><div class="text">AppWorkspace</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div>
<div class="box"><div class="text">Background</div><div class="inner" style="background-color: rgb(99, 99, 206)">&nbsp;</div></div> <div class="box"><div class="text">Background</div><div class="inner" style="background-color: rgb(99, 99, 206)">&nbsp;</div></div>
<div class="box"><div class="text">ButtonFace</div><div class="inner" style="background-color: rgb(221, 221, 221)">&nbsp;</div></div> <div class="box"><div class="text">ButtonFace</div><div class="inner" style="background-color: rgb(221, 221, 221)">&nbsp;</div></div>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<div class="box"><div class="text">CanvasText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div> <div class="box"><div class="text">CanvasText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">CaptionText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div> <div class="box"><div class="text">CaptionText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">Field</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div> <div class="box"><div class="text">Field</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div>
<div class="box"><div class="text">FieldText</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div> <div class="box"><div class="text">FieldText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">GrayText</div><div class="inner" style="background-color: rgb(128, 128, 128)">&nbsp;</div></div> <div class="box"><div class="text">GrayText</div><div class="inner" style="background-color: rgb(128, 128, 128)">&nbsp;</div></div>
<div class="box"><div class="text">Highlight</div><div class="inner" style="background-color: rgb(181, 213, 255)">&nbsp;</div></div> <div class="box"><div class="text">Highlight</div><div class="inner" style="background-color: rgb(181, 213, 255)">&nbsp;</div></div>
<div class="box"><div class="text">HighlightText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div> <div class="box"><div class="text">HighlightText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
......
...@@ -6,8 +6,8 @@ PASS Setting color to ActiveBorder was successfully set. ...@@ -6,8 +6,8 @@ PASS Setting color to ActiveBorder was successfully set.
PASS Setting color to activeborder was successfully set. PASS Setting color to activeborder was successfully set.
PASS Setting color to ActiveCaption was successfully set. PASS Setting color to ActiveCaption was successfully set.
PASS Setting color to activecaption was successfully set. PASS Setting color to activecaption was successfully set.
FAIL Setting color to ActiveText was not set but should! PASS Setting color to ActiveText was successfully set.
FAIL Setting color to activetext was not set but should! PASS Setting color to activetext was successfully set.
PASS Setting color to AppWorkspace was successfully set. PASS Setting color to AppWorkspace was successfully set.
PASS Setting color to appworkspace was successfully set. PASS Setting color to appworkspace was successfully set.
PASS Setting color to Background was successfully set. PASS Setting color to Background was successfully set.
...@@ -26,10 +26,10 @@ PASS Setting color to CanvasText was successfully set. ...@@ -26,10 +26,10 @@ PASS Setting color to CanvasText was successfully set.
PASS Setting color to canvastext was successfully set. PASS Setting color to canvastext was successfully set.
PASS Setting color to CaptionText was successfully set. PASS Setting color to CaptionText was successfully set.
PASS Setting color to captiontext was successfully set. PASS Setting color to captiontext was successfully set.
FAIL Setting color to Field was not set but should! PASS Setting color to Field was successfully set.
FAIL Setting color to field was not set but should! PASS Setting color to field was successfully set.
FAIL Setting color to FieldText was not set but should! PASS Setting color to FieldText was successfully set.
FAIL Setting color to fieldtext was not set but should! PASS Setting color to fieldtext was successfully set.
PASS Setting color to GrayText was successfully set. PASS Setting color to GrayText was successfully set.
PASS Setting color to graytext was successfully set. PASS Setting color to graytext was successfully set.
PASS Setting color to Highlight was successfully set. PASS Setting color to Highlight was successfully set.
......
...@@ -18,10 +18,10 @@ var canvas = document.getElementById("canvas"); ...@@ -18,10 +18,10 @@ var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d"); var ctx = canvas.getContext("2d");
function shouldSuccessfullyParse(color) { function shouldSuccessfullyParse(color) {
ctx.fillStyle = "#f00"; ctx.fillStyle = "#008800";
ctx.fillStyle = color; ctx.fillStyle = color;
// Check that there is no red. // Check that there is no green.
if (ctx.fillStyle.match(/^#(?!(FF0000|ff0000|f00)$)/)) if (ctx.fillStyle.match(/^#(?!(008800|080)$)/))
testPassed("Setting color to " + color + " was successfully set."); testPassed("Setting color to " + color + " was successfully set.");
else else
testFailed("Setting color to " + color + " was not set but should!"); testFailed("Setting color to " + color + " was not set but should!");
......
<!DOCTYPE html>
<html>
<head>
<title>Color Test</title>
<style>
html {
font-size: 12px;
width: 750px;
}
.box:after {
content: " ";
clear: both;
display: block;
}
.inner {
border-top: solid 1px;
float: right;
width: 620px;
}
.text {
float: left;
}
</style>
</head>
<body>
<div class="box"><div class="text">ActiveBorder</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div>
<div class="box"><div class="text">ActiveCaption</div><div class="inner" style="background-color: rgb(204, 204, 204)">&nbsp;</div></div>
<div class="box"><div class="text">ActiveText</div><div class="inner" style="background-color: rgb(255, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">AppWorkspace</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div>
<div class="box"><div class="text">Background</div><div class="inner" style="background-color: rgb(99, 99, 206)">&nbsp;</div></div>
<div class="box"><div class="text">ButtonFace</div><div class="inner" style="background-color: rgb(221, 221, 221)">&nbsp;</div></div>
<div class="box"><div class="text">ButtonHighlight</div><div class="inner" style="background-color: rgb(221, 221, 221)">&nbsp;</div></div>
<div class="box"><div class="text">ButtonShadow</div><div class="inner" style="background-color: rgb(136, 136, 136)">&nbsp;</div></div>
<div class="box"><div class="text">ButtonText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">Canvas</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div>
<div class="box"><div class="text">CanvasText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">CaptionText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">Field</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div>
<div class="box"><div class="text">FieldText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">GrayText</div><div class="inner" style="background-color: rgb(128, 128, 128)">&nbsp;</div></div>
<div class="box"><div class="text">Highlight</div><div class="inner" style="background-color: rgb(181, 213, 255)">&nbsp;</div></div>
<div class="box"><div class="text">HighlightText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">InactiveBorder</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div>
<div class="box"><div class="text">InactiveCaption</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div>
<div class="box"><div class="text">InactiveCaptionText</div><div class="inner" style="background-color: rgb(127, 127, 127)">&nbsp;</div></div>
<div class="box"><div class="text">InfoBackground</div><div class="inner" style="background-color: rgb(251, 252, 197)">&nbsp;</div></div>
<div class="box"><div class="text">InfoText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">LinkText</div><div class="inner" style="background-color: rgb(0, 0, 238)">&nbsp;</div></div>
<div class="box"><div class="text">Menu</div><div class="inner" style="background-color: rgb(247, 247, 247)">&nbsp;</div></div>
<div class="box"><div class="text">MenuText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">Scrollbar</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div>
<div class="box"><div class="text">ThreeDDarkShadow</div><div class="inner" style="background-color: rgb(102, 102, 102)">&nbsp;</div></div>
<div class="box"><div class="text">ThreeDFace</div><div class="inner" style="background-color: rgb(192, 192, 192)">&nbsp;</div></div>
<div class="box"><div class="text">ThreeDHighlight</div><div class="inner" style="background-color: rgb(221, 221, 221)">&nbsp;</div></div>
<div class="box"><div class="text">ThreeDLightShadow</div><div class="inner" style="background-color: rgb(192, 192, 192)">&nbsp;</div></div>
<div class="box"><div class="text">ThreeDShadow</div><div class="inner" style="background-color: rgb(136, 136, 136)">&nbsp;</div></div>
<div class="box"><div class="text">VisitedText</div><div class="inner" style="background-color: rgb(85, 26, 139)">&nbsp;</div></div>
<div class="box"><div class="text">Window</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div>
<div class="box"><div class="text">WindowFrame</div><div class="inner" style="background-color: rgb(204, 204, 204)">&nbsp;</div></div>
<div class="box"><div class="text">WindowText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
</body>
</html>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<body> <body>
<div class="box"><div class="text">ActiveBorder</div><div class="inner" style="background-color: rgb(59, 153, 252)">&nbsp;</div></div> <div class="box"><div class="text">ActiveBorder</div><div class="inner" style="background-color: rgb(59, 153, 252)">&nbsp;</div></div>
<div class="box"><div class="text">ActiveCaption</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div> <div class="box"><div class="text">ActiveCaption</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">ActiveText</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div> <div class="box"><div class="text">ActiveText</div><div class="inner" style="background-color: rgb(255, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">AppWorkspace</div><div class="inner" style="background-color: rgb(170, 170, 170)">&nbsp;</div></div> <div class="box"><div class="text">AppWorkspace</div><div class="inner" style="background-color: rgb(170, 170, 170)">&nbsp;</div></div>
<div class="box"><div class="text">Background</div><div class="inner" style="background-color: rgb(99, 99, 206)">&nbsp;</div></div> <div class="box"><div class="text">Background</div><div class="inner" style="background-color: rgb(99, 99, 206)">&nbsp;</div></div>
<div class="box"><div class="text">ButtonFace</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div> <div class="box"><div class="text">ButtonFace</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<div class="box"><div class="text">CanvasText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div> <div class="box"><div class="text">CanvasText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">CaptionText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div> <div class="box"><div class="text">CaptionText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">Field</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div> <div class="box"><div class="text">Field</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div>
<div class="box"><div class="text">FieldText</div><div class="inner" style="background-color: rgb(255, 255, 255)">&nbsp;</div></div> <div class="box"><div class="text">FieldText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
<div class="box"><div class="text">GrayText</div><div class="inner" style="background-color: rgb(127, 127, 127)">&nbsp;</div></div> <div class="box"><div class="text">GrayText</div><div class="inner" style="background-color: rgb(127, 127, 127)">&nbsp;</div></div>
<div class="box"><div class="text">Highlight</div><div class="inner" style="background-color: rgb(181, 213, 255)">&nbsp;</div></div> <div class="box"><div class="text">Highlight</div><div class="inner" style="background-color: rgb(181, 213, 255)">&nbsp;</div></div>
<div class="box"><div class="text">HighlightText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div> <div class="box"><div class="text">HighlightText</div><div class="inner" style="background-color: rgb(0, 0, 0)">&nbsp;</div></div>
......
...@@ -12,7 +12,7 @@ PASS computedStyleText.fill is computedStyleDiv.color ...@@ -12,7 +12,7 @@ PASS computedStyleText.fill is computedStyleDiv.color
PASS computedStyleText.stroke is computedStyleDiv.color PASS computedStyleText.stroke is computedStyleDiv.color
Testing system colorActiveText Testing system colorActiveText
PASS computedStyleText.fill is computedStyleDiv.color PASS computedStyleText.fill is computedStyleDiv.color
FAIL computedStyleText.stroke should be rgb(0, 0, 0). Was rgb(255, 0, 0). PASS computedStyleText.stroke is computedStyleDiv.color
Testing system colorAppWorkspace Testing system colorAppWorkspace
PASS computedStyleText.fill is computedStyleDiv.color PASS computedStyleText.fill is computedStyleDiv.color
PASS computedStyleText.stroke is computedStyleDiv.color PASS computedStyleText.stroke is computedStyleDiv.color
...@@ -42,7 +42,7 @@ PASS computedStyleText.fill is computedStyleDiv.color ...@@ -42,7 +42,7 @@ PASS computedStyleText.fill is computedStyleDiv.color
PASS computedStyleText.stroke is computedStyleDiv.color PASS computedStyleText.stroke is computedStyleDiv.color
Testing system colorField Testing system colorField
PASS computedStyleText.fill is computedStyleDiv.color PASS computedStyleText.fill is computedStyleDiv.color
FAIL computedStyleText.stroke should be rgb(0, 0, 0). Was rgb(255, 255, 255). PASS computedStyleText.stroke is computedStyleDiv.color
Testing system colorFieldText Testing system colorFieldText
PASS computedStyleText.fill is computedStyleDiv.color PASS computedStyleText.fill is computedStyleDiv.color
PASS computedStyleText.stroke is computedStyleDiv.color PASS computedStyleText.stroke is computedStyleDiv.color
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment