Update WPT tests for css/css-color
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Jun 2020 20:00:14 +0000 (20:00 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Jun 2020 20:00:14 +0000 (20:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=212842

Reviewed by Darin Adler.

* web-platform-tests/css/css-color/animation/color-composition-expected.txt: Added.
* web-platform-tests/css/css-color/animation/color-composition.html: Added.
* web-platform-tests/css/css-color/animation/w3c-import.log:
* web-platform-tests/css/css-color/color-initial-canvastext-expected.txt: Added.
* web-platform-tests/css/css-color/color-initial-canvastext.html: Added.
* web-platform-tests/css/css-color/lab-001.html:
* web-platform-tests/css/css-color/lab-002.html:
* web-platform-tests/css/css-color/lab-003.html:
* web-platform-tests/css/css-color/lab-004.html:
* web-platform-tests/css/css-color/lab-005.html:
* web-platform-tests/css/css-color/lab-006.html:
* web-platform-tests/css/css-color/lab-007.html:
* web-platform-tests/css/css-color/lch-001.html:
* web-platform-tests/css/css-color/lch-002.html:
* web-platform-tests/css/css-color/lch-003.html:
* web-platform-tests/css/css-color/lch-004.html:
* web-platform-tests/css/css-color/lch-005.html:
* web-platform-tests/css/css-color/lch-006.html:
* web-platform-tests/css/css-color/lch-007.html:
* web-platform-tests/css/css-color/parsing/system-color-valid-expected.txt: Added.
* web-platform-tests/css/css-color/parsing/system-color-valid.html: Added.
* web-platform-tests/css/css-color/parsing/w3c-import.log:
* web-platform-tests/css/css-color/w3c-import.log:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262646 268f45cc-cd09-0410-ab3c-d52691b4dbfc

24 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/css-color/animation/color-composition-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-color/animation/color-composition.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-color/animation/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-initial-canvastext-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-initial-canvastext.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lab-001.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lab-002.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lab-003.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lab-004.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lab-005.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lab-006.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lab-007.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lch-001.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lch-002.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lch-003.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lch-004.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lch-005.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lch-006.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lch-007.html
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/system-color-valid-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/system-color-valid.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/css/css-color/w3c-import.log

index 5d217e2..2162d1c 100644 (file)
@@ -1,3 +1,34 @@
+2020-06-05  Sam Weinig  <weinig@apple.com>
+
+        Update WPT tests for css/css-color
+        https://bugs.webkit.org/show_bug.cgi?id=212842
+
+        Reviewed by Darin Adler.
+
+        * web-platform-tests/css/css-color/animation/color-composition-expected.txt: Added.
+        * web-platform-tests/css/css-color/animation/color-composition.html: Added.
+        * web-platform-tests/css/css-color/animation/w3c-import.log:
+        * web-platform-tests/css/css-color/color-initial-canvastext-expected.txt: Added.
+        * web-platform-tests/css/css-color/color-initial-canvastext.html: Added.
+        * web-platform-tests/css/css-color/lab-001.html:
+        * web-platform-tests/css/css-color/lab-002.html:
+        * web-platform-tests/css/css-color/lab-003.html:
+        * web-platform-tests/css/css-color/lab-004.html:
+        * web-platform-tests/css/css-color/lab-005.html:
+        * web-platform-tests/css/css-color/lab-006.html:
+        * web-platform-tests/css/css-color/lab-007.html:
+        * web-platform-tests/css/css-color/lch-001.html:
+        * web-platform-tests/css/css-color/lch-002.html:
+        * web-platform-tests/css/css-color/lch-003.html:
+        * web-platform-tests/css/css-color/lch-004.html:
+        * web-platform-tests/css/css-color/lch-005.html:
+        * web-platform-tests/css/css-color/lch-006.html:
+        * web-platform-tests/css/css-color/lch-007.html:
+        * web-platform-tests/css/css-color/parsing/system-color-valid-expected.txt: Added.
+        * web-platform-tests/css/css-color/parsing/system-color-valid.html: Added.
+        * web-platform-tests/css/css-color/parsing/w3c-import.log:
+        * web-platform-tests/css/css-color/w3c-import.log:
+
 2020-06-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
 
         Update WPT tests for offscreen-canvas (and rename to html/canvas/offscreen)
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-color/animation/color-composition-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-color/animation/color-composition-expected.txt
new file mode 100644 (file)
index 0000000..eecc6a4
--- /dev/null
@@ -0,0 +1,12 @@
+
+FAIL Compositing: property <color> underlying [rgb(50, 50, 50)] from add [rgb(10, 10, 10)] to replace [rgb(30, 30, 30)] at (0) should be [rgb(60, 60, 60)] assert_equals: expected "rgb ( 60 , 60 , 60 ) " but got "rgb ( 10 , 10 , 10 ) "
+FAIL Compositing: property <color> underlying [rgb(50, 50, 50)] from add [rgb(10, 10, 10)] to replace [rgb(30, 30, 30)] at (0.2) should be [rgb(54, 54, 54)] assert_equals: expected "rgb ( 54 , 54 , 54 ) " but got "rgb ( 14 , 14 , 14 ) "
+PASS Compositing: property <color> underlying [rgb(50, 50, 50)] from add [rgb(10, 10, 10)] to replace [rgb(30, 30, 30)] at (1) should be [rgb(30, 30, 30)] 
+FAIL Compositing: property <color> underlying [rgb(50, 50, 50)] from add [rgb(10, 10, 10)] to replace [rgb(30, 30, 30)] at (1.2) should be [rgb(24, 24, 24)] assert_equals: expected "rgb ( 24 , 24 , 24 ) " but got "rgb ( 34 , 34 , 34 ) "
+FAIL Compositing: property <color> underlying [rgb(50, 50, 50)] from add [rgb(10, 10, 10)] to replace [rgb(30, 30, 30)] at (1.5) should be [rgb(15, 15, 15)] assert_equals: expected "rgb ( 15 , 15 , 15 ) " but got "rgb ( 40 , 40 , 40 ) "
+FAIL Compositing: property <color> underlying [rgb(60, 60, 60)] from add [rgb(0, 0, 0)] to replace [rgb(50, 50, 50)] at (0) should be [rgb(60, 60, 60)] assert_equals: expected "rgb ( 60 , 60 , 60 ) " but got "rgb ( 0 , 0 , 0 ) "
+FAIL Compositing: property <color> underlying [rgb(60, 60, 60)] from add [rgb(0, 0, 0)] to replace [rgb(50, 50, 50)] at (0.5) should be [rgb(55, 55, 55)] assert_equals: expected "rgb ( 55 , 55 , 55 ) " but got "rgb ( 25 , 25 , 25 ) "
+PASS Compositing: property <color> underlying [rgb(60, 60, 60)] from add [rgb(0, 0, 0)] to replace [rgb(50, 50, 50)] at (1) should be [rgb(50, 50, 50)] 
+FAIL Compositing: property <color> underlying [rgb(60, 60, 60)] from add [rgb(0, 0, 0)] to replace [rgb(50, 50, 50)] at (1.2) should be [rgb(48, 48, 48)] assert_equals: expected "rgb ( 48 , 48 , 48 ) " but got "rgb ( 60 , 60 , 60 ) "
+FAIL Compositing: property <color> underlying [rgb(60, 60, 60)] from add [rgb(0, 0, 0)] to replace [rgb(50, 50, 50)] at (1.5) should be [rgb(45, 45, 45)] assert_equals: expected "rgb ( 45 , 45 , 45 ) " but got "rgb ( 75 , 75 , 75 ) "
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-color/animation/color-composition.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-color/animation/color-composition.html
new file mode 100644 (file)
index 0000000..c3e4818
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<title>color composition</title>
+<link rel="help" href="https://drafts.csswg.org/css-color/#the-color-property">
+<meta name="assert" content="color supports animation by computed value type">
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/interpolation-testcommon.js"></script>
+
+<style>
+.target {
+  width: 40px;
+  height: 40px;
+  background-color: black;
+}
+.expected {
+  background-color: green;
+}
+</style>
+
+<body>
+<script>
+test_composition({
+  property: 'color',
+  underlying: 'rgb(50, 50, 50)',
+  addFrom: 'rgb(10, 10, 10)',
+  replaceTo: 'rgb(30, 30, 30)',
+}, [
+  {at: 0, expect: 'rgb(60, 60, 60)'},
+  {at: 0.2, expect: 'rgb(54, 54, 54)'},
+  {at: 1, expect: 'rgb(30, 30, 30)'},
+  {at: 1.2, expect: 'rgb(24, 24, 24)'},
+  {at: 1.5, expect: 'rgb(15, 15, 15)'},
+]);
+
+test_composition({
+  property: 'color',
+  underlying: 'rgb(60, 60, 60)',
+  addFrom: 'rgb(0, 0, 0)',
+  replaceTo: 'rgb(50, 50, 50)',
+}, [
+  {at: 0, expect: 'rgb(60, 60, 60)'},
+  {at: 0.5, expect: 'rgb(55, 55, 55)'},
+  {at: 1, expect: 'rgb(50, 50, 50)'},
+  {at: 1.2, expect: 'rgb(48, 48, 48)'},
+  {at: 1.5, expect: 'rgb(45, 45, 45)'},
+]);
+</script>
+</body>
index 200a289..7d6ae49 100644 (file)
@@ -14,5 +14,6 @@ Property values requiring vendor prefixes:
 None
 ------------------------------------------------------------------------
 List of files:
+/LayoutTests/imported/w3c/web-platform-tests/css/css-color/animation/color-composition.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-color/animation/color-interpolation.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-color/animation/opacity-interpolation.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-initial-canvastext-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-initial-canvastext-expected.txt
new file mode 100644 (file)
index 0000000..fa5f5a5
--- /dev/null
@@ -0,0 +1,4 @@
+
+PASS Check that the resolved value for the initial color on the root element matches canvastext. 
+PASS Check that the resolved value of an explicit color:initial matches canvastext. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-initial-canvastext.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-initial-canvastext.html
new file mode 100644 (file)
index 0000000..97ea2b7
--- /dev/null
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>CSS Color 4: Initial value of the color property</title>
+<link rel="help" href="https://drafts.csswg.org/css-color/#the-color-property">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+  #ref { color: canvastext }
+  #initial { color: initial }
+</style>
+<div id="ref"></div>
+<div id="initial"></div>
+<script>
+  const canvastext = getComputedStyle(ref).color;
+
+  test(() => {
+    assert_equals(getComputedStyle(document.documentElement).color, canvastext);
+  }, "Check that the resolved value for the initial color on the root element matches canvastext.");
+
+  test(() => {
+    assert_equals(getComputedStyle(initial).color, canvastext);
+  }, "Check that the resolved value of an explicit color:initial matches canvastext.");
+</script>
index 70dbd91..f507f86 100644 (file)
@@ -6,7 +6,7 @@
 <link rel="match" href="greentext-ref.html">
 <meta name="assert" content="lab() with no alpha">
 <style>
-    .test {color: lab(46.277 -47.562 48.583)} /* green (sRGB #008000) converted to Lab */
+    .test {color: lab(46.277% -47.562 48.583)} /* green (sRGB #008000) converted to Lab */
 </style>
 <body>
     <p class="test">Test passes if this text is green</p>
index 1f1b447..bcf04e3 100644 (file)
@@ -7,7 +7,7 @@
 <meta name="assert" content="lab() with no alpha">
 <style>
     .test { color: red; }
-    .test { color: lab(0 0 0)} /* black (sRGB #000000) converted to Lab */
+    .test { color: lab(0% 0 0)} /* black (sRGB #000000) converted to Lab */
 </style>
 <body>
     <p class="test">Test passes if this text is black</p>
index 072dafa..ddf2d17 100644 (file)
@@ -7,7 +7,7 @@
 <meta name="assert" content="lab() with no alpha">
 <style>
     .test { color: red; background-color: #333; padding: 3px;}
-    .test { color: lab(100 0 0);} /* white (sRGB #FFFFFF) converted to Lab */
+    .test { color: lab(100% 0 0);} /* white (sRGB #FFFFFF) converted to Lab */
 </style>
 <body>
     <p class="test">Test passes if this text is white</p>
index 2cd327f..056835a 100644 (file)
@@ -7,7 +7,7 @@
 <meta name="assert" content="lab() with no alpha, positive a axis">
 <style>
     .test { color: red; }
-    .test { color: lab(50 50 0)}
+    .test { color: lab(50% 50 0)}
     .match { color: rgb(75.62%, 30.45%, 47.56%)} /* lab(50 50 0) converted to sRGB */
 </style>
 <body>
index 846430f..8149771 100644 (file)
@@ -7,7 +7,7 @@
 <meta name="assert" content="lab() with no alpha, negative a axis">
 <style>
     .test { color: red; }
-    .test { color: lab(70 -45 0)}
+    .test { color: lab(70% -45 0)}
     .match { color: rgb(10.79%, 75.55%, 66.40%)} /* lab(70 -45 0) converted to sRGB */
 </style>
 <body>
index 926c1f0..0f175ab 100644 (file)
@@ -7,7 +7,7 @@
 <meta name="assert" content="lab() with no alpha, positive b axis">
 <style>
     .test { color: red; }
-    .test { color: lab(70 0 70)}
+    .test { color: lab(70% 0 70)}
     .match { color: rgb(76.62%, 66.36%, 5.58%)} /* lab(70 0 70) converted to sRGB */
 </style>
 <body>
index 917bc1a..a99cebd 100644 (file)
@@ -7,7 +7,7 @@
 <meta name="assert" content="lab() with no alpha, negative b axis">
 <style>
     .test { color: red; }
-    .test { color: lab(55 0 -60)}
+    .test { color: lab(55% 0 -60)}
     .match { color: rgb(12.81%, 53.10%, 92.76%)} /* lab(55 0 -60) converted to sRGB */
 </style>
 <body>
index 3b0b5af..6bc0c5f 100644 (file)
@@ -6,7 +6,7 @@
 <link rel="match" href="greentext-ref.html">
 <meta name="assert" content="lch() with no alpha">
 <style>
-    .test {color: lch(46.277 67.945 134.427)} /* green (sRGB #008000) converted to LCH */
+    .test {color: lch(46.277% 67.945 134.427)} /* green (sRGB #008000) converted to LCH */
 </style>
 <body>
     <p class="test">Test passes if this text is green</p>
index d87d042..52a5462 100644 (file)
@@ -7,7 +7,7 @@
 <meta name="assert" content="lch() with no alpha">
 <style>
     .test { color: red; }
-    .test { color: lch(0 0 0)} /* black (sRGB #000000) converted to LCH */
+    .test { color: lch(0% 0 0)} /* black (sRGB #000000) converted to LCH */
 </style>
 <body>
     <p class="test">Test passes if this text is black</p>
index eb8f8a2..7539e9d 100644 (file)
@@ -7,7 +7,7 @@
 <meta name="assert" content="lch() with no alpha">
 <style>
     .test { color: red; background-color: #333; padding: 3px;}
-    .test { color: lch(100 0 0);} /* white (sRGB #FFFFFF) converted to LCH */
+    .test { color: lch(100% 0 0);} /* white (sRGB #FFFFFF) converted to LCH */
 </style>
 <body>
     <p class="test">Test passes if this text is white</p>
index 0db243c..67d71a8 100644 (file)
@@ -7,7 +7,7 @@
 <meta name="assert" content="lch() with no alpha, positive a axis">
 <style>
     .test { color: red; }
-    .test { color: lch(50 50 0)}
+    .test { color: lch(50% 50 0)}
     .match { color: rgb(75.62%, 30.45%, 47.56%)} /* lch(50 50 0) converted to sRGB (happens to be the same as lab(50 50 0)*/
 </style>
 <body>
index c16d02b..571f7aa 100644 (file)
@@ -7,7 +7,7 @@
 <meta name="assert" content="lch() with no alpha, negative a axis">
 <style>
     .test { color: red; }
-    .test { color: lch(70 45 -180)}
+    .test { color: lch(70% 45 -180)}
     .match { color: rgb(10.79%, 75.55%, 66.40%)} /* lch(70 45 180) converted to sRGB */
 </style>
 <body>
index c3bbd14..ea49093 100644 (file)
@@ -7,7 +7,7 @@
 <meta name="assert" content="lch() with no alpha, positive b axis">
 <style>
     .test { color: red; }
-    .test { color: lch(70 70 90)}
+    .test { color: lch(70% 70 90)}
     .match { color: rgb(76.62%, 66.36%, 5.58%)} /* lch(70 70 90) converted to sRGB */
 </style>
 <body>
index 4646bc9..6d9a974 100644 (file)
@@ -7,7 +7,7 @@
 <meta name="assert" content="lab() with no alpha, negative b axis">
 <style>
     .test { color: red; }
-    .test { color: lch(56 58 275)}
+    .test { color: lch(56% 58 275)}
     .match { color: rgb(12.81%, 53.10%, 92.76%)} /* lch(56 58 275) converted to sRGB */
 </style>
 <body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/system-color-valid-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/system-color-valid-expected.txt
new file mode 100644 (file)
index 0000000..c34a2c1
--- /dev/null
@@ -0,0 +1,14 @@
+
+FAIL e.style['color'] = "ActiveText" should set the property value assert_not_equals: property should be set got disallowed value ""
+PASS e.style['color'] = "ButtonFace" should set the property value 
+PASS e.style['color'] = "ButtonText" should set the property value 
+FAIL e.style['color'] = "Canvas" should set the property value assert_not_equals: property should be set got disallowed value ""
+FAIL e.style['color'] = "CanvasText" should set the property value assert_not_equals: property should be set got disallowed value ""
+FAIL e.style['color'] = "Field" should set the property value assert_not_equals: property should be set got disallowed value ""
+FAIL e.style['color'] = "FieldText" should set the property value assert_not_equals: property should be set got disallowed value ""
+PASS e.style['color'] = "GrayText" should set the property value 
+PASS e.style['color'] = "Highlight" should set the property value 
+PASS e.style['color'] = "HighlightText" should set the property value 
+FAIL e.style['color'] = "LinkText" should set the property value assert_not_equals: property should be set got disallowed value ""
+FAIL e.style['color'] = "VisitedText" should set the property value assert_not_equals: property should be set got disallowed value ""
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/system-color-valid.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/system-color-valid.html
new file mode 100644 (file)
index 0000000..9d93bd4
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Color Module Level 4: parsing system color keywords</title>
+<link rel="help" href="https://drafts.csswg.org/css-color-4/#css-system-colors">
+<meta name="assert" content="system color keyword support">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+</head>
+<body>
+<script>
+test_valid_value("color", "ActiveText", "activetext");
+test_valid_value("color", "ButtonFace", "buttonface");
+test_valid_value("color", "ButtonText", "buttontext");
+test_valid_value("color", "Canvas", "canvas");
+test_valid_value("color", "CanvasText", "canvastext");
+test_valid_value("color", "Field", "field");
+test_valid_value("color", "FieldText", "fieldtext");
+test_valid_value("color", "GrayText", "graytext");
+test_valid_value("color", "Highlight", "highlight");
+test_valid_value("color", "HighlightText", "highlighttext");
+test_valid_value("color", "LinkText", "linktext");
+test_valid_value("color", "VisitedText", "visitedtext");
+</script>
+</body>
+</html>
index 56a61ad..b6a4569 100644 (file)
@@ -20,3 +20,4 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/opacity-computed.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/opacity-invalid.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/opacity-valid.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/system-color-valid.html
index b432fe3..5730549 100644 (file)
@@ -31,6 +31,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-003-expected.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-003.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-function-parsing.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-initial-canvastext.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-resolving-hsl.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-resolving-keywords.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-resolving.html