Bug 674927 part 1 - Add reftests for spellcheck in contenteditable; r=ehsan
authorAryeh Gregor <ayg@aryeh.name>
Mon, 17 Jun 2013 21:23:53 -0400
changeset 146883 67b02bc5a2a179b7772ff722d818e2a94f476246
parent 146882 8a8ef7f74a46e6427512442fdf80cdabac767734
child 146884 ebc9b2b98ad7808ad2107e2ae09043d80a2ab594
push idunknown
push userunknown
push dateunknown
reviewersehsan
bugs674927
milestone24.0a1
Bug 674927 part 1 - Add reftests for spellcheck in contenteditable; r=ehsan
editor/reftests/reftest.list
editor/reftests/spellcheck-contenteditable-attr-dynamic-inherit.html
editor/reftests/spellcheck-contenteditable-attr-dynamic-override-inherit.html
editor/reftests/spellcheck-contenteditable-attr-dynamic-override.html
editor/reftests/spellcheck-contenteditable-attr-dynamic.html
editor/reftests/spellcheck-contenteditable-attr-inherit.html
editor/reftests/spellcheck-contenteditable-attr.html
editor/reftests/spellcheck-contenteditable-disabled-partial-ref.html
editor/reftests/spellcheck-contenteditable-disabled-partial.html
editor/reftests/spellcheck-contenteditable-disabled-ref.html
editor/reftests/spellcheck-contenteditable-disabled.html
editor/reftests/spellcheck-contenteditable-focused-reframe.html
editor/reftests/spellcheck-contenteditable-focused.html
editor/reftests/spellcheck-contenteditable-nofocus-ref.html
editor/reftests/spellcheck-contenteditable-nofocus.html
editor/reftests/spellcheck-contenteditable-property-dynamic-inherit.html
editor/reftests/spellcheck-contenteditable-property-dynamic-override-inherit.html
editor/reftests/spellcheck-contenteditable-property-dynamic-override.html
editor/reftests/spellcheck-contenteditable-property-dynamic.html
editor/reftests/spellcheck-contenteditable-ref.html
--- a/editor/reftests/reftest.list
+++ b/editor/reftests/reftest.list
@@ -103,8 +103,25 @@ needs-focus == 824080-2.html 824080-2-re
 needs-focus == 824080-3.html 824080-3-ref.html
 needs-focus != 824080-2.html 824080-3.html
 needs-focus == 824080-4.html 824080-4-ref.html
 needs-focus == 824080-5.html 824080-5-ref.html
 needs-focus != 824080-4.html 824080-5.html
 needs-focus == 824080-6.html 824080-6-ref.html
 needs-focus == 824080-7.html 824080-7-ref.html
 needs-focus != 824080-6.html 824080-7.html
+# Bug 674927: copy spellcheck-textarea tests to contenteditable
+== spellcheck-contenteditable-attr.html spellcheck-contenteditable-nofocus-ref.html
+fails-if(Android) != spellcheck-contenteditable-attr.html spellcheck-contenteditable-ref.html
+needs-focus == spellcheck-contenteditable-focused.html spellcheck-contenteditable-ref.html
+needs-focus == spellcheck-contenteditable-focused-reframe.html spellcheck-contenteditable-ref.html
+== spellcheck-contenteditable-nofocus.html spellcheck-contenteditable-disabled-ref.html
+fails == spellcheck-contenteditable-disabled.html spellcheck-contenteditable-disabled-ref.html
+fails == spellcheck-contenteditable-disabled-partial.html spellcheck-contenteditable-disabled-partial-ref.html
+== spellcheck-contenteditable-attr-inherit.html spellcheck-contenteditable-disabled-ref.html
+== spellcheck-contenteditable-attr-dynamic.html spellcheck-contenteditable-disabled-ref.html
+== spellcheck-contenteditable-attr-dynamic-inherit.html spellcheck-contenteditable-disabled-ref.html
+== spellcheck-contenteditable-property-dynamic.html spellcheck-contenteditable-disabled-ref.html
+== spellcheck-contenteditable-property-dynamic-inherit.html spellcheck-contenteditable-disabled-ref.html
+== spellcheck-contenteditable-attr-dynamic-override.html spellcheck-contenteditable-disabled-ref.html
+== spellcheck-contenteditable-attr-dynamic-override-inherit.html spellcheck-contenteditable-disabled-ref.html
+== spellcheck-contenteditable-property-dynamic-override.html spellcheck-contenteditable-disabled-ref.html
+== spellcheck-contenteditable-property-dynamic-override-inherit.html spellcheck-contenteditable-disabled-ref.html
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-attr-dynamic-inherit.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+    <div contenteditable>blahblahblah</div>
+    <script>
+      function init() {
+        document.body.setAttribute("spellcheck", "false");
+      }
+    </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-attr-dynamic-override-inherit.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()" spellcheck="true">
+    <div contenteditable>blahblahblah</div>
+    <script>
+      function init() {
+        document.body.setAttribute("spellcheck", "false");
+      }
+    </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-attr-dynamic-override.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+    <div contenteditable spellcheck="true">blahblahblah</div>
+    <script>
+      function init() {
+        document.querySelector("div").setAttribute("spellcheck", "false");
+      }
+    </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-attr-dynamic.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+    <div contenteditable>blahblahblah</div>
+    <script>
+      function init() {
+        document.querySelector("div").setAttribute("spellcheck", "false");
+      }
+    </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-attr-inherit.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+    <span spellcheck="false"><div contenteditable>blahblahblah</div></span>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-attr.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+  <div contenteditable>blahblahblah</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-disabled-partial-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<body>
+  <span contenteditable>sakde</span> kreid <span contenteditable>slodv</span>
+  <script>
+    // Adding focus to the textbox should trigger a spellcheck
+    document.querySelector("span").focus();
+    document.querySelector("span + span").focus();
+    document.querySelector("span + span").blur();
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-disabled-partial.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+  <div contenteditable>sakde <span spellcheck=false>kreid</span> slodv</div>
+  <script>
+    // Adding focus to the textbox should trigger a spellcheck
+    document.querySelector("div").focus();
+    document.querySelector("div").blur();
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-disabled-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+  <div>blahblahblah</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-disabled.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+  <div contenteditable spellcheck="false">blahblahblah</div>
+  <script>
+    // Adding focus to the textbox should trigger a spellcheck
+    document.querySelector("div").focus();
+    document.querySelector("div").blur();
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-focused-reframe.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<body>
+
+  <div contenteditable id="testBox" onfocus="reframe(this);">blahblahblah</div>
+  <script type="text/javascript">
+    function reframe(textbox) {
+      textbox.style.display = "none";
+      textbox.style.display = "";
+      textbox.clientWidth;
+    }
+    //Adding focus to the textbox should trigger a spellcheck
+    document.getElementById("testBox").focus();
+    document.getElementById("testBox").blur();
+  </script>
+  
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-focused.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<body>
+
+  <div contenteditable id="testBox">blahblahblah</div>
+  <script type="text/javascript">
+    //Adding focus to the textbox should trigger a spellcheck
+    document.getElementById("testBox").focus();
+    document.getElementById("testBox").blur();
+  </script>
+  
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-nofocus-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+  <div contenteditable spellcheck="true">blahblahblah</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-nofocus.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+  <div contenteditable>blahblahblah</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-property-dynamic-inherit.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+    <div contenteditable>blahblahblah</div>
+    <script>
+      function init() {
+        document.body.spellcheck = false;
+      }
+    </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-property-dynamic-override-inherit.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()" spellcheck="true">
+    <div contenteditable>blahblahblah</div>
+    <script>
+      function init() {
+        document.body.spellcheck = false;
+      }
+    </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-property-dynamic-override.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+    <div contenteditable spellcheck="true">blahblahblah</div>
+    <script>
+      function init() {
+        document.querySelector("div").spellcheck = false;
+      }
+    </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-property-dynamic.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+    <div contenteditable>blahblahblah</div>
+    <script>
+      function init() {
+        document.querySelector("div").spellcheck = false;
+      }
+    </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+  <div contenteditable spellcheck="true">blahblahblah</div>
+  <script type="text/javascript">
+    var box = document.getElementsByTagName("div")[0];
+    box.focus(); //Bring the textbox into focus, triggering a spellcheck
+    box.blur(); //Blur in order to make things similar to other tests otherwise
+  </script>
+</body>
+</html>