Bug 1354641 - part 2: fix reftest 672709-ref.html intermittent failure. r=ehsan draft
authorEvelyn Hung <jj.evelyn@gmail.com>
Wed, 24 May 2017 21:13:05 +0800
changeset 583715 c3863bc3766745692e1908a5948c2e01edc3a981
parent 583714 a50325ebe9171990895932503786e9dd5da31e7e
child 630168 c7fe8fb8d930f35f0bad47683a0b3a1ba2154a1e
push id60510
push userbmo:ehung@mozilla.com
push dateWed, 24 May 2017 13:57:06 +0000
reviewersehsan
bugs1354641, 672709
milestone55.0a1
Bug 1354641 - part 2: fix reftest 672709-ref.html intermittent failure. r=ehsan Avoid put <script> in body element, because the spell checker will go through all text elements in <body>. In this case, the whole document is in designMode, so every word in <body> will be checked. SpellCheker takes longer time to comsume all words than before, therefore the test might be timeout. MozReview-Commit-ID: ZsQrqmqy6H
editor/reftests/672709-ref.html
--- a/editor/reftests/672709-ref.html
+++ b/editor/reftests/672709-ref.html
@@ -1,22 +1,24 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
-  <body>
-    <style>
-      :-moz-read-only { color: red; }
-      :-moz-read-write { color: green; }
-    </style>
+  <head>
     <script>
       onload = function() {
         document.designMode = "on";
         var p = document.createElement("p");
         p.textContent = "test";
         document.getElementById("x").appendChild(p);
         getSelection().removeAllRanges(); // don't need a caret
         document.documentElement.removeAttribute("class");
       };
     </script>
+  </head>
+  <body>
+    <style>
+      :-moz-read-only { color: red; }
+      :-moz-read-write { color: green; }
+    </style>
     <div contenteditable id="x">
     </div>
     more test
   </body>
 </html>