Bug 1354006 - [selectors4] Remove "interact" flag from :focus-within tests. r=xidorn
authorManuel Rego Casasnovas <rego@igalia.com>
Thu, 06 Apr 2017 07:09:35 +0200
changeset 351783 83eeccc86bab
parent 351782 e521b2604a41
child 351784 c858836be29e
push id31621
push userarchaeopteryx@coole-files.de
push date2017-04-07 20:14 +0000
treeherdermozilla-central@35c7be9c2db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1354006
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1354006 - [selectors4] Remove "interact" flag from :focus-within tests. r=xidorn This patch has been extracted from: https://github.com/w3c/web-platform-tests/pull/5370 The problem is that the "interact" flag on these tests causes that they are considered manual, when they can be run automatically. This patch removes the "interact" flag and uses "reftest-wait" class to be sure that the test has been completed.
layout/reftests/w3c-css/submitted/selectors4/focus-within-1.html
layout/reftests/w3c-css/submitted/selectors4/focus-within-2.html
layout/reftests/w3c-css/submitted/selectors4/focus-within-3.html
--- a/layout/reftests/w3c-css/submitted/selectors4/focus-within-1.html
+++ b/layout/reftests/w3c-css/submitted/selectors4/focus-within-1.html
@@ -1,19 +1,18 @@
 <!DOCTYPE html>
-<html>
+<html class="reftest-wait test">
   <head>
     <meta charset="utf-8">
     <title>CSS Test: :focus-within selector</title>
     <link rel="author" title="Ethan Lin" href="mailto:ethlin@mozilla.com">
     <link rel="author" title="Mozilla" href="https://www.mozilla.org">
     <link rel="help" href="https://drafts.csswg.org/selectors-4/#focus-within-pseudo">
     <meta name="assert" content="Test checks :focus-within works after focus change">
     <link rel="match" href="focus-within-1-ref.html">
-    <meta name="flags" content="interact">
     <style type="text/css">
       div {
         border: solid 15px blue;
         outline: none;
       }
       div:focus-within {
         border-color: green;
       }
@@ -28,11 +27,12 @@
     <script>
       var child1 = document.getElementById('child1');
       child1.focus();
       document.body.offsetWidth;
 
       var child2 = document.getElementById('child2');
       child2.focus();
       document.body.offsetWidth;
+      document.documentElement.classList.remove('reftest-wait');
     </script>
   </body>
 </html>
--- a/layout/reftests/w3c-css/submitted/selectors4/focus-within-2.html
+++ b/layout/reftests/w3c-css/submitted/selectors4/focus-within-2.html
@@ -1,19 +1,18 @@
 <!DOCTYPE html>
-<html>
+<html class="reftest-wait">
   <head>
     <meta charset="utf-8">
     <title>CSS Test: :focus-within selector</title>
     <link rel="author" title="Ethan Lin" href="mailto:ethlin@mozilla.com">
     <link rel="author" title="Mozilla" href="https://www.mozilla.org">
     <link rel="help" href="https://drafts.csswg.org/selectors-4/#focus-within-pseudo">
     <meta name="assert" content="Test checks :focus-within should not apply after element removed.">
     <link rel="match" href="focus-within-2-ref.html">
-    <meta name="flags" content="interact">
     <style type="text/css">
       div {
         border: solid 15px green;
         outline: none;
       }
       div:focus-within {
         border-color: red;
       }
@@ -26,11 +25,12 @@
     </div>
     <script>
       var child = document.getElementById('child');
       child.focus();
       document.body.offsetWidth;
       var parent = document.getElementById("parent");
       parent.removeChild(child);
       document.body.offsetWidth;
+      document.documentElement.classList.remove('reftest-wait');
     </script>
   </body>
 </html>
--- a/layout/reftests/w3c-css/submitted/selectors4/focus-within-3.html
+++ b/layout/reftests/w3c-css/submitted/selectors4/focus-within-3.html
@@ -1,27 +1,33 @@
 <!DOCTYPE html>
-<html>
+<html class="reftest-wait">
   <head>
     <meta charset="utf-8">
     <title>CSS Test: :focus-within selector</title>
     <link rel="author" title="Ethan Lin" href="mailto:ethlin@mozilla.com">
     <link rel="author" title="Mozilla" href="https://www.mozilla.org">
     <link rel="help" href="https://drafts.csswg.org/selectors-4/#focus-within-pseudo">
     <meta name="assert" content="Test checks :focus-within should not work for iframe">
     <link rel="match" href="focus-within-3-ref.html">
-    <meta name="flags" content="interact">
     <style type="text/css">
       div:focus-within {
         border: solid 15px red;
       }
       iframe:focus-within {
         border: solid 15px red;
       }
     </style>
   </head>
   <body>
     <p>Test passes if, when the element inside the iframe is focused, there is no red border surrounded.</p>
     <div>
-      <iframe src="focus-within-1.html" width="300px" height="300px" frameborder="0" tabindex="1"><p>Your browser does not support iframes.</p></iframe>
+      <iframe id="iframe" src="focus-within-1.html" width="300px" height="300px" frameborder="0" tabindex="1"><p>Your browser does not support iframes.</p></iframe>
     </div>
+    <script>
+      var iframe = document.getElementById("iframe");
+      iframe.addEventListener("load", function() {
+        while (iframe.contentWindow.document.documentElement.classList.contains("reftest-wait")) {}
+        document.documentElement.classList.remove('reftest-wait');
+      });
+    </script>
   </body>
 </html>