Title: [271395] trunk/LayoutTests
Revision
271395
Author
[email protected]
Date
2021-01-12 02:42:26 -0800 (Tue, 12 Jan 2021)

Log Message

[selectors] Update tests from WPT
https://bugs.webkit.org/show_bug.cgi?id=220312

Reviewed by Sergio Villar Senin.

LayoutTests/imported/w3c:

[selectors] Update :focus-visible tests from WPT

* web-platform-tests/css/selectors/focus-in-focus-event-001-expected.txt:
* web-platform-tests/css/selectors/focus-in-focus-event-001.html:
* web-platform-tests/css/selectors/focus-in-focusin-event-001-expected.txt: Added.
* web-platform-tests/css/selectors/focus-in-focusin-event-001.html: Added.
* web-platform-tests/css/selectors/focus-visible-001-expected.txt:
* web-platform-tests/css/selectors/focus-visible-001.html:
* web-platform-tests/css/selectors/focus-visible-002-expected.txt:
* web-platform-tests/css/selectors/focus-visible-002.html:
* web-platform-tests/css/selectors/focus-visible-003-expected.txt:
* web-platform-tests/css/selectors/focus-visible-003.html:
* web-platform-tests/css/selectors/focus-visible-004-expected.txt:
* web-platform-tests/css/selectors/focus-visible-004.html:
* web-platform-tests/css/selectors/focus-visible-005-expected.txt:
* web-platform-tests/css/selectors/focus-visible-005.html:
* web-platform-tests/css/selectors/focus-visible-006-expected.txt: Added.
* web-platform-tests/css/selectors/focus-visible-006.html: Added.
* web-platform-tests/css/selectors/focus-visible-007.html:
* web-platform-tests/css/selectors/focus-visible-008-expected.txt: Added.
* web-platform-tests/css/selectors/focus-visible-008.html: Added.
* web-platform-tests/css/selectors/focus-visible-009-expected.txt:
* web-platform-tests/css/selectors/focus-visible-009.html:
* web-platform-tests/css/selectors/focus-visible-010-expected.txt:
* web-platform-tests/css/selectors/focus-visible-010.html:
* web-platform-tests/css/selectors/focus-visible-011.html:
* web-platform-tests/css/selectors/focus-visible-012-expected.txt:
* web-platform-tests/css/selectors/focus-visible-012.html:
* web-platform-tests/css/selectors/focus-visible-014-expected.txt: Added.
* web-platform-tests/css/selectors/focus-visible-014.html: Added.
* web-platform-tests/css/selectors/focus-visible-015-expected.txt: Added.
* web-platform-tests/css/selectors/focus-visible-015.html: Added.
* web-platform-tests/css/selectors/focus-visible-016-expected.txt: Added.
* web-platform-tests/css/selectors/focus-visible-016.html: Added.
* web-platform-tests/css/selectors/parsing/parse-focus-visible-expected.txt: Added.
* web-platform-tests/css/selectors/parsing/parse-focus-visible.html: Added.
* web-platform-tests/css/selectors/parsing/parse-not-expected.txt:
Reported failure at webkit.org/b/220532.
* web-platform-tests/css/selectors/parsing/parse-not.html:
* web-platform-tests/css/selectors/parsing/w3c-import.log:
* web-platform-tests/css/selectors/w3c-import.log:

LayoutTests:

* TestExpectations: Unskip :focus-visible tests, except focus-visible-{002,003,004}.html
because they timeout on Apple platforms, and focus-visible-007.html because
it has some problems (see https://crbug.com/976438).
* platform/glib/TestExpectations: Mark focus-visible-{002,003,004}.html as passing.
* platform/glib/imported/w3c/web-platform-tests/css/selectors/focus-visible-009-expected.txt: Removed.

Modified Paths

Added Paths

Removed Paths

  • trunk/LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/selectors/

Diff

Modified: trunk/LayoutTests/ChangeLog (271394 => 271395)


--- trunk/LayoutTests/ChangeLog	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/ChangeLog	2021-01-12 10:42:26 UTC (rev 271395)
@@ -1,3 +1,16 @@
+2021-01-12  Manuel Rego Casasnovas  <[email protected]>
+
+        [selectors] Update tests from WPT
+        https://bugs.webkit.org/show_bug.cgi?id=220312
+
+        Reviewed by Sergio Villar Senin.
+
+        * TestExpectations: Unskip :focus-visible tests, except focus-visible-{002,003,004}.html
+        because they timeout on Apple platforms, and focus-visible-007.html because
+        it has some problems (see https://crbug.com/976438).
+        * platform/glib/TestExpectations: Mark focus-visible-{002,003,004}.html as passing.
+        * platform/glib/imported/w3c/web-platform-tests/css/selectors/focus-visible-009-expected.txt: Removed.
+
 2021-01-12  Rob Buis  <[email protected]>
 
         Null check CSSFilter::output()

Modified: trunk/LayoutTests/TestExpectations (271394 => 271395)


--- trunk/LayoutTests/TestExpectations	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/TestExpectations	2021-01-12 10:42:26 UTC (rev 271395)
@@ -1231,12 +1231,10 @@
 imported/w3c/web-platform-tests/css/selectors/old-tests/css3-modsel-172b.xml [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/selectors/old-tests/css3-modsel-173a.xml [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/selectors/old-tests/css3-modsel-173b.xml [ ImageOnlyFailure ]
-webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-001.html [ Skip ]
 webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-002.html [ Skip ]
-webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-007.html [ Skip ]
-webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-009.html [ Skip ]
-webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-010.html [ Skip ]
-webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-012.html [ Skip ]
+webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-003.html [ Skip ]
+webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-004.html [ Skip ]
+webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-007.html [ Skip ] # Test issues, see https://crbug.com/976438.
 webkit.org/b/217904 imported/w3c/web-platform-tests/css/selectors/is-where-visited.html [ ImageOnlyFailure ]
 webkit.org/b/64861 imported/w3c/web-platform-tests/css/selectors/selectors-dir-selector-change-001.html [ ImageOnlyFailure ]
 webkit.org/b/64861 imported/w3c/web-platform-tests/css/selectors/selectors-dir-selector-change-002.html [ ImageOnlyFailure ]

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-01-12 10:42:26 UTC (rev 271395)
@@ -1,3 +1,52 @@
+2021-01-12  Manuel Rego Casasnovas  <[email protected]>
+
+        [selectors] Update tests from WPT
+        https://bugs.webkit.org/show_bug.cgi?id=220312
+
+        Reviewed by Sergio Villar Senin.
+
+        [selectors] Update :focus-visible tests from WPT
+
+        * web-platform-tests/css/selectors/focus-in-focus-event-001-expected.txt:
+        * web-platform-tests/css/selectors/focus-in-focus-event-001.html:
+        * web-platform-tests/css/selectors/focus-in-focusin-event-001-expected.txt: Added.
+        * web-platform-tests/css/selectors/focus-in-focusin-event-001.html: Added.
+        * web-platform-tests/css/selectors/focus-visible-001-expected.txt:
+        * web-platform-tests/css/selectors/focus-visible-001.html:
+        * web-platform-tests/css/selectors/focus-visible-002-expected.txt:
+        * web-platform-tests/css/selectors/focus-visible-002.html:
+        * web-platform-tests/css/selectors/focus-visible-003-expected.txt:
+        * web-platform-tests/css/selectors/focus-visible-003.html:
+        * web-platform-tests/css/selectors/focus-visible-004-expected.txt:
+        * web-platform-tests/css/selectors/focus-visible-004.html:
+        * web-platform-tests/css/selectors/focus-visible-005-expected.txt:
+        * web-platform-tests/css/selectors/focus-visible-005.html:
+        * web-platform-tests/css/selectors/focus-visible-006-expected.txt: Added.
+        * web-platform-tests/css/selectors/focus-visible-006.html: Added.
+        * web-platform-tests/css/selectors/focus-visible-007.html:
+        * web-platform-tests/css/selectors/focus-visible-008-expected.txt: Added.
+        * web-platform-tests/css/selectors/focus-visible-008.html: Added.
+        * web-platform-tests/css/selectors/focus-visible-009-expected.txt:
+        * web-platform-tests/css/selectors/focus-visible-009.html:
+        * web-platform-tests/css/selectors/focus-visible-010-expected.txt:
+        * web-platform-tests/css/selectors/focus-visible-010.html:
+        * web-platform-tests/css/selectors/focus-visible-011.html:
+        * web-platform-tests/css/selectors/focus-visible-012-expected.txt:
+        * web-platform-tests/css/selectors/focus-visible-012.html:
+        * web-platform-tests/css/selectors/focus-visible-014-expected.txt: Added.
+        * web-platform-tests/css/selectors/focus-visible-014.html: Added.
+        * web-platform-tests/css/selectors/focus-visible-015-expected.txt: Added.
+        * web-platform-tests/css/selectors/focus-visible-015.html: Added.
+        * web-platform-tests/css/selectors/focus-visible-016-expected.txt: Added.
+        * web-platform-tests/css/selectors/focus-visible-016.html: Added.
+        * web-platform-tests/css/selectors/parsing/parse-focus-visible-expected.txt: Added.
+        * web-platform-tests/css/selectors/parsing/parse-focus-visible.html: Added.
+        * web-platform-tests/css/selectors/parsing/parse-not-expected.txt:
+        Reported failure at webkit.org/b/220532.
+        * web-platform-tests/css/selectors/parsing/parse-not.html:
+        * web-platform-tests/css/selectors/parsing/w3c-import.log:
+        * web-platform-tests/css/selectors/w3c-import.log:
+
 2021-01-11  Sam Weinig  <[email protected]>
 
         Support lab(), lch(), gray() and color(lab ...) colors

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focus-event-001-expected.txt (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focus-event-001-expected.txt	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focus-event-001-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -1,4 +1,6 @@
 
 
 PASS Checks that ':focus' pseudo-class matches inside 'focus' event handler
+FAIL Checks that ':focus-visible' pseudo-class matches inside 'focus' event handler assert_unreached: ':focus-visible'  is an invalid selector. SyntaxError: SyntaxError: The string did not match the expected pattern. Reached unreachable code
+PASS Checks that ':focus-within' pseudo-class matches inside 'focus' event handler
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focus-event-001.html (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focus-event-001.html	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focus-event-001.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -1,10 +1,13 @@
 <!DOCTYPE html>
 <meta charset="utf-8">
-<title>Selectors Level 4: :focus in focus event</title>
+<title>Selectors Level 4: :focus, :focus-visible and :focus-within in focus event</title>
 <link rel="help" href=""
+<link rel="help" href=""
+<link rel="help" href=""
 <link rel="help" href=""
 <link rel="help" href=""
 <meta name='author' title='Takayoshi Kochi' href=''>
+<meta name='author' title='Manuel Rego Casasnovas' href=''>
 <script src=""
 <script src=""
 <input type="text">
@@ -11,10 +14,30 @@
 <script>
 var input = document.querySelector('input');
 input.addEventListener('focus', function(e) {
-  var focused = document.querySelector(':focus');
   test(() => {
-    assert_equals(e.target, focused, "':focus' matches event.target");
+    try {
+      var focusPseudo = document.querySelector(':focus');
+      assert_equals(e.target, focusPseudo, "':focus' matches event.target");
+    } catch (error) {
+      assert_unreached("':focus'  is an invalid selector. SyntaxError: " + error);
+    }
   }, "Checks that ':focus' pseudo-class matches inside 'focus' event handler");
+  test(() => {
+    try {
+      var focusVisiblePseudo = document.querySelector(':focus-visible');
+      assert_equals(e.target, focusVisiblePseudo, "':focus-visible' matches event.target");
+    } catch (error) {
+      assert_unreached("':focus-visible'  is an invalid selector. SyntaxError: " + error);
+    }
+  }, "Checks that ':focus-visible' pseudo-class matches inside 'focus' event handler");
+  test(() => {
+    try {
+      var focusWithinPseudo = document.querySelector(':focus-within');
+      assert_equals(document.documentElement, focusWithinPseudo, "':focus-within' matches document.documentElement");
+    } catch (error) {
+      assert_unreached("':focus-within'  is an invalid selector. SyntaxError: " + error);
+    }
+  }, "Checks that ':focus-within' pseudo-class matches inside 'focus' event handler");
 }, false);
 input.focus();
 </script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focusin-event-001-expected.txt (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focusin-event-001-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focusin-event-001-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,6 @@
+
+
+PASS Checks that ':focus' pseudo-class matches inside 'focusin' event handler
+FAIL Checks that ':focus-visible' pseudo-class matches inside 'focusin' event handler assert_unreached: ':focus-visible'  is an invalid selector. SyntaxError: SyntaxError: The string did not match the expected pattern. Reached unreachable code
+PASS Checks that ':focus-within' pseudo-class matches inside 'focusin' event handler
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focusin-event-001.html (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focusin-event-001.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focusin-event-001.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Selectors Level 4: :focus, :focus-visible and :focus-within in focusin event</title>
+<link rel="help" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name='author' title='Manuel Rego Casasnovas' href=''>
+<script src=""
+<script src=""
+<input type="text">
+<script>
+var input = document.querySelector('input');
+input.addEventListener('focusin', function(e) {
+  test(() => {
+    try {
+      var focusPseudo = document.querySelector(':focus');
+      assert_equals(e.target, focusPseudo, "':focus' matches event.target");
+    } catch (error) {
+      assert_unreached("':focus'  is an invalid selector. SyntaxError: " + error);
+    }
+  }, "Checks that ':focus' pseudo-class matches inside 'focusin' event handler");
+  test(() => {
+    try {
+      var focusVisiblePseudo = document.querySelector(':focus-visible');
+      assert_equals(e.target, focusVisiblePseudo, "':focus-visible' matches event.target");
+    } catch (error) {
+      assert_unreached("':focus-visible'  is an invalid selector. SyntaxError: " + error);
+    }
+  }, "Checks that ':focus-visible' pseudo-class matches inside 'focusin' event handler");
+  test(() => {
+    try {
+      var focusWithinPseudo = document.querySelector(':focus-within');
+      assert_equals(document.documentElement, focusWithinPseudo, "':focus-within' matches document.documentElement");
+    } catch (error) {
+      assert_unreached("':focus-within'  is an invalid selector. SyntaxError: " + error);
+    }
+  }, "Checks that ':focus-within' pseudo-class matches inside 'focusin' event handler");
+}, false);
+input.focus();
+</script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-001-expected.txt (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-001-expected.txt	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-001-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -5,5 +5,5 @@
 
 Focus me.
 
-FAIL Keyboard focus should match :focus-visible assert_equals: expected "rgb(0, 100, 0)" but got "rgb(0, 0, 0)"
+FAIL Keyboard focus should match :focus-visible assert_equals: outlineColor for DIV#el should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-001.html (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-001.html	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-001.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -11,14 +11,20 @@
   <script src=""
   <script src=""
   <style>
+    @supports not (selector(:focus-visible)) {
+      :focus {
+        outline: red solid 5px;
+        background-color: red;
+      }
+    }
+
     :focus-visible {
-      outline: darkgreen dotted 1px; /* fallback for Edge */
-      outline: darkgreen auto 5px;
+      outline: green solid 5px;
     }
 
     :focus:not(:focus-visible) {
       outline: 0;
-      background-color: tomato;
+      background-color: red;
     }
   </style>
 </head>
@@ -34,7 +40,8 @@
   <script>
     async_test(function(t) {
       el.addEventListener("focus", t.step_func(function() {
-        assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 100, 0)");
+        assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${el.tagName}#${el.id} should be green`);
+        assert_not_equals(getComputedStyle(el).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${el.tagName}#${el.id} should NOT be red`);
         t.done();
       }));
       const tab_key = '\ue004';

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-002-expected.txt (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-002-expected.txt	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-002-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -19,5 +19,19 @@
 
 
 
-FAIL Mouse focus on elements which would show a virtual keyboard should match :focus-visible assert_equals: expected "rgb(0, 100, 0)" but got "rgba(46, 52, 54, 0.59)"
+FAIL Focus element INPUT#input1 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for INPUT#input1 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#input2 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for INPUT#input2 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#input3 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for INPUT#input3 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#input4 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for INPUT#input4 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#input5 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for INPUT#input5 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#input6 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for INPUT#input6 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#input7 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for INPUT#input7 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#input8 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for INPUT#input8 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#input9 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for INPUT#input9 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#input10 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for INPUT#input10 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#input11 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for INPUT#input11 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#input12 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for INPUT#input12 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#input13 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for INPUT#input13 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element TEXTAREA#input14 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for TEXTAREA#input14 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element SELECT#input15 via mouse should match :focus-visible as it supports keyboard input assert_equals: outlineColor for SELECT#input15 should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-002.html (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-002.html	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-002.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -12,14 +12,20 @@
   <script src=""
   <script src=""
   <style>
+    @supports not (selector(:focus-visible)) {
+      :focus {
+        outline: red solid 5px;
+        background-color: red;
+      }
+    }
+
     :focus-visible {
-      outline: darkgreen dotted 1px; /* fallback for Edge */
-      outline: darkgreen auto 5px;
+      outline: green solid 5px;
     }
 
     :focus:not(:focus-visible) {
       outline: 0;
-      background-color: tomato;
+      background-color: red;
     }
   </style>
 </head>
@@ -32,76 +38,65 @@
   </ol>
   <br>
   <div>
-    <input data-tested="false" id="input1" value="Focus me."></input>
+    <input class="check" id="input1" value="Focus me."></input>
   </div>
   <div>
-    <input data-tested="false" id="input2" type="text" value="Focus me."></input>
+    <input class="check" id="input2" type="text" value="Focus me."></input>
   </div>
   <div>
-    <input data-tested="false" id="input3" type="email" value="Focus me."></input>
+    <input class="check" id="input3" type="email" value="Focus me."></input>
   </div>
    <div>
-    <input data-tested="false" id="input4" type="password" value="Focus me."></input>
+    <input class="check" id="input4" type="password" value="Focus me."></input>
   </div>
   <div>
-    <input data-tested="false" id="input5" type="search" value="Focus me."></input>
+    <input class="check" id="input5" type="search" value="Focus me."></input>
   </div>
   <div>
-    <input data-tested="false" id="input6" type="telephone" value="Focus me."></input>
+    <input class="check" id="input6" type="telephone" value="Focus me."></input>
   </div>
   <div>
-    <input data-tested="false" id="input7" type="url" value="Focus me."></input>
+    <input class="check" id="input7" type="url" value="Focus me."></input>
   </div>
   <div>
-    <input data-tested="false" id="input8" type="number" value="10000"></input>
+    <input class="check" id="input8" type="number" value="10000"></input>
   </div>
   <div>
-    <input data-tested="false" id="input9" type="date"></input>
+    <input class="check" id="input9" type="date"></input>
   </div>
   <div>
-    <input data-tested="false" id="input10" type="datetime-local"></input>
+    <input class="check" id="input10" type="datetime-local"></input>
   </div>
   <div>
-    <input data-tested="false" id="input11" type="month"></input>
+    <input class="check" id="input11" type="month"></input>
   </div>
   <div>
-    <input data-tested="false" id="input12" type="time"></input>
+    <input class="check" id="input12" type="time"></input>
   </div>
   <div>
-    <input data-tested="false" id="input13" type="week"></input>
+    <input class="check" id="input13" type="week"></input>
   </div>
   <div>
-    <textarea data-tested="false" id="input14">Focus me.</textarea>
+    <textarea class="check" id="input14">Focus me.</textarea>
   </div>
   <div>
-    <select data-tested="false" id="input15">
+    <select class="check" id="input15">
       <option>Focus me.</option>
       <option>Focus me.</option>
     </select>
   </div>
   <script>
-    async_test(function(t) {
-        function mouseClickInTarget(selector) {
-            let target = document.querySelector(selector);
-            return test_driver.click(target);
-        }
-
-        function testNextTarget(e) {
-            let el = e.target;
-            assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 100, 0)");
-            el.dataset.tested = true;
-            let nextTarget = document.querySelector("[data-tested=false]");
-            if (nextTarget) {
-                nextTarget.addEventListener("click", testNextTarget);
-                mouseClickInTarget("[data-tested=false]");
-            } else {
-                t.done();
-            }
-        }
-        input1.addEventListener("click", t.step_func(testNextTarget));
-
-        mouseClickInTarget("[data-tested=false]");
-    }, "Mouse focus on elements which would show a virtual keyboard should match :focus-visible");
+    for (const target of document.querySelectorAll(".check")) {
+      promise_test(() => {
+        return new Promise(resolve => {
+          target.addEventListener("focus", resolve);
+          test_driver.click(target);
+        }).then(() => {
+          assert_equals(getComputedStyle(target).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${target.tagName}#${target.id} should be green`);
+          assert_not_equals(getComputedStyle(target).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${target.tagName}#${target.id} should NOT be red`);
+        });
+      }, `Focus element ${target.tagName}#${target.id} via mouse should match :focus-visible as it supports keyboard input`);
+    }
   </script>
 </body>
 </html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-003-expected.txt (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-003-expected.txt	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-003-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -17,5 +17,16 @@
  Focus me.
  Focus me.
 
-FAIL Mouse focus on input elements which do not show a virtual keyboard should NOT match :focus-visible assert_equals: expected "none" but got "auto"
+FAIL Focus element SPAN#el-1 via mouse should NOT match :focus-visible as it does NOT support keyboard input assert_equals: backgroundColor for SPAN#el-1 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element SPAN#el-2 via mouse should NOT match :focus-visible as it does NOT support keyboard input assert_equals: backgroundColor for SPAN#el-2 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element SPAN#el-3 via mouse should NOT match :focus-visible as it does NOT support keyboard input assert_equals: backgroundColor for SPAN#el-3 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element BUTTON#el-4 via mouse should NOT match :focus-visible as it does NOT support keyboard input assert_equals: backgroundColor for BUTTON#el-4 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-5 via mouse should NOT match :focus-visible as it does NOT support keyboard input assert_equals: backgroundColor for INPUT#el-5 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-6 via mouse should NOT match :focus-visible as it does NOT support keyboard input assert_equals: backgroundColor for INPUT#el-6 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-7 via mouse should NOT match :focus-visible as it does NOT support keyboard input assert_equals: backgroundColor for INPUT#el-7 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-8 via mouse should NOT match :focus-visible as it does NOT support keyboard input assert_equals: backgroundColor for INPUT#el-8 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-9 via mouse should NOT match :focus-visible as it does NOT support keyboard input assert_equals: backgroundColor for INPUT#el-9 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-10 via mouse should NOT match :focus-visible as it does NOT support keyboard input assert_equals: backgroundColor for INPUT#el-10 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-12 via mouse should NOT match :focus-visible as it does NOT support keyboard input assert_equals: backgroundColor for INPUT#el-12 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-13 via mouse should NOT match :focus-visible as it does NOT support keyboard input assert_equals: backgroundColor for INPUT#el-13 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-003.html (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-003.html	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-003.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -11,14 +11,20 @@
   <script src=""
   <script src=""
   <style>
+    @supports not (selector(:focus-visible)) {
+      :focus {
+        outline: red solid 5px;
+        background-color: red;
+      }
+    }
+
     :focus-visible {
-      outline: red dotted 1px; /* fallback for Edge */
-      outline: red auto 5px;
+      outline: red solid 5px;
     }
 
     :focus:not(:focus-visible) {
         outline: 0;
-        background-color: darkseagreen;
+        background-color: lime;
     }
   </style>
 </head>
@@ -31,68 +37,65 @@
   </ol>
   <br />
   <div>
-    <span data-tested="false" id="el-1" tabindex="1">Focus me</span>
+    <span class="check" id="el-1" tabindex="1">Focus me</span>
   </div>
   <div>
-    <span data-tested="false" id="el-2" tabindex="-1">Focus me</span>
+    <span class="check" id="el-2" tabindex="-1">Focus me</span>
   </div>
   <div>
-    <span data-tested="false" id="el-3" tabindex="0">Focus me</span>
+    <span class="check" id="el-3" tabindex="0">Focus me</span>
   </div>
   <div>
-    <button data-tested="false" id="el-4">Focus me</span>
+    <button class="check" id="el-4">Focus me</span>
   </div>
   <div>
-    <input data-tested="false" id="el-5" type="button" value="Focus me"></input>
+    <input class="check" id="el-5" type="button" value="Focus me"></input>
   </div>
   <div>
-    <input data-tested="false" id="el-6" type="image" alt="Focus me."></input>
+    <input class="check" id="el-6" type="image" alt="Focus me."></input>
   </div>
   <div>
-    <input data-tested="false" id="el-7" type="reset" value="Focus me."></input>
+    <input class="check" id="el-7" type="reset" value="Focus me."></input>
   </div>
   <div>
-    <input data-tested="false" id="el-8" type="submit" value="Focus me."></input>
+    <input class="check" id="el-8" type="submit" value="Focus me."></input>
   </div>
   <div>
-    <label><input data-tested="false" id="el-9" type="checkbox"></input> Focus me.</label>
+    <label><input class="check" id="el-9" type="checkbox"></input> Focus me.</label>
   </div>
   <div>
-    <label><input data-tested="false" id="el-10" type="radio"></input> Focus me.</label>
+    <label><input class="check" id="el-10" type="radio"></input> Focus me.</label>
   </div>
   <div>
     <!-- Focusing file input triggers a modal, so only test manually -->
-    <input id="el-12" type="file" value="Focus me."></input>
+    <input id="el-11" type="file" value="Focus me."></input>
   </div>
   <div>
-    <label><input data-tested="false" id="el-13" type="range"></input> Focus me.</label>
+    <label><input class="check" id="el-12" type="range"></input> Focus me.</label>
   </div>
   <div>
     <!-- Ensure the color input is last, as it has a pop-up which obscures other elements -->
-    <label><input data-tested="false" id="el-11" type="color"></input> Focus me.</label>
+    <label><input class="check" id="el-13" type="color"></input> Focus me.</label>
   </div>
   <script>
-    function mouseClickInTarget(selector) {
-       let target = document.querySelector(selector);
-       return test_driver.click(target);
-    }
+    setup({ explicit_done: true });
 
-    async_test(function(t) {
-        document.querySelectorAll("[data-tested]").forEach((el) => {
-            el.addEventListener("click", t.step_func((e) => {
-                let el = e.target;
-                assert_equals(getComputedStyle(el).outlineStyle, "none");
-                el.dataset.tested = true;
-                if (document.querySelector("[data-tested=false]")) {
-                    mouseClickInTarget("[data-tested=false]");
-                } else {
-                    t.done();
-                }
-            }));
+    const elements = document.querySelectorAll(".check");
+    for (let i = 0; i < elements.length; i++) {
+      const target = elements[i];
+      promise_test(() => {
+        return new Promise(resolve => {
+          target.addEventListener("focus", resolve);
+          test_driver.click(target).then(() => {
+            if (i == (elements.length - 1))
+              done();
+          });
+        }).then(() => {
+          assert_equals(getComputedStyle(target).backgroundColor, "rgb(0, 255, 0)", `backgroundColor for ${target.tagName}#${target.id} should be lime`);
+          assert_not_equals(getComputedStyle(target).outlineColor, "rgb(255, 0, 0)", `outlineColor for ${target.tagName}#${target.id} should NOT be red`);
         });
-
-        mouseClickInTarget("[data-tested=false]");
-    }, "Mouse focus on input elements which do not show a virtual keyboard should NOT match :focus-visible");
+      }, `Focus element ${target.tagName}#${target.id} via mouse should NOT match :focus-visible as it does NOT support keyboard input`);
+    }
   </script>
 </body>
 </html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-004-expected.txt (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-004-expected.txt	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-004-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -11,11 +11,18 @@
 
 
 
- Focus me.
- Focus me.
 
  Focus me.
  Focus me.
 
-FAIL Mouse focus on input elements which do not show a virtual keyboard should NOT match :focus-visible - not affected by -webkit-appearance assert_equals: expected "none" but got "auto"
+FAIL Focus element SPAN#el-1 via mouse should NOT match :focus-visible as it does NOT support keyboard input - not affected by "appearance: none" assert_equals: backgroundColor for SPAN#el-1 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element SPAN#el-2 via mouse should NOT match :focus-visible as it does NOT support keyboard input - not affected by "appearance: none" assert_equals: backgroundColor for SPAN#el-2 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element SPAN#el-3 via mouse should NOT match :focus-visible as it does NOT support keyboard input - not affected by "appearance: none" assert_equals: backgroundColor for SPAN#el-3 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element BUTTON#el-4 via mouse should NOT match :focus-visible as it does NOT support keyboard input - not affected by "appearance: none" assert_equals: backgroundColor for BUTTON#el-4 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-5 via mouse should NOT match :focus-visible as it does NOT support keyboard input - not affected by "appearance: none" assert_equals: backgroundColor for INPUT#el-5 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-6 via mouse should NOT match :focus-visible as it does NOT support keyboard input - not affected by "appearance: none" assert_equals: backgroundColor for INPUT#el-6 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-7 via mouse should NOT match :focus-visible as it does NOT support keyboard input - not affected by "appearance: none" assert_equals: backgroundColor for INPUT#el-7 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-8 via mouse should NOT match :focus-visible as it does NOT support keyboard input - not affected by "appearance: none" assert_equals: backgroundColor for INPUT#el-8 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-10 via mouse should NOT match :focus-visible as it does NOT support keyboard input - not affected by "appearance: none" assert_equals: backgroundColor for INPUT#el-10 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+FAIL Focus element INPUT#el-11 via mouse should NOT match :focus-visible as it does NOT support keyboard input - not affected by "appearance: none" assert_equals: backgroundColor for INPUT#el-11 should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-004.html (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-004.html	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-004.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -11,15 +11,26 @@
   <script src=""
   <script src=""
   <style>
+    @supports not (selector(:focus-visible)) {
+      :focus {
+        outline: red solid 5px;
+        background-color: red;
+      }
+    }
+
     :focus-visible {
-      outline: red dotted 1px; /* fallback for Edge */
-      outline: red auto 5px;
+      outline: red solid 5px;
     }
 
     :focus:not(:focus-visible) {
       outline: 0;
-      background-color: darkseagreen;
+      background-color: lime;
     }
+
+    .check {
+      -webkit-appearance: none;
+      -webkit-appearance: none;
+    }
   </style>
 </head>
 <body>
@@ -31,70 +42,59 @@
   </ol>
   <br />
   <div>
-    <span data-tested="false" id="el-1" tabindex="1">Focus me</span>
+    <span class="check" id="el-1" tabindex="1">Focus me</span>
   </div>
   <div>
-    <span data-tested="false" id="el-2" tabindex="-1">Focus me</span>
+    <span class="check" id="el-2" tabindex="-1">Focus me</span>
   </div>
   <div>
-    <span data-tested="false" id="el-3" tabindex="0">Focus me</span>
+    <span class="check" id="el-3" tabindex="0">Focus me</span>
   </div>
   <div>
-    <button data-tested="false" id="el-4">Focus me</span>
+    <button class="check" id="el-4">Focus me</span>
   </div>
   <div>
-    <input data-tested="false" id="el-5" type="button" value="Focus me"></input>
+    <input class="check" id="el-5" type="button" value="Focus me"></input>
   </div>
   <div>
-    <input data-tested="false" id="el-6" type="image" alt="Focus me."></input>
+    <input class="check" id="el-6" type="image" alt="Focus me."></input>
   </div>
   <div>
-    <input data-tested="false" id="el-7" type="reset" value="Focus me."></input>
+    <input class="check" id="el-7" type="reset" value="Focus me."></input>
   </div>
   <div>
-    <input data-tested="false" id="el-8" type="submit" value="Focus me."></input>
+    <input class="check" id="el-8" type="submit" value="Focus me."></input>
   </div>
   <div>
-    <label><input data-tested="false" id="el-9" type="checkbox"></input> Focus me.</label>
-  </div>
-  <div>
-    <label><input data-tested="false" id="el-10" type="radio"></input> Focus me.</label>
-  </div>
-  <div>
     <!-- Focusing file input triggers a modal, so only test manually -->
-    <input id="el-12" type="file" value="Focus me."></input>
+    <input id="el-9" type="file" value="Focus me."></input>
   </div>
   <div>
-    <label><input data-tested="false" id="el-13" type="range"></input> Focus me.</label>
+    <label><input class="check" id="el-10" type="range"></input> Focus me.</label>
   </div>
   <div>
-    <!-- Ensure the color input is last, as it has a pop-up which obscures other elements,
-         causing the `mouseClickInTarget` method to fail and the test to hang waiting for
-         a click event.-->
-    <label><input data-tested="false" id="el-11" type="color"></input> Focus me.</label>
+    <!-- Ensure the color input is last, as it has a pop-up which obscures other elements -->
+    <label><input class="check" id="el-11" type="color"></input> Focus me.</label>
   </div>
   <script>
-    function mouseClickInTarget(selector) {
-       let target = document.querySelector(selector);
-       return test_driver.click(target);
-    }
+    setup({ explicit_done: true });
 
-    async_test(function(t) {
-        document.querySelectorAll("[data-tested]").forEach((el) => {
-            el.addEventListener("click", t.step_func((e) => {
-                let el = e.target;
-                assert_equals(getComputedStyle(el).outlineStyle, "none");
-                el.dataset.tested = true;
-                if (document.querySelector("[data-tested=false]")) {
-                    mouseClickInTarget("[data-tested=false]");
-                } else {
-                    t.done();
-                }
-            }));
+    const elements = document.querySelectorAll(".check");
+    for (let i = 0; i < elements.length; i++) {
+      const target = elements[i];
+      promise_test(() => {
+        return new Promise(resolve => {
+          target.addEventListener("focus", resolve);
+          test_driver.click(target).then(() => {
+            if (i == (elements.length - 1))
+              done();
+          });
+        }).then(() => {
+          assert_equals(getComputedStyle(target).backgroundColor, "rgb(0, 255, 0)", `backgroundColor for ${target.tagName}#${target.id} should be lime`);
+          assert_not_equals(getComputedStyle(target).outlineColor, "rgb(255, 0, 0)", `outlineColor for ${target.tagName}#${target.id} should NOT be red`);
         });
-
-        mouseClickInTarget("[data-tested=false]");
-    }, "Mouse focus on input elements which do not show a virtual keyboard should NOT match :focus-visible - not affected by -webkit-appearance");
+      }, `Focus element ${target.tagName}#${target.id} via mouse should NOT match :focus-visible as it does NOT support keyboard input - not affected by "appearance: none"`);
+    }
   </script>
 </body>
 </html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-005-expected.txt (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-005-expected.txt	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-005-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -6,5 +6,5 @@
 Click me.
 I will be focused programmatically.
 
-FAIL Programmatic focus after click should not match :focus-visible assert_equals: expected "none" but got "auto"
+FAIL Programmatic focus after click should not match :focus-visible assert_equals: backgroundColor for DIV#el should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-005.html (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-005.html	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-005.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -10,14 +10,20 @@
   <script src=""
   <script src=""
   <style>
+    @supports not (selector(:focus-visible)) {
+      :focus {
+        outline: red solid 5px;
+        background-color: red;
+      }
+    }
+
     :focus-visible {
-      outline: red dotted 1px; /* fallback for Edge */
-      outline: red auto 5px;
+      outline: red solid 5px;
     }
 
     :focus:not(:focus-visible) {
       outline: 0;
-      background-color: darkseagreen;
+      background-color: lime;
     }
   </style>
 </head>
@@ -37,7 +43,8 @@
     });
     async_test(function(t) {
       el.addEventListener("focus", t.step_func(function() {
-        assert_equals(getComputedStyle(el).outlineStyle, "none");
+        assert_equals(getComputedStyle(el).backgroundColor, "rgb(0, 255, 0)", `backgroundColor for ${el.tagName}#${el.id} should be lime`);
+        assert_not_equals(getComputedStyle(el).outlineColor, "rgb(255, 0, 0)", `outlineColor for ${el.tagName}#${el.id} should NOT be red`);
         t.done();
       }));
       test_driver.click(button);

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-006-expected.txt (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-006-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-006-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,9 @@
+This test checks that :focus-visible always matches on elements with contenteditable=true set.
+If the user-agent does not claim to support the :focus-visible pseudo-class then SKIP this test.
+Click the content editable span below to focus it.
+If the element has a red background, then the test result is FAILURE. If the element has a green outline, then the test result is SUCCESS.
+
+Focus me
+
+FAIL Focus should always match :focus-visible on content editable divs assert_equals: outlineColor for SPAN#el should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-006.html (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-006.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-006.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8" />
+  <title>CSS Test (Selectors): contenteditable elements always match :focus-visible</title>
+  <link rel="author" title="Alice Boxhall" href="" />
+  <link rel="help" href="" />
+  <script src=""
+  <script src=""
+  <script src=""
+  <script src=""
+  <style>
+    @supports not (selector(:focus-visible)) {
+      :focus {
+        outline: red solid 5px;
+        background-color: red;
+      }
+    }
+
+    span[contenteditable] {
+        border: 1px solid black;
+        background-color: white;
+        padding: 2px 5px;
+    }
+
+    :focus-visible {
+      outline: green solid 5px;
+    }
+
+    :focus:not(:focus-visible) {
+      outline: 0;
+      background-color: red;
+    }
+  </style>
+</head>
+<body>
+  This test checks that <code>:focus-visible</code> always matches on elements with <code>contenteditable=true</code> set.
+  <ol id="instructions">
+    <li>If the user-agent does not claim to support the <code>:focus-visible</code> pseudo-class then SKIP this test.</li>
+    <li><strong>Click</strong> the content editable span below to focus it.</li>
+    <li>If the element has a red background, then the test result is FAILURE. If the element has a green outline, then the test result is SUCCESS.</li>
+  </ol>
+  <br />
+  <div>
+    <span id="el" contenteditable>Focus me</span>
+  </div>
+  <script>
+    var actions_promise;
+    async_test(function(t) {
+      el.addEventListener("focus", t.step_func(function() {
+        assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${el.tagName}#${el.id} should be green`);
+        assert_not_equals(getComputedStyle(el).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${el.tagName}#${el.id} should NOT be red`);
+        // Make sure the test finishes after all the input actions are completed.
+        actions_promise.then( () => t.done() );
+      }));
+
+      actions_promise = test_driver.click(el);
+    }, "Focus should always match :focus-visible on content editable divs");
+  </script>
+</body>
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-007.html (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-007.html	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-007.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -11,13 +11,11 @@
   <script src=""
   <style>
     [data-hadkeydown] :focus-visible {
-      outline: darkgreen dotted 1px; /* fallback for Edge */
-      outline: darkgreen auto 5px;
+      outline: darkgreen solid 5px;
     }
 
     [data-hadmousedown] :focus-visible {
-      outline: red dotted 1px; /* fallback for Edge */
-      outline: red auto 5px;
+      outline: red solid 5px;
     }
 
     [data-hadkeydown] :focus:not(:focus-visible) {

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-008-expected.txt (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-008-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-008-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,12 @@
+This test checks that programmatically focusing an element after a keypress causes :focus-visible to match.
+Use the tab key to move focus to the button below that says "Tab to me and press ENTER."
+Press ENTER.
+If the element that says "I will be focused programmatically." has a red background, then the test result is FAILURE. If the element has a green outline, then the test result is SUCCESS.
+
+Tab to me and press ENTER.
+I will be focused programmatically.
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT Programmatic focus after keypress should match :focus-visible Test timed out
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-008.html (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-008.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-008.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8" />
+  <title>CSS Test (Selectors): Keyboard focus enables :focus-visible</title>
+  <link rel="author" title="Alice Boxhall" href="" />
+  <link rel="help" href="" />
+  <script src=""
+  <script src=""
+  <script src=""
+  <script src=""
+  <style>
+    @supports not (selector(:focus-visible)) {
+      #el:focus {
+        outline: red solid 5px;
+        background-color: red;
+      }
+    }
+
+    :focus-visible {
+      outline: green solid 5px;
+    }
+
+    #el:focus:not(:focus-visible) {
+      background-color: red;
+      outline: 0;
+    }
+  </style>
+</head>
+<body>
+  This test checks that programmatically focusing an element after a keypress causes <code>:focus-visible</code> to match.
+  <ol id="instructions">
+    <li>Use the tab key to move focus to the button below that says "Tab to me and press ENTER."</li>
+    <li>Press ENTER.</li>
+    <li>If the element that says "I will be focused programmatically." has a red background, then the test result is FAILURE. If the element has a green outline, then the test result is SUCCESS.</li>
+  </ol>
+  <br />
+  <button id="button">Tab to me and press ENTER.</button>
+  <div id="el" tabindex="-1">I will be focused programmatically.</el>
+  <script>
+  if ("async_test" in window) {
+    async_test(function(t) {
+      button.addEventListener("click", t.step_func(() => {
+        el.focus();
+      }));
+      el.addEventListener("focus", t.step_func(function() {
+        assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${el.tagName}#${el.id} should be green`);
+        assert_not_equals(getComputedStyle(el).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${el.tagName}#${el.id} should NOT be red`);
+        t.done();
+      }));
+      test_driver.send_keys(el, "\ue004\ue007"); // TAB and ENTER
+    }, "Programmatic focus after keypress should match :focus-visible");
+  } else {
+    button.addEventListener("click", () => {
+      el.focus();
+    });
+  }
+
+  const tab_key = '\ue004';
+  const enter_key = '\uE007';
+  test_driver.send_keys(el, tab_key).then(() => {
+    test_driver.send_keys(el, enter_key);
+  });
+  </script>
+</body>
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-009-expected.txt (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-009-expected.txt	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-009-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -3,5 +3,5 @@
 
 I will be focused automatically.
 
-FAIL Autofocus should match :focus-visible assert_equals: expected "rgb(0, 100, 0)" but got "rgba(0, 0, 0, 0.847)"
+FAIL Autofocus should match :focus-visible assert_equals: outlineColor for BUTTON#button should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-009.html (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-009.html	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-009.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -8,12 +8,19 @@
   <script src=""
   <script src=""
   <style>
+    @supports not (selector(:focus-visible)) {
+      #button:focus {
+        outline: red solid 5px;
+        background-color: red;
+      }
+    }
+
     :focus-visible {
-      outline: darkgreen auto 5px;
+      outline: green solid 5px;
     }
 
     #button:focus:not(:focus-visible) {
-      background-color: tomato;;
+      background-color: red;
       outline: 0;
     }
   </style>
@@ -28,13 +35,15 @@
   <script>
     async_test(function(t) {
       button.addEventListener("focus", t.step_func(function() {
-        assert_equals(getComputedStyle(button).outlineColor, "rgb(0, 100, 0)");
+        assert_equals(getComputedStyle(button).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${button.tagName}#${button.id} should be green`);
+        assert_not_equals(getComputedStyle(button).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${button.tagName}#${button.id} should NOT be red`);
         t.done();
       }));
 
       // Handle the case where the button is focused before the test runs.
      if (document.activeElement === button) {
-        assert_equals(getComputedStyle(button).outlineColor, "rgb(0, 100, 0)");
+        assert_equals(getComputedStyle(button).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${button.tagName}#${button.id} should be green`);
+        assert_not_equals(getComputedStyle(button).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${button.tagName}#${button.id} should NOT be red`);
         t.done();
      }
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-010-expected.txt (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-010-expected.txt	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-010-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -3,5 +3,5 @@
 
 I will be focused automatically.
 
-FAIL Programmatic focus on page load should match :focus-visible assert_equals: expected "rgb(0, 100, 0)" but got "rgb(0, 0, 0)"
+FAIL Programmatic focus on page load should match :focus-visible assert_equals: outlineColor for DIV#el should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-010.html (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-010.html	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-010.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -8,12 +8,19 @@
   <script src=""
   <script src=""
   <style>
+    @supports not (selector(:focus-visible)) {
+      :focus {
+        outline: red solid 5px;
+        background-color: red;
+      }
+    }
+
     :focus-visible {
-      outline: darkgreen auto 5px;
+      outline: green solid 5px;
     }
 
     :focus:not(:focus-visible) {
-      background-color: tomato;
+      background-color: red;
       outline: 0;
     }
   </style>
@@ -32,7 +39,8 @@
 
     async_test(function(t) {
       el.addEventListener("focus", t.step_func(function() {
-        assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 100, 0)");
+        assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${el.tagName}#${el.id} should be green`);
+        assert_not_equals(getComputedStyle(el).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${el.tagName}#${el.id} should NOT be red`);
         t.done();
       }));
     }, "Programmatic focus on page load should match :focus-visible");

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-011.html (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-011.html	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-011.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -10,16 +10,23 @@
   <script src=""
   <script src=""
   <style>
+    @supports not (selector(:focus-visible)) {
+      #next:focus {
+        outline: red solid 5px;
+        background-color: red;
+      }
+    }
+
     button {
       border: 0;
     }
 
     #next:focus-visible {
-      outline: darkgreen auto 5px;
+      outline: green solid 5px;
     }
 
     #next:focus:not(:focus-visible) {
-      background-color: tomato;
+      background-color: red;
       outline: 0;
     }
   </style>
@@ -43,7 +50,8 @@
 
     async_test(function(t) {
       next.addEventListener("focus", t.step_func(() => {
-        assert_equals(getComputedStyle(next).outlineColor, "rgb(0, 100, 0)");
+        assert_equals(getComputedStyle(next).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${next.tagName}#${next.id} should be green`);
+        assert_not_equals(getComputedStyle(next).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${next.tagName}#${next.id} should NOT be red`);
         t.done()
       }));
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-012-expected.txt (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-012-expected.txt	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-012-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -6,5 +6,5 @@
 
 Click me, then use a keyboard shortcut.
 
-FAIL Keyboard focus should match :focus-visible assert_equals: after focus() expected "rgb(0, 100, 0)" but got "rgba(46, 52, 54, 0.59)"
+FAIL Keyboard focus should match :focus-visible assert_equals: outlineColor for DIV#el should be green expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-012.html (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-012.html	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-012.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -11,15 +11,21 @@
   <script src=""
   <script src=""
   <style>
+    @supports not (selector(:focus-visible)) {
+      :focus {
+        outline: red solid 5px;
+        background-color: red;
+      }
+    }
+
     :focus-visible {
       outline: 0;
-      outline-color: tomato;
-      background-color: tomato;
+      outline-color: red;
+      background-color: red;
     }
 
     :focus:not(:focus-visible) {
-      outline: darkgreen dotted 1px; /* fallback for Edge */
-      outline: darkgreen auto 5px;
+      outline: green solid 5px;
     }
   </style>
 </head>
@@ -38,12 +44,14 @@
         var t = async_test( "Keyboard focus should match :focus-visible");
 
         el.addEventListener("click", t.step_func(function(e) {
-          assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 100, 0)", "after focus()");
+          assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${el.tagName}#${el.id} should be green`);
+          assert_not_equals(getComputedStyle(el).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${el.tagName}#${el.id} should NOT be red`);
         }), true);
 
         el.addEventListener("keydown", t.step_func(function(e) {
           if (e.altKey || e.ctrlKey || e.metaKey) {
-            assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 100, 0)", "after kb event");
+            assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${el.tagName}#${el.id} should be green`);
+            assert_not_equals(getComputedStyle(el).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${el.tagName}#${el.id} should NOT be red`);
             t.done();
             return;
           }
@@ -51,10 +59,6 @@
           t.done();
         }));
 
-        t.step_timeout(() => {
-          assert_true(false, "timeout");
-        }, 1000);
-
         const ctrl_key = '\uE009';
         test_driver.click(el).then(() => {
           return test_driver.send_keys(el, ctrl_key);

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-014-expected.txt (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-014-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-014-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,5 @@
+
+Target
+
+FAIL :focus-visible matches after script focus move assert_equals: backgroundColor for INPUT#input should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-014.html (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-014.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-014.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<meta charset="utf-8" />
+<title>CSS Selectors Test: :focus-visible matches after script focus move</title>
+<link rel="author" title="Manuel Rego Casasnovas" href=""
+<link rel="help" href="" />
+<meta name="assert" content="This test checks that if the active element matches ':focus-visible' and a script causes focus to move elsewhere, the newly focused element should match ':focus-visible'.">
+<script src=""
+<script src=""
+<style>
+  @supports not (selector(:focus-visible)) {
+    :focus {
+      outline: red solid 5px;
+      background-color: red;
+    }
+  }
+
+  :focus-visible {
+    background: lime;
+  }
+
+  :focus:not(:focus-visible) {
+    background-color: red;
+  }
+</style>
+
+<input id="input"></input>
+<div id="target" tabindex="0">Target</div>
+
+<script>
+  async_test(function(t) {
+    input.addEventListener("focus", t.step_func(function() {
+      assert_equals(getComputedStyle(input).backgroundColor, "rgb(0, 255, 0)", `backgroundColor for ${input.tagName}#${input.id} should be lime`);
+      target.focus();
+    }));
+
+    target.addEventListener("focus", t.step_func(function() {
+      assert_equals(getComputedStyle(target).backgroundColor, "rgb(0, 255, 0)", `backgroundColor for ${target.tagName}#${target.id} should be lime`);
+      t.done();
+    }));
+
+    input.focus();
+  }, ":focus-visible matches after script focus move");
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-015-expected.txt (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-015-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-015-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,5 @@
+Initial
+Target
+
+FAIL :focus-visible does not match after script focus move assert_equals: backgroundColor for DIV#initial should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-015.html (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-015.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-015.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<meta charset="utf-8" />
+<title>CSS Selectors Test: :focus-visible does not match after script focus move</title>
+<link rel="author" title="Manuel Rego Casasnovas" href=""
+<link rel="help" href="" />
+<meta name="assert" content="This test checks that if the active element does not match ':focus-visible' and a script causes focus to move elsewhere, the newly focused element should not match ':focus-visible'.">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<style>
+  @supports not (selector(:focus-visible)) {
+    :focus {
+      outline: red solid 5px;
+      background-color: red;
+    }
+  }
+
+  :focus-visible {
+    background: red;
+  }
+
+  :focus:not(:focus-visible) {
+    background-color: lime;
+  }
+</style>
+
+<div id="initial" tabindex="0">Initial</div>
+<div id="target" tabindex="0">Target</div>
+
+<script>
+  setup({ explicit_done: true });
+
+  async_test(function(t) {
+    initial.addEventListener("focus", t.step_func(function() {
+      assert_equals(getComputedStyle(initial).backgroundColor, "rgb(0, 255, 0)", `backgroundColor for ${initial.tagName}#${initial.id} should be lime`);
+      target.focus();
+    }));
+
+    target.addEventListener("focus", t.step_func(function() {
+      assert_equals(getComputedStyle(target).backgroundColor, "rgb(0, 255, 0)", `backgroundColor for ${target.tagName}#${target.id} should be lime`);
+      t.done();
+    }));
+
+    test_driver.click(initial).then(() => done());
+  }, ":focus-visible does not match after script focus move");
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-016-expected.txt (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-016-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-016-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,5 @@
+Initial
+
+
+FAIL :focus-visible always match on text inputs assert_equals: backgroundColor for DIV#initial should be lime expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-016.html (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-016.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-016.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<meta charset="utf-8" />
+<title>CSS Selectors Test: :focus-visible always match on text inputs</title>
+<link rel="author" title="Manuel Rego Casasnovas" href=""
+<link rel="help" href="" />
+<meta name="assert" content="This test checks that even if the active element does not match ':focus-visible' and a script causes focus to move into a text input, the text input should  match ':focus-visible'.">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<style>
+  @supports not (selector(:focus-visible)) {
+    :focus {
+      outline: red solid 5px;
+      background-color: red;
+    }
+  }
+
+  div:focus-visible {
+    background: red;
+  }
+
+  div:focus:not(:focus-visible) {
+    background-color: lime;
+  }
+
+  input:focus-visible {
+    background: lime;
+  }
+
+  input:focus:not(:focus-visible) {
+    background-color: red;
+  }
+</style>
+
+<div id="initial" tabindex="0">Initial</div>
+<input id="target" />
+
+<script>
+  setup({ explicit_done: true });
+
+  async_test(function(t) {
+    initial.addEventListener("focus", t.step_func(function() {
+      assert_equals(getComputedStyle(initial).backgroundColor, "rgb(0, 255, 0)", `backgroundColor for ${initial.tagName}#${initial.id} should be lime`);
+      target.focus();
+    }));
+
+    target.addEventListener("focus", t.step_func(function() {
+      assert_equals(getComputedStyle(target).backgroundColor, "rgb(0, 255, 0)", `backgroundColor for ${target.tagName}#${target.id} should be lime`);
+      t.done();
+    }));
+
+    test_driver.click(initial).then(() => done());
+  }, ":focus-visible always match on text inputs");
+</script>
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-focus-visible-expected.txt (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-focus-visible-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-focus-visible-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,5 @@
+
+FAIL ":focus-visible" should be a valid selector The string did not match the expected pattern.
+FAIL "a:focus-visible" should be a valid selector The string did not match the expected pattern.
+FAIL ":focus:not(:focus-visible)" should be a valid selector The string did not match the expected pattern.
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-focus-visible.html (0 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-focus-visible.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-focus-visible.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Selectors: :focus-visible pseudo-class</title>
+<link rel="author" title="Manuel Rego Casasnovas" href=""
+<link rel="help" href=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+  test_valid_selector(':focus-visible');
+  test_valid_selector('a:focus-visible');
+  test_valid_selector(':focus:not(:focus-visible)');
+</script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-not-expected.txt (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-not-expected.txt	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-not-expected.txt	2021-01-12 10:42:26 UTC (rev 271395)
@@ -16,6 +16,8 @@
 PASS ":not(:host(.a))" should be a valid selector
 PASS ":host(:not(.a))" should be a valid selector
 PASS ":not(:host(:not(.a)))" should be a valid selector
+PASS ":not([disabled][selected])" should be a valid selector
+PASS ":not([disabled],[selected])" should be a valid selector
 PASS ":not()" should be an invalid selector
 PASS ":not(:not())" should be an invalid selector
 PASS ":not(::before)" should be an invalid selector

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-not.html (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-not.html	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-not.html	2021-01-12 10:42:26 UTC (rev 271395)
@@ -24,6 +24,8 @@
   test_valid_selector(':not(:host(.a))');
   test_valid_selector(':host(:not(.a))');
   test_valid_selector(':not(:host(:not(.a)))');
+  test_valid_selector(':not([disabled][selected])', ':not([disabled][selected])');
+  test_valid_selector(':not([disabled],[selected])', ':not([disabled], [selected])');
 
   test_invalid_selector(':not()');
   test_invalid_selector(':not(:not())');

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/w3c-import.log (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/w3c-import.log	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/w3c-import.log	2021-01-12 10:42:26 UTC (rev 271395)
@@ -18,6 +18,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-child.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-class.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-descendant.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-focus-visible.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-id.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-is.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-not.html

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log (271394 => 271395)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log	2021-01-12 10:42:26 UTC (rev 271395)
@@ -9,7 +9,7 @@
 
 ------------------------------------------------------------------------
 Properties requiring vendor prefixes:
-None
+appearance
 Property values requiring vendor prefixes:
 None
 ------------------------------------------------------------------------
@@ -29,16 +29,22 @@
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/floating-first-letter-feff.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-display-none-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focus-event-001.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focusin-event-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-002.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-003.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-004.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-005.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-006.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-007.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-008.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-009.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-010.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-011.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-012.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-014.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-015.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-016.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-within-001-expected.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-within-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-within-002-expected.html

Modified: trunk/LayoutTests/platform/glib/TestExpectations (271394 => 271395)


--- trunk/LayoutTests/platform/glib/TestExpectations	2021-01-12 09:42:35 UTC (rev 271394)
+++ trunk/LayoutTests/platform/glib/TestExpectations	2021-01-12 10:42:26 UTC (rev 271395)
@@ -193,6 +193,11 @@
 
 imported/w3c/web-platform-tests/compat/webkit-box-rtl-flex.html [ Pass ]
 
+# Tests that timeout on Apple platforms.
+webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-002.html [ Pass ]
+webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-003.html [ Pass ]
+webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-004.html [ Pass ]
+
 #////////////////////////////////////////////////////////////////////////////////////////
 # End of PASSING tests.
 #////////////////////////////////////////////////////////////////////////////////////////
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to