summaryrefslogtreecommitdiffstats
path: root/editor/reftests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--editor/reftests/1088158-ref.html2
-rw-r--r--editor/reftests/1088158.html8
-rw-r--r--editor/reftests/1443902-1-ref.html15
-rw-r--r--editor/reftests/1443902-1.html16
-rw-r--r--editor/reftests/1443902-2-ref.html17
-rw-r--r--editor/reftests/1443902-2.html18
-rw-r--r--editor/reftests/1443902-3-ref.html17
-rw-r--r--editor/reftests/1443902-3.html18
-rw-r--r--editor/reftests/1443902-4-ref.html18
-rw-r--r--editor/reftests/1443902-4.html19
-rw-r--r--editor/reftests/338427-1-ref.html7
-rw-r--r--editor/reftests/338427-1.html7
-rw-r--r--editor/reftests/338427-2-ref.html19
-rw-r--r--editor/reftests/338427-2.html18
-rw-r--r--editor/reftests/338427-3-ref.html19
-rw-r--r--editor/reftests/338427-3.html19
-rw-r--r--editor/reftests/388980-1-ref.html25
-rw-r--r--editor/reftests/388980-1.html43
-rw-r--r--editor/reftests/462758-grabbers-resizers-ref.html34
-rw-r--r--editor/reftests/462758-grabbers-resizers.html33
-rw-r--r--editor/reftests/642800-iframe.html29
-rw-r--r--editor/reftests/642800-ref.html7
-rw-r--r--editor/reftests/642800.html18
-rw-r--r--editor/reftests/672709-ref.html22
-rw-r--r--editor/reftests/672709.html12
-rw-r--r--editor/reftests/674212-spellcheck-ref.html20
-rw-r--r--editor/reftests/674212-spellcheck.html20
-rw-r--r--editor/reftests/694880-1.html10
-rw-r--r--editor/reftests/694880-2.html11
-rw-r--r--editor/reftests/694880-3.html10
-rw-r--r--editor/reftests/694880-ref.html9
-rw-r--r--editor/reftests/824080-1-ref.html17
-rw-r--r--editor/reftests/824080-1.html19
-rw-r--r--editor/reftests/824080-2-ref.html22
-rw-r--r--editor/reftests/824080-2.html22
-rw-r--r--editor/reftests/824080-3-ref.html21
-rw-r--r--editor/reftests/824080-3.html21
-rw-r--r--editor/reftests/824080-4-ref.html21
-rw-r--r--editor/reftests/824080-4.html26
-rw-r--r--editor/reftests/824080-5-ref.html22
-rw-r--r--editor/reftests/824080-5.html25
-rw-r--r--editor/reftests/824080-6-ref.html18
-rw-r--r--editor/reftests/824080-6.html20
-rw-r--r--editor/reftests/824080-7-ref.html19
-rw-r--r--editor/reftests/824080-7.html22
-rw-r--r--editor/reftests/911201-ref.html2
-rw-r--r--editor/reftests/911201.html2
-rw-r--r--editor/reftests/969773-ref.html24
-rw-r--r--editor/reftests/969773.html29
-rw-r--r--editor/reftests/997805-ref.html2
-rw-r--r--editor/reftests/997805.html16
-rw-r--r--editor/reftests/caret_after_reframe-ref.html6
-rw-r--r--editor/reftests/caret_after_reframe.html14
-rw-r--r--editor/reftests/caret_on_focus-ref.html11
-rw-r--r--editor/reftests/caret_on_focus.html11
-rw-r--r--editor/reftests/caret_on_positioned-ref.html8
-rw-r--r--editor/reftests/caret_on_positioned.html8
-rw-r--r--editor/reftests/caret_on_presshell_reinit-2.html27
-rw-r--r--editor/reftests/caret_on_presshell_reinit-ref.html19
-rw-r--r--editor/reftests/caret_on_presshell_reinit.html22
-rw-r--r--editor/reftests/caret_on_textarea_lastline-ref.html13
-rw-r--r--editor/reftests/caret_on_textarea_lastline.html14
-rw-r--r--editor/reftests/dynamic-1.html9
-rw-r--r--editor/reftests/dynamic-overflow-change-ref.html13
-rw-r--r--editor/reftests/dynamic-overflow-change.html13
-rw-r--r--editor/reftests/dynamic-ref.html6
-rw-r--r--editor/reftests/dynamic-type-1.html11
-rw-r--r--editor/reftests/dynamic-type-2.html11
-rw-r--r--editor/reftests/dynamic-type-3.html11
-rw-r--r--editor/reftests/dynamic-type-4.html11
-rw-r--r--editor/reftests/emptypasswd-1.html6
-rw-r--r--editor/reftests/emptypasswd-2.html9
-rw-r--r--editor/reftests/emptypasswd-ref.html6
-rw-r--r--editor/reftests/exec-command-indent-ws-ref.html61
-rw-r--r--editor/reftests/exec-command-indent-ws.html81
-rw-r--r--editor/reftests/inline-table-editor-position-after-updating-table-size-from-input-event-listener-ref.html26
-rw-r--r--editor/reftests/inline-table-editor-position-after-updating-table-size-from-input-event-listener.html33
-rw-r--r--editor/reftests/input-text-notheme-onfocus-reframe-ref.html28
-rw-r--r--editor/reftests/input-text-notheme-onfocus-reframe.html32
-rw-r--r--editor/reftests/input-text-onfocus-reframe-ref.html25
-rw-r--r--editor/reftests/input-text-onfocus-reframe.html29
-rw-r--r--editor/reftests/newline-1.html6
-rw-r--r--editor/reftests/newline-2.html6
-rw-r--r--editor/reftests/newline-3.html6
-rw-r--r--editor/reftests/newline-4.html6
-rw-r--r--editor/reftests/newline-ref.html6
-rw-r--r--editor/reftests/nobogusnode-1.html6
-rw-r--r--editor/reftests/nobogusnode-2.html5
-rw-r--r--editor/reftests/nobogusnode-ref.html6
-rw-r--r--editor/reftests/passwd-1.html6
-rw-r--r--editor/reftests/passwd-2.html6
-rw-r--r--editor/reftests/passwd-3.html9
-rw-r--r--editor/reftests/passwd-4.html19
-rw-r--r--editor/reftests/passwd-5-with-Preview.html6
-rw-r--r--editor/reftests/passwd-5-with-TextEditor.html8
-rw-r--r--editor/reftests/passwd-6-ref.html6
-rw-r--r--editor/reftests/passwd-6-with-Preview.html10
-rw-r--r--editor/reftests/passwd-6-with-TextEditor.html12
-rw-r--r--editor/reftests/passwd-7-with-Preview.html6
-rw-r--r--editor/reftests/passwd-7-with-TextEditor.html8
-rw-r--r--editor/reftests/passwd-8-with-Preview.html7
-rw-r--r--editor/reftests/passwd-8-with-TextEditor.html9
-rw-r--r--editor/reftests/passwd-9-with-Preview.html9
-rw-r--r--editor/reftests/passwd-9-with-TextEditor.html7
-rw-r--r--editor/reftests/passwd-ref.html6
-rw-r--r--editor/reftests/readonly-editable-ref.html13
-rw-r--r--editor/reftests/readonly-editable.html24
-rw-r--r--editor/reftests/readonly-non-editable-ref.html21
-rw-r--r--editor/reftests/readonly-non-editable.html24
-rw-r--r--editor/reftests/readwrite-editable-ref.html13
-rw-r--r--editor/reftests/readwrite-editable.html24
-rw-r--r--editor/reftests/readwrite-non-editable-ref.html21
-rw-r--r--editor/reftests/readwrite-non-editable.html24
-rw-r--r--editor/reftests/reftest.list157
-rw-r--r--editor/reftests/selection_visibility_after_reframe-2.html12
-rw-r--r--editor/reftests/selection_visibility_after_reframe-3.html15
-rw-r--r--editor/reftests/selection_visibility_after_reframe-ref.html6
-rw-r--r--editor/reftests/selection_visibility_after_reframe.html15
-rw-r--r--editor/reftests/spellcheck-comma-valid-ref.html6
-rw-r--r--editor/reftests/spellcheck-comma-valid.html6
-rw-r--r--editor/reftests/spellcheck-contenteditable-attr-dynamic-inherit.html11
-rw-r--r--editor/reftests/spellcheck-contenteditable-attr-dynamic-override-inherit.html11
-rw-r--r--editor/reftests/spellcheck-contenteditable-attr-dynamic-override.html11
-rw-r--r--editor/reftests/spellcheck-contenteditable-attr-dynamic.html11
-rw-r--r--editor/reftests/spellcheck-contenteditable-attr-inherit.html6
-rw-r--r--editor/reftests/spellcheck-contenteditable-attr.html6
-rw-r--r--editor/reftests/spellcheck-contenteditable-disabled-partial-ref.html12
-rw-r--r--editor/reftests/spellcheck-contenteditable-disabled-partial.html11
-rw-r--r--editor/reftests/spellcheck-contenteditable-disabled-ref.html6
-rw-r--r--editor/reftests/spellcheck-contenteditable-disabled.html11
-rw-r--r--editor/reftests/spellcheck-contenteditable-focused-reframe.html18
-rw-r--r--editor/reftests/spellcheck-contenteditable-focused.html13
-rw-r--r--editor/reftests/spellcheck-contenteditable-nofocus-1.html6
-rw-r--r--editor/reftests/spellcheck-contenteditable-nofocus-2.html2
-rw-r--r--editor/reftests/spellcheck-contenteditable-nofocus-ref.html6
-rw-r--r--editor/reftests/spellcheck-contenteditable-property-dynamic-inherit.html11
-rw-r--r--editor/reftests/spellcheck-contenteditable-property-dynamic-override-inherit.html11
-rw-r--r--editor/reftests/spellcheck-contenteditable-property-dynamic-override.html11
-rw-r--r--editor/reftests/spellcheck-contenteditable-property-dynamic.html11
-rw-r--r--editor/reftests/spellcheck-contenteditable-ref.html11
-rw-r--r--editor/reftests/spellcheck-dotafterquote-valid-ref.html6
-rw-r--r--editor/reftests/spellcheck-dotafterquote-valid.html6
-rw-r--r--editor/reftests/spellcheck-hyphen-invalid-ref.html6
-rw-r--r--editor/reftests/spellcheck-hyphen-invalid.html6
-rw-r--r--editor/reftests/spellcheck-hyphen-multiple-invalid-ref.html6
-rw-r--r--editor/reftests/spellcheck-hyphen-multiple-invalid.html6
-rw-r--r--editor/reftests/spellcheck-hyphen-multiple-valid-ref.html6
-rw-r--r--editor/reftests/spellcheck-hyphen-multiple-valid.html6
-rw-r--r--editor/reftests/spellcheck-hyphen-valid-ref.html6
-rw-r--r--editor/reftests/spellcheck-hyphen-valid.html6
-rw-r--r--editor/reftests/spellcheck-input-attr-after.html6
-rw-r--r--editor/reftests/spellcheck-input-attr-before.html6
-rw-r--r--editor/reftests/spellcheck-input-attr-dynamic-inherit.html11
-rw-r--r--editor/reftests/spellcheck-input-attr-dynamic-override-inherit.html11
-rw-r--r--editor/reftests/spellcheck-input-attr-dynamic-override.html11
-rw-r--r--editor/reftests/spellcheck-input-attr-dynamic.html11
-rw-r--r--editor/reftests/spellcheck-input-attr-inherit.html6
-rw-r--r--editor/reftests/spellcheck-input-disabled.html6
-rw-r--r--editor/reftests/spellcheck-input-nofocus-ref.html6
-rw-r--r--editor/reftests/spellcheck-input-property-dynamic-inherit.html11
-rw-r--r--editor/reftests/spellcheck-input-property-dynamic-override-inherit.html11
-rw-r--r--editor/reftests/spellcheck-input-property-dynamic-override.html11
-rw-r--r--editor/reftests/spellcheck-input-property-dynamic.html11
-rw-r--r--editor/reftests/spellcheck-input-ref.html22
-rw-r--r--editor/reftests/spellcheck-non-latin-arabic-ref.html9
-rw-r--r--editor/reftests/spellcheck-non-latin-arabic.html9
-rw-r--r--editor/reftests/spellcheck-non-latin-chinese-simplified-ref.html9
-rw-r--r--editor/reftests/spellcheck-non-latin-chinese-simplified.html9
-rw-r--r--editor/reftests/spellcheck-non-latin-chinese-traditional-ref.html9
-rw-r--r--editor/reftests/spellcheck-non-latin-chinese-traditional.html9
-rw-r--r--editor/reftests/spellcheck-non-latin-hebrew-ref.html9
-rw-r--r--editor/reftests/spellcheck-non-latin-hebrew.html9
-rw-r--r--editor/reftests/spellcheck-non-latin-japanese-ref.html9
-rw-r--r--editor/reftests/spellcheck-non-latin-japanese.html9
-rw-r--r--editor/reftests/spellcheck-non-latin-korean-ref.html9
-rw-r--r--editor/reftests/spellcheck-non-latin-korean.html9
-rw-r--r--editor/reftests/spellcheck-period-valid-ref.html6
-rw-r--r--editor/reftests/spellcheck-period-valid.html6
-rw-r--r--editor/reftests/spellcheck-slash-valid-ref.html6
-rw-r--r--editor/reftests/spellcheck-slash-valid.html6
-rw-r--r--editor/reftests/spellcheck-space-valid-ref.html6
-rw-r--r--editor/reftests/spellcheck-space-valid.html6
-rw-r--r--editor/reftests/spellcheck-superscript-1-ref.html3
-rw-r--r--editor/reftests/spellcheck-superscript-1.html3
-rw-r--r--editor/reftests/spellcheck-superscript-2-ref.html3
-rw-r--r--editor/reftests/spellcheck-superscript-2.html3
-rw-r--r--editor/reftests/spellcheck-textarea-attr-dynamic-inherit.html11
-rw-r--r--editor/reftests/spellcheck-textarea-attr-dynamic-override-inherit.html11
-rw-r--r--editor/reftests/spellcheck-textarea-attr-dynamic-override.html11
-rw-r--r--editor/reftests/spellcheck-textarea-attr-dynamic.html11
-rw-r--r--editor/reftests/spellcheck-textarea-attr-inherit.html6
-rw-r--r--editor/reftests/spellcheck-textarea-attr.html6
-rw-r--r--editor/reftests/spellcheck-textarea-disabled.html6
-rw-r--r--editor/reftests/spellcheck-textarea-focused-notreadonly.html19
-rw-r--r--editor/reftests/spellcheck-textarea-focused-reframe.html18
-rw-r--r--editor/reftests/spellcheck-textarea-focused.html13
-rw-r--r--editor/reftests/spellcheck-textarea-nofocus-ref.html6
-rw-r--r--editor/reftests/spellcheck-textarea-nofocus.html6
-rw-r--r--editor/reftests/spellcheck-textarea-property-dynamic-inherit.html11
-rw-r--r--editor/reftests/spellcheck-textarea-property-dynamic-override-inherit.html11
-rw-r--r--editor/reftests/spellcheck-textarea-property-dynamic-override.html11
-rw-r--r--editor/reftests/spellcheck-textarea-property-dynamic.html11
-rw-r--r--editor/reftests/spellcheck-textarea-ref.html11
-rw-r--r--editor/reftests/spellcheck-textarea-ref2.html11
-rw-r--r--editor/reftests/spellcheck-url-valid-ref.html14
-rw-r--r--editor/reftests/spellcheck-url-valid.html14
-rw-r--r--editor/reftests/unneeded_scroll-ref.html16
-rw-r--r--editor/reftests/unneeded_scroll.html24
-rw-r--r--editor/reftests/xul/empty-ref.xhtml13
-rw-r--r--editor/reftests/xul/emptytextbox-4.xhtml12
-rw-r--r--editor/reftests/xul/emptytextbox-ref.xhtml13
-rw-r--r--editor/reftests/xul/input.css36
-rw-r--r--editor/reftests/xul/placeholder-reset.css8
-rw-r--r--editor/reftests/xul/platform.js28
-rw-r--r--editor/reftests/xul/reftest.list1
215 files changed, 2967 insertions, 0 deletions
diff --git a/editor/reftests/1088158-ref.html b/editor/reftests/1088158-ref.html
new file mode 100644
index 0000000000..be4592e69b
--- /dev/null
+++ b/editor/reftests/1088158-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<textarea placeholder="placeholder"></textarea>
diff --git a/editor/reftests/1088158.html b/editor/reftests/1088158.html
new file mode 100644
index 0000000000..435aa3f638
--- /dev/null
+++ b/editor/reftests/1088158.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<script>
+ onload = function() {
+ var t = document.createElement('textarea');
+ t.placeholder = "placeholder";
+ document.body.appendChild(t.cloneNode(true));
+ }
+</script>
diff --git a/editor/reftests/1443902-1-ref.html b/editor/reftests/1443902-1-ref.html
new file mode 100644
index 0000000000..5c15f399bb
--- /dev/null
+++ b/editor/reftests/1443902-1-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function init()
+{
+ document.getElementById("t1").focus();
+ document.getElementById("t1").setSelectionRange(4, 4);
+}
+</script>
+</head>
+<body onload="init()">
+<textarea id=t1 contenteditable=true>ABCD</textarea>
+</body>
+</html>
diff --git a/editor/reftests/1443902-1.html b/editor/reftests/1443902-1.html
new file mode 100644
index 0000000000..e6c133d0a4
--- /dev/null
+++ b/editor/reftests/1443902-1.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function init()
+{
+ document.getElementById("t1").focus();
+ document.getElementById("t1").setSelectionRange(4, 4);
+ document.getElementById("t1").setAttribute("contentEditable", "false");
+}
+</script>
+</head>
+<body onload="init()">
+<textarea id=t1 contenteditable=true>ABCD</textarea>
+</body>
+</html>
diff --git a/editor/reftests/1443902-2-ref.html b/editor/reftests/1443902-2-ref.html
new file mode 100644
index 0000000000..727ed76ea9
--- /dev/null
+++ b/editor/reftests/1443902-2-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function init()
+{
+ document.getElementById("t1").focus();
+ document.getElementById("t1").setSelectionRange(4, 4);
+}
+</script>
+</head>
+<body onload="init()">
+<div id="d1">
+<input type="text" id=t1 value="ABCD">
+</div>
+</body>
+</html>
diff --git a/editor/reftests/1443902-2.html b/editor/reftests/1443902-2.html
new file mode 100644
index 0000000000..125057fcec
--- /dev/null
+++ b/editor/reftests/1443902-2.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function init()
+{
+ document.getElementById("t1").focus();
+ document.getElementById("t1").setSelectionRange(4, 4);
+ document.getElementById("d1").setAttribute("contentEditable", "false");
+}
+</script>
+</head>
+<body onload="init()">
+<div contenteditable=true id="d1">
+<input type="text" id=t1 value="ABCD">
+</div>
+</body>
+</html>
diff --git a/editor/reftests/1443902-3-ref.html b/editor/reftests/1443902-3-ref.html
new file mode 100644
index 0000000000..1dd669016b
--- /dev/null
+++ b/editor/reftests/1443902-3-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function init()
+{
+ document.getElementById("t1").focus();
+ document.getElementById("t1").setSelectionRange(0, 1);
+}
+</script>
+</head>
+<body onload="init()">
+<div>
+<input type="text" id=t1 value="ABCD" readonly>
+</div>
+</body>
+</html>
diff --git a/editor/reftests/1443902-3.html b/editor/reftests/1443902-3.html
new file mode 100644
index 0000000000..9fffb644b7
--- /dev/null
+++ b/editor/reftests/1443902-3.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function init()
+{
+ document.getElementById("t1").focus();
+ document.getElementById("t1").setSelectionRange(0, 1);
+ document.getElementById("d1").setAttribute("contentEditable", "false");
+}
+</script>
+</head>
+<body onload="init()">
+<div contenteditable=true id="d1">
+<input type="text" id=t1 value="ABCD" readonly>
+</div>
+</body>
+</html>
diff --git a/editor/reftests/1443902-4-ref.html b/editor/reftests/1443902-4-ref.html
new file mode 100644
index 0000000000..ab360866cc
--- /dev/null
+++ b/editor/reftests/1443902-4-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function init()
+{
+ document.getElementById("t1").focus();
+ document.getElementById("t1").setSelectionRange(4, 4);
+}
+</script>
+</head>
+<body onload="init()">
+<div id="d1">
+<input type="text">
+</div>
+<input type="text" id=t1 value="ABCD">
+</body>
+</html>
diff --git a/editor/reftests/1443902-4.html b/editor/reftests/1443902-4.html
new file mode 100644
index 0000000000..6aacfd6356
--- /dev/null
+++ b/editor/reftests/1443902-4.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function init()
+{
+ document.getElementById("t1").focus();
+ document.getElementById("t1").setSelectionRange(4, 4);
+ document.getElementById("d1").setAttribute("contentEditable", "false");
+}
+</script>
+</head>
+<body onload="init()">
+<div contenteditable=true id="d1">
+<input type="text">
+</div>
+<input type="text" id=t1 value="ABCD">
+</body>
+</html>
diff --git a/editor/reftests/338427-1-ref.html b/editor/reftests/338427-1-ref.html
new file mode 100644
index 0000000000..d645ad9fb1
--- /dev/null
+++ b/editor/reftests/338427-1-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <textarea spellcheck="false" lang="testing-XX">strangeimpossibleword</textarea>
+</body>
+</html>
+
diff --git a/editor/reftests/338427-1.html b/editor/reftests/338427-1.html
new file mode 100644
index 0000000000..7a645a2247
--- /dev/null
+++ b/editor/reftests/338427-1.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <!-- invalid language will default to en-US, but no spell check since element is not focussed -->
+ <textarea lang="testing-XX">strangeimpossibleword</textarea>
+</body>
+</html>
diff --git a/editor/reftests/338427-2-ref.html b/editor/reftests/338427-2-ref.html
new file mode 100644
index 0000000000..273f82f9c7
--- /dev/null
+++ b/editor/reftests/338427-2-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<script>
+function init() {
+ var editor = document.getElementById('editor');
+ editor.addEventListener("focus", function() {
+ window.setTimeout(function() {
+ document.documentElement.className = '';
+ }, 0);
+ });
+ editor.focus();
+}
+</script>
+<body onload="init()">
+ <!-- invalid language will default to en-US -->
+ <div id="editor" lang="testing-XX" contenteditable="true" spellcheck="false">good possible word</div>
+</body>
+</html>
+
diff --git a/editor/reftests/338427-2.html b/editor/reftests/338427-2.html
new file mode 100644
index 0000000000..dc60977ac4
--- /dev/null
+++ b/editor/reftests/338427-2.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<script>
+function init() {
+ var editor = document.getElementById('editor');
+ editor.addEventListener("focus", function() {
+ window.setTimeout(function() {
+ document.documentElement.className = '';
+ }, 0);
+ });
+ editor.focus();
+}
+</script>
+<body onload="init()">
+ <!-- invalid language will default to en-US -->
+ <div id="editor" lang="testing-XX" contenteditable="true">good possible word</div>
+</body>
+</html>
diff --git a/editor/reftests/338427-3-ref.html b/editor/reftests/338427-3-ref.html
new file mode 100644
index 0000000000..14b993cffd
--- /dev/null
+++ b/editor/reftests/338427-3-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<script>
+function init() {
+ var editor = document.getElementById('editor');
+ // invalid language will default to en-US
+ editor.setAttribute('lang', 'testing-XX');
+ editor.addEventListener("focus", function() {
+ window.setTimeout(function() {
+ document.documentElement.className = '';
+ }, 0);
+ });
+ editor.focus();
+}
+</script>
+<body onload="init()">
+ <textarea id="editor" spellcheck="false" lang="en-US">good possible word</textarea>
+</body>
+</html>
diff --git a/editor/reftests/338427-3.html b/editor/reftests/338427-3.html
new file mode 100644
index 0000000000..ca994d80dd
--- /dev/null
+++ b/editor/reftests/338427-3.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<script>
+function init() {
+ var editor = document.getElementById('editor');
+ // invalid language will default to en-US
+ editor.setAttribute('lang', 'testing-XX');
+ editor.addEventListener("focus", function() {
+ window.setTimeout(function() {
+ document.documentElement.className = '';
+ }, 0);
+ });
+ editor.focus();
+}
+</script>
+<body onload="init()">
+ <textarea id="editor" lang="en-US">good possible word</textarea>
+</body>
+</html>
diff --git a/editor/reftests/388980-1-ref.html b/editor/reftests/388980-1-ref.html
new file mode 100644
index 0000000000..8b14d7e185
--- /dev/null
+++ b/editor/reftests/388980-1-ref.html
@@ -0,0 +1,25 @@
+<html>
+<head>
+<title>Reftest for bug 388980</title></html>
+<script type="text/javascript">
+
+var text = '<html><head></head><body style="font-size:16px;">'
+ + '<p><span style="background-color:red;">This paragraph should be red</span></p>'
+ + '<p><span style="background-color:blue;">This paragraph should be blue</span></p>'
+ + '<p>This paragraph should not be colored</p>'
+ + '</body></html>';
+
+function initIFrame() {
+ var doc = document.getElementById('theIFrame').contentDocument;
+ doc.designMode = 'on';
+ doc.open('text/html');
+ doc.write(text);
+ doc.close();
+}
+</script>
+</head>
+<body onload="initIFrame()" >
+<iframe id="theIFrame">
+</iframe>
+</body>
+</html>
diff --git a/editor/reftests/388980-1.html b/editor/reftests/388980-1.html
new file mode 100644
index 0000000000..f2e7d0de0e
--- /dev/null
+++ b/editor/reftests/388980-1.html
@@ -0,0 +1,43 @@
+<html>
+<head>
+<title>Reftest for bug 388980</title></html>
+<script type="text/javascript">
+
+var text = '<html><head></head><body style="font-size:16px;">'
+ + '<p id="redpar">This paragraph should be red</p>'
+ + '<p id="bluepar">This paragraph should be blue</p>'
+ + '<p>This paragraph should not be colored</p>'
+ +'</body></html>';
+
+
+function colorPar(par, color) {
+ var doc = document.getElementById('theIFrame').contentDocument;
+ var win = document.getElementById('theIFrame').contentWindow;
+ win.getSelection().selectAllChildren(doc.getElementById(par));
+ doc.execCommand("hilitecolor", false, color);
+ win.getSelection().removeAllRanges();
+}
+
+function initIFrame() {
+ var doc = document.getElementById('theIFrame').contentDocument;
+ doc.designMode = 'on';
+ doc.open('text/html');
+ doc.write(text);
+ doc.close();
+
+ // Test hilighting with styleWithCSS, should hilight the text...
+ doc.execCommand("styleWithCSS", false, true);
+ colorPar("redpar", "red");
+
+ // Test highlighting without styleWithCSS, should also work.
+ doc.execCommand("styleWithCSS", false, false);
+ colorPar("bluepar", "blue");
+
+}
+</script>
+</head>
+<body>
+<iframe id="theIFrame" onload="initIFrame()">
+</iframe>
+</body>
+</html>
diff --git a/editor/reftests/462758-grabbers-resizers-ref.html b/editor/reftests/462758-grabbers-resizers-ref.html
new file mode 100644
index 0000000000..a8f0c8691f
--- /dev/null
+++ b/editor/reftests/462758-grabbers-resizers-ref.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+ <script type="text/javascript">
+ function init() {
+ var editor = document.querySelector("div[contenteditable]");
+ editor.addEventListener("focus", function() {
+ setTimeout(function() {
+ document.documentElement.className = "";
+ }, 0);
+ });
+ editor.focus();
+ }
+ </script>
+ <style type="text/css">
+ html, body, div {
+ margin: 0;
+ padding: 0;
+ }
+ div {
+ border: 1px solid black;
+ margin: 50px;
+ height: 200px;
+ width: 200px;
+ }
+ </style>
+</head>
+<body onload="init()">
+ <div contenteditable>
+ this editable container should be neither draggable nor resizable.
+ </div>
+</body>
+</html>
+
diff --git a/editor/reftests/462758-grabbers-resizers.html b/editor/reftests/462758-grabbers-resizers.html
new file mode 100644
index 0000000000..15459bb6cb
--- /dev/null
+++ b/editor/reftests/462758-grabbers-resizers.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+ <script type="text/javascript">
+ function init() {
+ var editor = document.querySelector("div[contenteditable]");
+ editor.addEventListener("focus", function() {
+ setTimeout(function() {
+ document.documentElement.className = "";
+ }, 0);
+ });
+ editor.focus();
+ }
+ </script>
+ <style type="text/css">
+ html, body, div {
+ margin: 0;
+ padding: 0;
+ }
+ div {
+ border: 1px solid black;
+ margin: 50px;
+ height: 200px;
+ width: 200px;
+ }
+ </style>
+</head>
+<body onload="init()">
+ <div contenteditable style="position: absolute">
+ this editable container should be neither draggable nor resizable.
+ </div>
+</body>
+</html>
diff --git a/editor/reftests/642800-iframe.html b/editor/reftests/642800-iframe.html
new file mode 100644
index 0000000000..bb1ab63975
--- /dev/null
+++ b/editor/reftests/642800-iframe.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ @media only screen and (max-width: 480px) {
+ .overflow-hidden
+ {
+ overflow: hidden;
+ }
+
+ .float-left
+ {
+ float: left;
+ background: #f0f;
+ }
+ }
+ </style>
+</head>
+<body>
+ <h1>Iframe content</h1>
+ <div class="float-left">
+ <textarea>This text should be visible when window is resized </textarea>
+
+ </div>
+ <div class="overflow-hidden">
+ <textarea>This text should be visible when window is resized </textarea>
+ </div>
+</body>
+</html>
diff --git a/editor/reftests/642800-ref.html b/editor/reftests/642800-ref.html
new file mode 100644
index 0000000000..f062b145b0
--- /dev/null
+++ b/editor/reftests/642800-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<body>
+ <iframe onload="document.documentElement.className=''" src="642800-iframe.html" id="iframe" style="width: 500px; height: 200px"></iframe>
+</body>
+</html>
+
diff --git a/editor/reftests/642800.html b/editor/reftests/642800.html
new file mode 100644
index 0000000000..f2af589231
--- /dev/null
+++ b/editor/reftests/642800.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+ <script type="text/javascript">
+ function reframe(node) {
+ node.style.display = "none";
+ document.body.offsetWidth;
+ node.style.display = "block";
+ document.documentElement.className='';
+ }
+ </script>
+</head>
+<body>
+ <iframe onload="reframe(this)" src="642800-iframe.html" id="iframe" style="width: 500px; height: 200px"></iframe>
+
+</body>
+</html>
+
diff --git a/editor/reftests/672709-ref.html b/editor/reftests/672709-ref.html
new file mode 100644
index 0000000000..18ce2b5d58
--- /dev/null
+++ b/editor/reftests/672709-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <body>
+ <style>
+ :read-only { color: red; }
+ :read-write { color: green; }
+ </style>
+ <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>
+ <div contenteditable id="x">
+ </div>
+ more test
+ </body>
+</html>
diff --git a/editor/reftests/672709.html b/editor/reftests/672709.html
new file mode 100644
index 0000000000..d42c54b0c4
--- /dev/null
+++ b/editor/reftests/672709.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <style>
+ body { color: green; }
+ </style>
+ <div>
+ <p>test</p>
+ </div>
+ more test
+ </body>
+</html>
diff --git a/editor/reftests/674212-spellcheck-ref.html b/editor/reftests/674212-spellcheck-ref.html
new file mode 100644
index 0000000000..77ad5b9685
--- /dev/null
+++ b/editor/reftests/674212-spellcheck-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-wait">
+<head>
+ <script type="text/javascript">
+ function init() {
+ var editor = document.querySelector("div[contenteditable]");
+ editor.addEventListener("focus", function() {
+ setTimeout(function() {
+ document.documentElement.className = "";
+ }, 0);
+ });
+ editor.focus();
+ }
+ </script>
+</head>
+<body onload="init()">
+ <div contenteditable spellcheck>This is another misspellored word.</div>
+</body>
+</html>
+
diff --git a/editor/reftests/674212-spellcheck.html b/editor/reftests/674212-spellcheck.html
new file mode 100644
index 0000000000..7477cfc4b3
--- /dev/null
+++ b/editor/reftests/674212-spellcheck.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-wait">
+<head>
+ <script type="text/javascript">
+ function init() {
+ var editor = document.querySelector("div[contenteditable]");
+ editor.addEventListener("focus", function() {
+ editor.textContent = "This is another misspellored word.";
+ setTimeout(function() {
+ document.documentElement.className = "";
+ }, 0);
+ });
+ editor.focus();
+ }
+ </script>
+</head>
+<body onload="init()">
+ <div contenteditable spellcheck>This is a misspellored word.</div>
+</body>
+</html>
diff --git a/editor/reftests/694880-1.html b/editor/reftests/694880-1.html
new file mode 100644
index 0000000000..9a034f57cc
--- /dev/null
+++ b/editor/reftests/694880-1.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <style>
+ :read-only { color: green; }
+ :read-write { color: red; }
+ </style>
+ <body onload="document.designMode='on';document.designMode='off'">
+ <div>test</div>
+ </body>
+</html>
diff --git a/editor/reftests/694880-2.html b/editor/reftests/694880-2.html
new file mode 100644
index 0000000000..f6d137d5f9
--- /dev/null
+++ b/editor/reftests/694880-2.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <style>
+ :read-only { color: green; }
+ :read-write { color: red; }
+ </style>
+ <body onload="document.designMode='on';document.designMode='off'">
+ <div>test</div>
+ <div contenteditable></div>
+ </body>
+</html>
diff --git a/editor/reftests/694880-3.html b/editor/reftests/694880-3.html
new file mode 100644
index 0000000000..481187fff7
--- /dev/null
+++ b/editor/reftests/694880-3.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <style>
+ :read-only { color: red; }
+ :read-write { color: green; }
+ </style>
+ <body onload="document.designMode='on';document.designMode='off'">
+ <div contenteditable>test</div>
+ </body>
+</html>
diff --git a/editor/reftests/694880-ref.html b/editor/reftests/694880-ref.html
new file mode 100644
index 0000000000..d5c40547ee
--- /dev/null
+++ b/editor/reftests/694880-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <style>
+ div { color: green; }
+ </style>
+ <body>
+ <div>test</div>
+ </body>
+</html>
diff --git a/editor/reftests/824080-1-ref.html b/editor/reftests/824080-1-ref.html
new file mode 100644
index 0000000000..8a87864724
--- /dev/null
+++ b/editor/reftests/824080-1-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var editor = document.getElementById("editor");
+ document.getSelection().selectAllChildren(document.body);
+ }
+ </script>
+</head>
+<body onload="doTest();">
+<p>normal text</p>
+<div id="editor">editable text</div>
+</body>
+</html>
+
diff --git a/editor/reftests/824080-1.html b/editor/reftests/824080-1.html
new file mode 100644
index 0000000000..2dfe7e2c68
--- /dev/null
+++ b/editor/reftests/824080-1.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var editor = document.getElementById("editor");
+ editor.focus();
+ editor.blur();
+ document.getSelection().selectAllChildren(document.body);
+ }
+ </script>
+</head>
+<body onload="doTest();">
+<p>normal text</p>
+<div id="editor" contenteditable>editable text</div>
+</body>
+</html>
+
diff --git a/editor/reftests/824080-2-ref.html b/editor/reftests/824080-2-ref.html
new file mode 100644
index 0000000000..b1ea296794
--- /dev/null
+++ b/editor/reftests/824080-2-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ document.getSelection().selectAllChildren(document.getElementById("text"));
+ var editor = document.getElementById("editor");
+ var editorBody = editor.contentDocument.body;
+ editor.contentDocument.getSelection().selectAllChildren(editorBody);
+ editor.focus();
+ editor.blur();
+ }
+ </script>
+</head>
+<body>
+<p id="text">normal text</p>
+<iframe id="editor" onload="doTest();"
+ srcdoc="<body>editable text</body>"></iframe>
+</body>
+</html>
+
diff --git a/editor/reftests/824080-2.html b/editor/reftests/824080-2.html
new file mode 100644
index 0000000000..e0c22bd1a9
--- /dev/null
+++ b/editor/reftests/824080-2.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ document.getSelection().selectAllChildren(document.getElementById("text"));
+ var editor = document.getElementById("editor");
+ var editorBody = editor.contentDocument.body;
+ editor.contentDocument.getSelection().selectAllChildren(editorBody);
+ editor.focus();
+ editor.blur();
+ }
+ </script>
+</head>
+<body>
+<p id="text">normal text</p>
+<iframe id="editor" onload="doTest();"
+ srcdoc="<script>document.designMode='on';</script><body>editable text</body>"></iframe>
+</body>
+</html>
+
diff --git a/editor/reftests/824080-3-ref.html b/editor/reftests/824080-3-ref.html
new file mode 100644
index 0000000000..8849fc3835
--- /dev/null
+++ b/editor/reftests/824080-3-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ document.getSelection().selectAllChildren(document.getElementById("text"));
+ var editor = document.getElementById("editor");
+ var editorBody = editor.contentDocument.body;
+ editor.contentDocument.getSelection().selectAllChildren(editorBody);
+ editor.focus();
+ }
+ </script>
+</head>
+<body>
+<p id="text">normal text</p>
+<iframe id="editor" onload="doTest();"
+ src="data:text/html,<body>editable text</body>"></iframe>
+</body>
+</html>
+
diff --git a/editor/reftests/824080-3.html b/editor/reftests/824080-3.html
new file mode 100644
index 0000000000..b9882e5bb6
--- /dev/null
+++ b/editor/reftests/824080-3.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ document.getSelection().selectAllChildren(document.getElementById("text"));
+ var editor = document.getElementById("editor");
+ var editorBody = editor.contentDocument.body;
+ editor.contentDocument.getSelection().selectAllChildren(editorBody);
+ editor.focus();
+ }
+ </script>
+</head>
+<body>
+<p id="text">normal text</p>
+<iframe id="editor" onload="doTest();"
+ src="data:text/html,<script>document.designMode='on';</script><body>editable text</body>"></iframe>
+</body>
+</html>
+
diff --git a/editor/reftests/824080-4-ref.html b/editor/reftests/824080-4-ref.html
new file mode 100644
index 0000000000..6fd7f5928c
--- /dev/null
+++ b/editor/reftests/824080-4-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ document.getSelection().selectAllChildren(document.body);
+ var editor = document.getElementById("editor");
+ var editorBody = editor.contentDocument.body;
+ editor.contentDocument.getSelection().selectAllChildren(editorBody);
+ }
+ </script>
+</head>
+<body>
+<p id="text">normal text</p>
+<div>content editable</div>
+<iframe id="editor" onload="doTest();"
+ srcdoc="<body>editable text</body>"></iframe>
+</body>
+</html>
+
diff --git a/editor/reftests/824080-4.html b/editor/reftests/824080-4.html
new file mode 100644
index 0000000000..59589d3367
--- /dev/null
+++ b/editor/reftests/824080-4.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var editor1 = document.getElementById("editor1");
+ editor1.focus();
+ editor1.blur();
+ document.getSelection().selectAllChildren(document.body);
+ var editor2 = document.getElementById("editor2");
+ var editorBody = editor2.contentDocument.body;
+ editor2.contentDocument.getSelection().selectAllChildren(editorBody);
+ editor2.focus();
+ editor2.blur();
+ }
+ </script>
+</head>
+<body>
+<p>normal text</p>
+<div id="editor1" contenteditable>content editable</div>
+<iframe id="editor2" onload="doTest();"
+ srcdoc="<script>document.designMode='on';</script><body>editable text</body>"></iframe>
+</body>
+</html>
+
diff --git a/editor/reftests/824080-5-ref.html b/editor/reftests/824080-5-ref.html
new file mode 100644
index 0000000000..237fea2134
--- /dev/null
+++ b/editor/reftests/824080-5-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ document.getSelection().selectAllChildren(document.body);
+ var editor = document.getElementById("editor");
+ var editorBody = editor.contentDocument.body;
+ editor.contentDocument.getSelection().selectAllChildren(editorBody);
+ editor.focus();
+ }
+ </script>
+</head>
+<body>
+<p id="text">normal text</p>
+<div>content editable</div>
+<iframe id="editor" onload="doTest();"
+ src="data:text/html,<body>editable text</body>"></iframe>
+</body>
+</html>
+
diff --git a/editor/reftests/824080-5.html b/editor/reftests/824080-5.html
new file mode 100644
index 0000000000..30771d63f3
--- /dev/null
+++ b/editor/reftests/824080-5.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var editor1 = document.getElementById("editor1");
+ editor1.focus();
+ editor1.blur();
+ document.getSelection().selectAllChildren(document.body);
+ var editor2 = document.getElementById("editor2");
+ var editorBody = editor2.contentDocument.body;
+ editor2.contentDocument.getSelection().selectAllChildren(editorBody);
+ editor2.focus();
+ }
+ </script>
+</head>
+<body>
+<p>normal text</p>
+<div id="editor1" contenteditable>content editable</div>
+<iframe id="editor2" onload="doTest();"
+ src="data:text/html,<script>document.designMode='on';</script><body>editable text</body>"></iframe>
+</body>
+</html>
+
diff --git a/editor/reftests/824080-6-ref.html b/editor/reftests/824080-6-ref.html
new file mode 100644
index 0000000000..7ef193fcc7
--- /dev/null
+++ b/editor/reftests/824080-6-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var editor = document.getElementById("editor");
+ editor.focus();
+ editor.blur();
+ }
+ </script>
+</head>
+<body onload="doTest()">
+<p>normal text</p>
+<textarea id="editor" spellcheck="false">textarea</textarea>
+</body>
+</html>
+
diff --git a/editor/reftests/824080-6.html b/editor/reftests/824080-6.html
new file mode 100644
index 0000000000..5380fb46d6
--- /dev/null
+++ b/editor/reftests/824080-6.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ document.getSelection().selectAllChildren(document.body);
+ var editor = document.getElementById("editor");
+ editor.focus();
+ editor.select();
+ editor.blur();
+ }
+ </script>
+</head>
+<body onload="doTest()">
+<p>normal text</p>
+<textarea id="editor" spellcheck="false">textarea</textarea>
+</body>
+</html>
+
diff --git a/editor/reftests/824080-7-ref.html b/editor/reftests/824080-7-ref.html
new file mode 100644
index 0000000000..10162cb1f3
--- /dev/null
+++ b/editor/reftests/824080-7-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var editor = document.getElementById("editor");
+ editor.focus();
+ editor.selectionStart = 2;
+ editor.selectionEnd = 4;
+ }
+ </script>
+</head>
+<body onload="doTest()">
+<p>normal text</p>
+<textarea id="editor">textarea</textarea>
+</body>
+</html>
+
diff --git a/editor/reftests/824080-7.html b/editor/reftests/824080-7.html
new file mode 100644
index 0000000000..d09e1b5bad
--- /dev/null
+++ b/editor/reftests/824080-7.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function doTest()
+ {
+ document.getSelection().selectAllChildren(document.body);
+ var editor = document.getElementById("editor");
+ editor.focus();
+ editor.selectionStart = 2;
+ editor.selectionEnd = 4;
+ editor.blur();
+ editor.focus();
+ }
+ </script>
+</head>
+<body onload="doTest()">
+<p>normal text</p>
+<textarea id="editor">textarea</textarea>
+</body>
+</html>
+
diff --git a/editor/reftests/911201-ref.html b/editor/reftests/911201-ref.html
new file mode 100644
index 0000000000..323613ca26
--- /dev/null
+++ b/editor/reftests/911201-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<body contenteditable><div contenteditable=false>foo</div></body>
diff --git a/editor/reftests/911201.html b/editor/reftests/911201.html
new file mode 100644
index 0000000000..6b78e1cd2c
--- /dev/null
+++ b/editor/reftests/911201.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<body contenteditable onload="document.body.innerHTML='<div contenteditable=false>foo</div>';"></body>
diff --git a/editor/reftests/969773-ref.html b/editor/reftests/969773-ref.html
new file mode 100644
index 0000000000..32ffae7c12
--- /dev/null
+++ b/editor/reftests/969773-ref.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+ <meta charset="utf-8">
+ <title>Contenteditable Selection Test Case</title>
+ <script>
+ function runTests() {
+ var text = document.getElementById("text");
+
+ text.focus();
+
+ setTimeout(function () {
+ document.body.offsetHeight;
+ document.documentElement.removeAttribute('class');
+ }, 0);
+ }
+ document.addEventListener('MozReftestInvalidate', runTests);
+ </script>
+</head>
+<body>
+ <div>This is a contenteditable.</div>
+ <div id="text" tabindex="0">This is focusable text</div>
+</body>
+</html>
diff --git a/editor/reftests/969773.html b/editor/reftests/969773.html
new file mode 100644
index 0000000000..65ab32cbb4
--- /dev/null
+++ b/editor/reftests/969773.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+ <meta charset="utf-8">
+ <title>Contenteditable Selection Test Case</title>
+ <script>
+ function runTests() {
+ var editable = document.getElementById("editable");
+ var text = document.getElementById("text");
+
+ editable.focus();
+
+ setTimeout(function () {
+ editable.setAttribute("contenteditable", "false");
+ text.focus();
+ setTimeout(function () {
+ document.body.offsetHeight;
+ document.documentElement.removeAttribute('class');
+ }, 0);
+ }, 0);
+ }
+ document.addEventListener('MozReftestInvalidate', runTests);
+ </script>
+</head>
+<body>
+ <div id="editable" contenteditable="true" tabindex="0" spellcheck="false">This is a contenteditable.</div>
+ <div id="text" tabindex="0">This is focusable text</div>
+</body>
+</html>
diff --git a/editor/reftests/997805-ref.html b/editor/reftests/997805-ref.html
new file mode 100644
index 0000000000..be4592e69b
--- /dev/null
+++ b/editor/reftests/997805-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<textarea placeholder="placeholder"></textarea>
diff --git a/editor/reftests/997805.html b/editor/reftests/997805.html
new file mode 100644
index 0000000000..91750138b3
--- /dev/null
+++ b/editor/reftests/997805.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<textarea placeholder="placeholder"></textarea>
+<script>
+onload = function() {
+ var t = document.querySelector("textarea");
+ t.style.display = "none";
+ t.value = "test";
+ setTimeout(function() {
+ t.style.display = "";
+ t.value = "";
+ document.documentElement.className = "";
+ }, 0);
+};
+</script>
+</html>
diff --git a/editor/reftests/caret_after_reframe-ref.html b/editor/reftests/caret_after_reframe-ref.html
new file mode 100644
index 0000000000..63c49f66ce
--- /dev/null
+++ b/editor/reftests/caret_after_reframe-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input autofocus style="display:block">
+ </body>
+</html>
diff --git a/editor/reftests/caret_after_reframe.html b/editor/reftests/caret_after_reframe.html
new file mode 100644
index 0000000000..5e9c0f1330
--- /dev/null
+++ b/editor/reftests/caret_after_reframe.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <body>
+ <input onfocus="focused()" autofocus>
+ <script>
+ function focused() {
+ var i = document.querySelector("input");
+ i.style.display = "block";
+ document.offsetWidth;
+ document.documentElement.removeAttribute("class");
+ }
+ </script>
+ </body>
+</html>
diff --git a/editor/reftests/caret_on_focus-ref.html b/editor/reftests/caret_on_focus-ref.html
new file mode 100644
index 0000000000..4282ac7f55
--- /dev/null
+++ b/editor/reftests/caret_on_focus-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div { min-height: 20px; }
+ </style>
+ </head>
+ <body onload="document.querySelector('div').focus();">
+ <div contenteditable="true"></div>
+ </body>
+</html>
diff --git a/editor/reftests/caret_on_focus.html b/editor/reftests/caret_on_focus.html
new file mode 100644
index 0000000000..6dcedb4a4a
--- /dev/null
+++ b/editor/reftests/caret_on_focus.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div { min-height: 20px; }
+ </style>
+ </head>
+ <body onload="document.querySelector('div').focus();">
+ <div contenteditable="true"> </div>
+ </body>
+</html>
diff --git a/editor/reftests/caret_on_positioned-ref.html b/editor/reftests/caret_on_positioned-ref.html
new file mode 100644
index 0000000000..04773979dd
--- /dev/null
+++ b/editor/reftests/caret_on_positioned-ref.html
@@ -0,0 +1,8 @@
+<html><head>
+<title>caret should be visible on stack context contents</title>
+</head><body>
+<div id="d" style="width: 100px; height: 100px; background: none repeat scroll 0% 0% cyan;" contenteditable=""></div>
+<script>
+document.getElementById("d").focus();
+</script>
+</body></html> \ No newline at end of file
diff --git a/editor/reftests/caret_on_positioned.html b/editor/reftests/caret_on_positioned.html
new file mode 100644
index 0000000000..8a4a3c2f3a
--- /dev/null
+++ b/editor/reftests/caret_on_positioned.html
@@ -0,0 +1,8 @@
+<html><head>
+<title>caret should be visible on stack context contents</title>
+</head><body>
+<div id="d" style="position: absolute; width: 100px; height: 100px; background: none repeat scroll 0% 0% cyan;" contenteditable=""></div>
+<script>
+document.getElementById("d").focus();
+</script>
+</body></html> \ No newline at end of file
diff --git a/editor/reftests/caret_on_presshell_reinit-2.html b/editor/reftests/caret_on_presshell_reinit-2.html
new file mode 100644
index 0000000000..444b72dccd
--- /dev/null
+++ b/editor/reftests/caret_on_presshell_reinit-2.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <body>
+ <iframe srcdoc="<body><div></div></body>"></iframe>
+ <script type="text/javascript">
+ onload = function() {
+ var i = document.querySelector("iframe");
+ var win = i.contentWindow;
+ var doc = win.document;
+ var div = doc.querySelector("div");
+ win.getSelection().collapse(div, 0);
+ i.focus();
+ div.contentEditable = true;
+ div.focus();
+ setTimeout(function() {
+ var span = doc.createElement("span");
+ span.appendChild(doc.createTextNode("foo"));
+ div.appendChild(span);
+ div.style.outline = "none"; // remove the focus outline
+ i.style.position = "absolute";
+ document.body.clientWidth;
+ document.documentElement.removeAttribute("class");
+ }, 0);
+ };
+ </script>
+ </body>
+</html>
diff --git a/editor/reftests/caret_on_presshell_reinit-ref.html b/editor/reftests/caret_on_presshell_reinit-ref.html
new file mode 100644
index 0000000000..262c67a748
--- /dev/null
+++ b/editor/reftests/caret_on_presshell_reinit-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <div style="position: absolute">
+ <iframe srcdoc="<body contenteditable>foo</body>"></iframe>
+ </div>
+ <script type="text/javascript">
+ onload = function() {
+ var iframe = document.querySelector("iframe");
+ var win = iframe.contentWindow;
+ var body = win.document.body;
+ iframe.focus();
+ body.focus();
+ var sel = win.getSelection();
+ sel.collapse(body.firstChild, 0);
+ };
+ </script>
+ </body>
+</html>
diff --git a/editor/reftests/caret_on_presshell_reinit.html b/editor/reftests/caret_on_presshell_reinit.html
new file mode 100644
index 0000000000..aa10cc585f
--- /dev/null
+++ b/editor/reftests/caret_on_presshell_reinit.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <div>
+ <iframe srcdoc="<body contenteditable>foo</body>"></iframe>
+ </div>
+ <script type="text/javascript">
+ onload = function() {
+ var div = document.querySelector("div");
+ div.style.position = "absolute";
+ document.body.clientWidth;
+ var iframe = document.querySelector("iframe");
+ var win = iframe.contentWindow;
+ var body = win.document.body;
+ iframe.focus();
+ body.focus();
+ var sel = win.getSelection();
+ sel.collapse(body.firstChild, 0);
+ };
+ </script>
+ </body>
+</html>
diff --git a/editor/reftests/caret_on_textarea_lastline-ref.html b/editor/reftests/caret_on_textarea_lastline-ref.html
new file mode 100644
index 0000000000..9c1040255e
--- /dev/null
+++ b/editor/reftests/caret_on_textarea_lastline-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<body onload="loaded()">
+<script>
+ function loaded() {
+ var t = document.querySelector('textarea');
+ t.selectionStart = t.selectionEnd = t.value.length;
+ t.focus();
+ }
+</script>
+<textarea>foo</textarea>
+</body>
+</html>
diff --git a/editor/reftests/caret_on_textarea_lastline.html b/editor/reftests/caret_on_textarea_lastline.html
new file mode 100644
index 0000000000..24a53bd7d4
--- /dev/null
+++ b/editor/reftests/caret_on_textarea_lastline.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<body onload="loaded()">
+<script>
+ function loaded() {
+ var t = document.querySelector('textarea');
+ t.selectionStart = t.selectionEnd = t.value.length;
+ t.focus();
+ }
+</script>
+<textarea>foo
+</textarea>
+</body>
+</html>
diff --git a/editor/reftests/dynamic-1.html b/editor/reftests/dynamic-1.html
new file mode 100644
index 0000000000..5f2b8b7dcf
--- /dev/null
+++ b/editor/reftests/dynamic-1.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="text">
+ <script>
+ document.getElementsByTagName("input")[0].value = "abcdef";
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/dynamic-overflow-change-ref.html b/editor/reftests/dynamic-overflow-change-ref.html
new file mode 100644
index 0000000000..52e5f5bb0d
--- /dev/null
+++ b/editor/reftests/dynamic-overflow-change-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea rows="2" style="overflow: hidden;">
+ this
+ is
+ a
+ textarea
+ with
+ overflow
+ </textarea>
+ </body>
+</html>
diff --git a/editor/reftests/dynamic-overflow-change.html b/editor/reftests/dynamic-overflow-change.html
new file mode 100644
index 0000000000..57a1b8f74e
--- /dev/null
+++ b/editor/reftests/dynamic-overflow-change.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <body onload="document.querySelector('textarea').style.overflow='hidden'">
+ <textarea rows="2">
+ this
+ is
+ a
+ textarea
+ with
+ overflow
+ </textarea>
+ </body>
+</html>
diff --git a/editor/reftests/dynamic-ref.html b/editor/reftests/dynamic-ref.html
new file mode 100644
index 0000000000..07882ee7a0
--- /dev/null
+++ b/editor/reftests/dynamic-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="text" value="abcdef">
+</body>
+</html>
diff --git a/editor/reftests/dynamic-type-1.html b/editor/reftests/dynamic-type-1.html
new file mode 100644
index 0000000000..fb0c3ec684
--- /dev/null
+++ b/editor/reftests/dynamic-type-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="checkbox">
+ <script>
+ var i = document.getElementsByTagName("input")[0];
+ i.type = "text";
+ i.value = "abcdef";
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/dynamic-type-2.html b/editor/reftests/dynamic-type-2.html
new file mode 100644
index 0000000000..4d99ac06e2
--- /dev/null
+++ b/editor/reftests/dynamic-type-2.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="checkbox">
+ <script>
+ var i = document.getElementsByTagName("input")[0];
+ i.value = "abcdef";
+ i.type = "text";
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/dynamic-type-3.html b/editor/reftests/dynamic-type-3.html
new file mode 100644
index 0000000000..7cf5be6abb
--- /dev/null
+++ b/editor/reftests/dynamic-type-3.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="checkbox" value="foo">
+ <script>
+ var i = document.getElementsByTagName("input")[0];
+ i.type = "text";
+ i.value = "abcdef";
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/dynamic-type-4.html b/editor/reftests/dynamic-type-4.html
new file mode 100644
index 0000000000..7cf5be6abb
--- /dev/null
+++ b/editor/reftests/dynamic-type-4.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="checkbox" value="foo">
+ <script>
+ var i = document.getElementsByTagName("input")[0];
+ i.type = "text";
+ i.value = "abcdef";
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/emptypasswd-1.html b/editor/reftests/emptypasswd-1.html
new file mode 100644
index 0000000000..86775633bd
--- /dev/null
+++ b/editor/reftests/emptypasswd-1.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="password">
+</body>
+</html>
diff --git a/editor/reftests/emptypasswd-2.html b/editor/reftests/emptypasswd-2.html
new file mode 100644
index 0000000000..6e33f46b1c
--- /dev/null
+++ b/editor/reftests/emptypasswd-2.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="password" value="abcdef">
+ <script>
+ document.getElementsByTagName("input")[0].value = "";
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/emptypasswd-ref.html b/editor/reftests/emptypasswd-ref.html
new file mode 100644
index 0000000000..7f09f6e8be
--- /dev/null
+++ b/editor/reftests/emptypasswd-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="text">
+</body>
+</html>
diff --git a/editor/reftests/exec-command-indent-ws-ref.html b/editor/reftests/exec-command-indent-ws-ref.html
new file mode 100644
index 0000000000..0e65e0d3fb
--- /dev/null
+++ b/editor/reftests/exec-command-indent-ws-ref.html
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+ <meta charset="utf-8">
+ <title>Reference for bug </title>
+<style>
+html,body {
+ color:black; background-color:white; font:10px/1 monospace; padding:0; margin:0;
+}
+
+li::before { content: " list-item counter:" counters(list-item,".") " "; }
+ol,ul { border:1px solid; margin: 0; }
+div > ul { counter-reset: list-item 7; }
+</style>
+</head>
+<body>
+
+<div contenteditable>
+<ol start=8>
+ <li>A</li>
+ <ol><li class="indent">B</li></ol>
+ <li>C</li>
+</ol>
+</div>
+
+<div contenteditable>
+<ol start=8>
+ <li>A</li>
+ <ol><li class="indent">B</li></ol>
+ <li>C</li>
+</ol>
+</div>
+
+<div contenteditable>
+<ul>
+ <li>A</li>
+ <ul><li class="indent">B</li></ul>
+ <li>C</li>
+</ul>
+</div>
+
+<div contenteditable>
+<ul>
+ <li>A</li>
+ <ul><li class="indent">B</li></ul>
+ <li>C</li>
+</ul>
+</div>
+
+<!-- now the same as above without whitespace: -->
+
+<div contenteditable><ol start=8><li>A</li><ol><li class="indent">B</li></ol><li>C</li></ol></div>
+<div contenteditable><ol start=8><li>A</li><ol><li class="indent">B</li></ol><li>C</li></ol></div>
+<div contenteditable><ul><li>A</li><ul><li class="indent">B</li></ul><li>C</li></ul></div>
+<div contenteditable><ul><li>A</li><ul><li class="indent">B</li></ul><li>C</li></ul></div>
+
+</body>
+</html>
diff --git a/editor/reftests/exec-command-indent-ws.html b/editor/reftests/exec-command-indent-ws.html
new file mode 100644
index 0000000000..00d69aaa6e
--- /dev/null
+++ b/editor/reftests/exec-command-indent-ws.html
@@ -0,0 +1,81 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+ <meta charset="utf-8">
+ <title>Testcase for bug </title>
+<style>
+html,body {
+ color:black; background-color:white; font:10px/1 monospace; padding:0; margin:0;
+}
+
+li::before { content: " list-item counter:" counters(list-item,".") " "; }
+ol,ul { border:1px solid; margin: 0; }
+div > ul { counter-reset: list-item 7; }
+</style>
+</head>
+<body>
+
+<div contenteditable>
+<ol start=8>
+ <li>A</li>
+ <ol></ol>
+ <li class="indent">B</li>
+ <li>C</li>
+</ol>
+</div>
+
+<div contenteditable>
+<ol start=8>
+ <li>A</li>
+ <li class="indent">B</li>
+ <ol></ol>
+ <li>C</li>
+</ol>
+</div>
+
+<div contenteditable>
+<ul>
+ <li>A</li>
+ <ul></ul>
+ <li class="indent">B</li>
+ <li>C</li>
+</ul>
+</div>
+
+<div contenteditable>
+<ul>
+ <li>A</li>
+ <li class="indent">B</li>
+ <ul></ul>
+ <li>C</li>
+</ul>
+</div>
+
+<!-- now the same as above without whitespace: -->
+
+<div contenteditable><ol start=8><li>A</li><ol></ol><li class="indent">B</li><li>C</li></ol></div>
+<div contenteditable><ol start=8><li>A</li><li class="indent">B</li><ol></ol><li>C</li></ol></div>
+<div contenteditable><ul><li>A</li><ul></ul><li class="indent">B</li><li>C</li></ul></div>
+<div contenteditable><ul><li>A</li><li class="indent">B</li><ul></ul><li>C</li></ul></div>
+
+<script>
+function test() {
+ [...document.querySelectorAll('.indent')].forEach(function(elm) {
+ var r = document.createRange();
+ r.setStart(elm.firstChild,0)
+ r.setEnd(elm.firstChild,0)
+ window.getSelection().addRange(r);
+ document.execCommand("indent");
+ window.getSelection().removeAllRanges();
+ });
+}
+
+test();
+document.activeElement.blur();
+</script>
+
+</body>
+</html>
diff --git a/editor/reftests/inline-table-editor-position-after-updating-table-size-from-input-event-listener-ref.html b/editor/reftests/inline-table-editor-position-after-updating-table-size-from-input-event-listener-ref.html
new file mode 100644
index 0000000000..d8fa8861aa
--- /dev/null
+++ b/editor/reftests/inline-table-editor-position-after-updating-table-size-from-input-event-listener-ref.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<html lang="en-US" class="reftest-wait">
+<head>
+<meta charset="utf-8">
+<title>Inline table editor should be positioned correctly even if modified the table from an input event listener</title>
+<script>
+addEventListener("load", async () => {
+ const cell = document.querySelector("td + td");
+ document.body.focus();
+ getSelection().collapse(cell, 0);
+ document.execCommand("enableObjectResizing", false, "true");
+ document.execCommand("enableInlineTableEditing", false, "true");
+ requestAnimationFrame(
+ () => requestAnimationFrame(
+ () => document.documentElement.removeAttribute("class")
+ )
+ );
+}, {once: true});
+</script>
+</head>
+<body contenteditable="">
+<table border="1">
+<td>Cell</td><td style="width:100px"><br></td>
+</table>
+</body>
+</html> \ No newline at end of file
diff --git a/editor/reftests/inline-table-editor-position-after-updating-table-size-from-input-event-listener.html b/editor/reftests/inline-table-editor-position-after-updating-table-size-from-input-event-listener.html
new file mode 100644
index 0000000000..c6702c47c9
--- /dev/null
+++ b/editor/reftests/inline-table-editor-position-after-updating-table-size-from-input-event-listener.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<html lang="en-US" class="reftest-wait">
+<head>
+<meta charset="utf-8">
+<title>Inline table editor should be positioned correctly even if modified the table from an input event listener</title>
+<script>
+addEventListener("load", async () => {
+ const cell = document.querySelector("td");
+ document.body.focus();
+ getSelection().collapse(cell.firstChild, 0);
+ document.execCommand("enableObjectResizing", false, "true");
+ document.execCommand("enableInlineTableEditing", false, "true");
+ const nsITableEditor =
+ SpecialPowers.wrap(window).docShell.editingSession.
+ getEditorForWindow(window).QueryInterface(SpecialPowers.Ci.nsITableEditor);
+ document.body.addEventListener("input", event => {
+ cell.nextSibling.setAttribute("style", "width:100px");
+ }, {once: true});
+ nsITableEditor.insertTableColumn(1, true);
+ requestAnimationFrame(
+ () => requestAnimationFrame(
+ () => document.documentElement.removeAttribute("class")
+ )
+ );
+}, {once: true});
+</script>
+</head>
+<body contenteditable="">
+<table border="1">
+<td>Cell</td>
+</table>
+</body>
+</html> \ No newline at end of file
diff --git a/editor/reftests/input-text-notheme-onfocus-reframe-ref.html b/editor/reftests/input-text-notheme-onfocus-reframe-ref.html
new file mode 100644
index 0000000000..e97f55f160
--- /dev/null
+++ b/editor/reftests/input-text-notheme-onfocus-reframe-ref.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<head>
+ <title>bug 536421</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<style>
+input { border:1px solid blue; }
+</style>
+</head>
+<body onload="doTest()">
+ <input value="test" id="textbox" onfocus="triggerBug();" type="text">
+ <script type="text/javascript">
+ function finishTest()
+ {
+ document.documentElement.removeAttribute("class");
+ }
+ function triggerBug()
+ {
+ finishTest();
+ }
+ function doTest()
+ {
+ var t = document.getElementById("textbox");
+ t.focus();
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/input-text-notheme-onfocus-reframe.html b/editor/reftests/input-text-notheme-onfocus-reframe.html
new file mode 100644
index 0000000000..19bc273d17
--- /dev/null
+++ b/editor/reftests/input-text-notheme-onfocus-reframe.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<head>
+ <title>bug 536421</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<style>
+input { border:1px solid blue; }
+</style>
+</head>
+<body onload="doTest()">
+ <input value="test" id="textbox" onfocus="triggerBug();" type="text">
+ <script type="text/javascript">
+ function finishTest()
+ {
+ document.documentElement.removeAttribute("class");
+ }
+ function triggerBug()
+ {
+ var t = document.getElementById("textbox");
+ t.style.display = "none";
+ document.body.offsetWidth;
+ t.style.display = "";
+ finishTest();
+ }
+ function doTest()
+ {
+ var t = document.getElementById("textbox");
+ t.focus();
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/input-text-onfocus-reframe-ref.html b/editor/reftests/input-text-onfocus-reframe-ref.html
new file mode 100644
index 0000000000..e177578978
--- /dev/null
+++ b/editor/reftests/input-text-onfocus-reframe-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<head>
+ <title>bug 536421</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+</head>
+<body onload="doTest()">
+ <input value="test" id="textbox" onfocus="triggerBug();" type="text">
+ <script type="text/javascript">
+ function finishTest()
+ {
+ document.documentElement.removeAttribute("class");
+ }
+ function triggerBug()
+ {
+ finishTest();
+ }
+ function doTest()
+ {
+ var t = document.getElementById("textbox");
+ t.focus();
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/input-text-onfocus-reframe.html b/editor/reftests/input-text-onfocus-reframe.html
new file mode 100644
index 0000000000..339ef95c66
--- /dev/null
+++ b/editor/reftests/input-text-onfocus-reframe.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<head>
+ <title>bug 536421</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+</head>
+<body onload="doTest()">
+ <input value="test" id="textbox" onfocus="triggerBug();" type="text">
+ <script type="text/javascript">
+ function finishTest()
+ {
+ document.documentElement.removeAttribute("class");
+ }
+ function triggerBug()
+ {
+ var t = document.getElementById("textbox");
+ t.style.display = "none";
+ document.body.offsetWidth;
+ t.style.display = "";
+ finishTest();
+ }
+ function doTest()
+ {
+ var t = document.getElementById("textbox");
+ t.focus();
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/newline-1.html b/editor/reftests/newline-1.html
new file mode 100644
index 0000000000..5a7ce8c195
--- /dev/null
+++ b/editor/reftests/newline-1.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="text" value="aaa&#10;bbb">
+</body>
+</html>
diff --git a/editor/reftests/newline-2.html b/editor/reftests/newline-2.html
new file mode 100644
index 0000000000..7965bc8604
--- /dev/null
+++ b/editor/reftests/newline-2.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="text" value="&#10;aaa bbb">
+</body>
+</html>
diff --git a/editor/reftests/newline-3.html b/editor/reftests/newline-3.html
new file mode 100644
index 0000000000..18760df4cf
--- /dev/null
+++ b/editor/reftests/newline-3.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="text" value="aaa bbb&#10;">
+</body>
+</html>
diff --git a/editor/reftests/newline-4.html b/editor/reftests/newline-4.html
new file mode 100644
index 0000000000..2f51eaa20b
--- /dev/null
+++ b/editor/reftests/newline-4.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="text" value="a&#10;a&#10;a&#10; &#10;b&#10;b&#10;b">
+</body>
+</html>
diff --git a/editor/reftests/newline-ref.html b/editor/reftests/newline-ref.html
new file mode 100644
index 0000000000..3630626ddc
--- /dev/null
+++ b/editor/reftests/newline-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="text" value="aaa bbb">
+</body>
+</html>
diff --git a/editor/reftests/nobogusnode-1.html b/editor/reftests/nobogusnode-1.html
new file mode 100644
index 0000000000..450d6b1e51
--- /dev/null
+++ b/editor/reftests/nobogusnode-1.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body contenteditable>
+ This is a test.
+</body>
+</html>
diff --git a/editor/reftests/nobogusnode-2.html b/editor/reftests/nobogusnode-2.html
new file mode 100644
index 0000000000..532e597403
--- /dev/null
+++ b/editor/reftests/nobogusnode-2.html
@@ -0,0 +1,5 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body contenteditable="true">
+ This is a test.
+</body>
+</html>
diff --git a/editor/reftests/nobogusnode-ref.html b/editor/reftests/nobogusnode-ref.html
new file mode 100644
index 0000000000..052a53b51a
--- /dev/null
+++ b/editor/reftests/nobogusnode-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ This is a test.
+</body>
+</html>
diff --git a/editor/reftests/passwd-1.html b/editor/reftests/passwd-1.html
new file mode 100644
index 0000000000..f6f21d84f9
--- /dev/null
+++ b/editor/reftests/passwd-1.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="password" value="123456">
+</body>
+</html>
diff --git a/editor/reftests/passwd-2.html b/editor/reftests/passwd-2.html
new file mode 100644
index 0000000000..07882ee7a0
--- /dev/null
+++ b/editor/reftests/passwd-2.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="text" value="abcdef">
+</body>
+</html>
diff --git a/editor/reftests/passwd-3.html b/editor/reftests/passwd-3.html
new file mode 100644
index 0000000000..3e1e715eb9
--- /dev/null
+++ b/editor/reftests/passwd-3.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="password">
+ <script>
+ document.getElementsByTagName("input")[0].value = "abcdef";
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/passwd-4.html b/editor/reftests/passwd-4.html
new file mode 100644
index 0000000000..607a22ae41
--- /dev/null
+++ b/editor/reftests/passwd-4.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<!--
+Make sure that focusing a password text element does not
+cause a non-breaking space character to show up.
+-->
+<html class="reftest-wait">
+<body onload="loaded()">
+ <input type="password">
+ <script>
+ function loaded() {
+ var i = document.getElementsByTagName("input")[0];
+ i.focus();
+ i.value += "abcdef";
+ i.blur();
+ document.documentElement.className = "";
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/passwd-5-with-Preview.html b/editor/reftests/passwd-5-with-Preview.html
new file mode 100644
index 0000000000..d95382deb3
--- /dev/null
+++ b/editor/reftests/passwd-5-with-Preview.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="password" value=" "><!-- even only whitespace, text frame should be created -->
+</body>
+</html>
diff --git a/editor/reftests/passwd-5-with-TextEditor.html b/editor/reftests/passwd-5-with-TextEditor.html
new file mode 100644
index 0000000000..2b6c5958e8
--- /dev/null
+++ b/editor/reftests/passwd-5-with-TextEditor.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<body onload="document.getElementsByTagName('input')[0].focus();
+ document.getElementsByTagName('input')[0].blur();
+ document.documentElement.removeAttribute('class');">
+ <input type="password" value=" "><!-- even only whitespace, text frame should be created -->
+</body>
+</html>
diff --git a/editor/reftests/passwd-6-ref.html b/editor/reftests/passwd-6-ref.html
new file mode 100644
index 0000000000..e66f4e0b8c
--- /dev/null
+++ b/editor/reftests/passwd-6-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="password" value="012345678901234">
+</body>
+</html>
diff --git a/editor/reftests/passwd-6-with-Preview.html b/editor/reftests/passwd-6-with-Preview.html
new file mode 100644
index 0000000000..745ced2251
--- /dev/null
+++ b/editor/reftests/passwd-6-with-Preview.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="password" value="&#x1f914;&#x1f9b8;&#x1f3fd;&#x200D;&#x2640;&#xfe0f;&#x8fba;&#xe0101;&#x915;&#x94d;&zwj;"
+ ><!-- Simple Emoji (a surrogate pair in UTF-16),
+ Complicate Emoji (Woman Superhero: Medium Skin Tone),
+ Kanji with IVS,
+ 2 devanāgarī characters followed by ZWJ -->
+</body>
+</html>
diff --git a/editor/reftests/passwd-6-with-TextEditor.html b/editor/reftests/passwd-6-with-TextEditor.html
new file mode 100644
index 0000000000..f9fcb18924
--- /dev/null
+++ b/editor/reftests/passwd-6-with-TextEditor.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<body onload="document.getElementsByTagName('input')[0].focus();
+ document.getElementsByTagName('input')[0].blur();
+ document.documentElement.removeAttribute('class');">
+ <input type="password" value="&#x1f914;&#x1f9b8;&#x1f3fd;&#x200D;&#x2640;&#xfe0f;&#x8fba;&#xe0101;&#x915;&#x94d;&zwj;"
+ ><!-- Simple Emoji (a surrogate pair in UTF-16),
+ Complicate Emoji (Woman Superhero: Medium Skin Tone),
+ Kanji with IVS,
+ 2 devanāgarī characters followed by ZWJ -->
+</body>
+</html>
diff --git a/editor/reftests/passwd-7-with-Preview.html b/editor/reftests/passwd-7-with-Preview.html
new file mode 100644
index 0000000000..c101743ce0
--- /dev/null
+++ b/editor/reftests/passwd-7-with-Preview.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="password" value="&#x3042;&#x6f22;&#x0410;&#x0600;&#x0E01;&#xE001;"><!-- original character shouldn't affect the mask's font -->
+</body>
+</html>
diff --git a/editor/reftests/passwd-7-with-TextEditor.html b/editor/reftests/passwd-7-with-TextEditor.html
new file mode 100644
index 0000000000..f2940db625
--- /dev/null
+++ b/editor/reftests/passwd-7-with-TextEditor.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<body onload="document.getElementsByTagName('input')[0].focus();
+ document.getElementsByTagName('input')[0].blur();
+ document.documentElement.removeAttribute('class');">
+ <input type="password" value="&#x3042;&#x6f22;&#x0410;&#x0600;&#x0E01;&#xE001;"><!-- original character shouldn't affect the mask's font -->
+</body>
+</html>
diff --git a/editor/reftests/passwd-8-with-Preview.html b/editor/reftests/passwd-8-with-Preview.html
new file mode 100644
index 0000000000..2cc4ba243e
--- /dev/null
+++ b/editor/reftests/passwd-8-with-Preview.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<body onload="document.getElementsByTagName('input')[0].type = 'password';
+ document.documentElement.removeAttribute('class');">
+ <input type="text" value="abcdef">
+</body>
+</html>
diff --git a/editor/reftests/passwd-8-with-TextEditor.html b/editor/reftests/passwd-8-with-TextEditor.html
new file mode 100644
index 0000000000..d4f9aa7d6f
--- /dev/null
+++ b/editor/reftests/passwd-8-with-TextEditor.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<body onload="document.getElementsByTagName('input')[0].focus();
+ document.getElementsByTagName('input')[0].blur();
+ document.getElementsByTagName('input')[0].type = 'password';
+ document.documentElement.removeAttribute('class');">
+ <input type="text" value="abcdef">
+</body>
+</html>
diff --git a/editor/reftests/passwd-9-with-Preview.html b/editor/reftests/passwd-9-with-Preview.html
new file mode 100644
index 0000000000..528d8f8ac5
--- /dev/null
+++ b/editor/reftests/passwd-9-with-Preview.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<body onload="document.getElementsByTagName('input')[0].focus();
+ document.getElementsByTagName('input')[0].blur();
+ document.getElementsByTagName('input')[0].type = 'text';
+ document.documentElement.removeAttribute('class');">
+ <input type="password" value="abcdef">
+</body>
+</html>
diff --git a/editor/reftests/passwd-9-with-TextEditor.html b/editor/reftests/passwd-9-with-TextEditor.html
new file mode 100644
index 0000000000..d775c44238
--- /dev/null
+++ b/editor/reftests/passwd-9-with-TextEditor.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<body onload="document.getElementsByTagName('input')[0].type = 'text';
+ document.documentElement.removeAttribute('class');">
+ <input type="password" value="abcdef">
+</body>
+</html>
diff --git a/editor/reftests/passwd-ref.html b/editor/reftests/passwd-ref.html
new file mode 100644
index 0000000000..b203fa7d54
--- /dev/null
+++ b/editor/reftests/passwd-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="password" value="abcdef">
+</body>
+</html>
diff --git a/editor/reftests/readonly-editable-ref.html b/editor/reftests/readonly-editable-ref.html
new file mode 100644
index 0000000000..99f1e51017
--- /dev/null
+++ b/editor/reftests/readonly-editable-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input>
+ <input readonly>
+ <input type=password>
+ <input type=password readonly>
+ <input type=email>
+ <input type=email readonly>
+ <textarea></textarea>
+ <textarea readonly></textarea>
+ </body>
+</html>
diff --git a/editor/reftests/readonly-editable.html b/editor/reftests/readonly-editable.html
new file mode 100644
index 0000000000..d2e48f4295
--- /dev/null
+++ b/editor/reftests/readonly-editable.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ :read-write + span {
+ display: none;
+ }
+ span {
+ color: transparent; /* workaround for bug 617524 */
+ outline: 1px solid green;
+ }
+ </style>
+ </head>
+ <body contenteditable>
+ <input><span>hide me</span>
+ <input readonly><span>hide me</span>
+ <input type=password><span>hide me</span>
+ <input type=password readonly><span>hide me</span>
+ <input type=email><span>hide me</span>
+ <input type=email readonly><span>hide me</span>
+ <textarea></textarea><span>hide me</span>
+ <textarea readonly></textarea><span>hide me</span>
+ </body>
+</html>
diff --git a/editor/reftests/readonly-non-editable-ref.html b/editor/reftests/readonly-non-editable-ref.html
new file mode 100644
index 0000000000..a91071e42c
--- /dev/null
+++ b/editor/reftests/readonly-non-editable-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ span {
+ color: transparent; /* workaround for bug 617524 */
+ outline: 1px solid green;
+ }
+ </style>
+ </head>
+ <body>
+ <input><span>hide me</span>
+ <input readonly>
+ <input type=password><span>hide me</span>
+ <input type=password readonly>
+ <input type=email><span>hide me</span>
+ <input type=email readonly>
+ <textarea></textarea><span>hide me</span>
+ <textarea readonly></textarea>
+ </body>
+</html>
diff --git a/editor/reftests/readonly-non-editable.html b/editor/reftests/readonly-non-editable.html
new file mode 100644
index 0000000000..42cd187133
--- /dev/null
+++ b/editor/reftests/readonly-non-editable.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ :read-only + span {
+ display: none;
+ }
+ span {
+ color: transparent; /* workaround for bug 617524 */
+ outline: 1px solid green;
+ }
+ </style>
+ </head>
+ <body>
+ <input><span>hide me</span>
+ <input readonly><span>hide me</span>
+ <input type=password><span>hide me</span>
+ <input type=password readonly><span>hide me</span>
+ <input type=email><span>hide me</span>
+ <input type=email readonly><span>hide me</span>
+ <textarea></textarea><span>hide me</span>
+ <textarea readonly></textarea><span>hide me</span>
+ </body>
+</html>
diff --git a/editor/reftests/readwrite-editable-ref.html b/editor/reftests/readwrite-editable-ref.html
new file mode 100644
index 0000000000..99f1e51017
--- /dev/null
+++ b/editor/reftests/readwrite-editable-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input>
+ <input readonly>
+ <input type=password>
+ <input type=password readonly>
+ <input type=email>
+ <input type=email readonly>
+ <textarea></textarea>
+ <textarea readonly></textarea>
+ </body>
+</html>
diff --git a/editor/reftests/readwrite-editable.html b/editor/reftests/readwrite-editable.html
new file mode 100644
index 0000000000..d2e48f4295
--- /dev/null
+++ b/editor/reftests/readwrite-editable.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ :read-write + span {
+ display: none;
+ }
+ span {
+ color: transparent; /* workaround for bug 617524 */
+ outline: 1px solid green;
+ }
+ </style>
+ </head>
+ <body contenteditable>
+ <input><span>hide me</span>
+ <input readonly><span>hide me</span>
+ <input type=password><span>hide me</span>
+ <input type=password readonly><span>hide me</span>
+ <input type=email><span>hide me</span>
+ <input type=email readonly><span>hide me</span>
+ <textarea></textarea><span>hide me</span>
+ <textarea readonly></textarea><span>hide me</span>
+ </body>
+</html>
diff --git a/editor/reftests/readwrite-non-editable-ref.html b/editor/reftests/readwrite-non-editable-ref.html
new file mode 100644
index 0000000000..12e1c46c0a
--- /dev/null
+++ b/editor/reftests/readwrite-non-editable-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ span {
+ color: transparent; /* workaround for bug 617524 */
+ outline: 1px solid green;
+ }
+ </style>
+ </head>
+ <body>
+ <input>
+ <input readonly><span>hide me</span>
+ <input type=password>
+ <input type=password readonly><span>hide me</span>
+ <input type=email>
+ <input type=email readonly><span>hide me</span>
+ <textarea></textarea>
+ <textarea readonly></textarea><span>hide me</span>
+ </body>
+</html>
diff --git a/editor/reftests/readwrite-non-editable.html b/editor/reftests/readwrite-non-editable.html
new file mode 100644
index 0000000000..fd4807f4f0
--- /dev/null
+++ b/editor/reftests/readwrite-non-editable.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ :read-write + span {
+ display: none;
+ }
+ span {
+ color: transparent; /* workaround for bug 617524 */
+ outline: 1px solid green;
+ }
+ </style>
+ </head>
+ <body>
+ <input><span>hide me</span>
+ <input readonly><span>hide me</span>
+ <input type=password><span>hide me</span>
+ <input type=password readonly><span>hide me</span>
+ <input type=email><span>hide me</span>
+ <input type=email readonly><span>hide me</span>
+ <textarea></textarea><span>hide me</span>
+ <textarea readonly></textarea><span>hide me</span>
+ </body>
+</html>
diff --git a/editor/reftests/reftest.list b/editor/reftests/reftest.list
new file mode 100644
index 0000000000..0424b73c18
--- /dev/null
+++ b/editor/reftests/reftest.list
@@ -0,0 +1,157 @@
+# include the XUL reftests, except on Android which doesn't have XUL.
+skip-if(Android) include xul/reftest.list
+
+!= newline-1.html newline-ref.html
+== newline-2.html newline-ref.html
+== newline-3.html newline-ref.html
+== newline-4.html newline-ref.html
+== dynamic-1.html dynamic-ref.html
+== dynamic-type-1.html dynamic-ref.html
+== dynamic-type-2.html dynamic-ref.html
+== dynamic-type-3.html dynamic-ref.html
+== dynamic-type-4.html dynamic-ref.html
+== passwd-1.html passwd-ref.html
+!= passwd-2.html passwd-ref.html
+== passwd-3.html passwd-ref.html
+needs-focus == passwd-4.html passwd-ref.html
+== passwd-5-with-Preview.html passwd-ref.html
+needs-focus == passwd-5-with-TextEditor.html passwd-ref.html
+== passwd-6-with-Preview.html passwd-6-ref.html
+needs-focus == passwd-6-with-TextEditor.html passwd-6-ref.html
+== passwd-7-with-Preview.html passwd-ref.html
+needs-focus == passwd-7-with-TextEditor.html passwd-ref.html
+== passwd-8-with-Preview.html passwd-ref.html
+needs-focus == passwd-8-with-TextEditor.html passwd-ref.html
+== passwd-9-with-Preview.html passwd-2.html
+needs-focus == passwd-9-with-TextEditor.html passwd-2.html
+== emptypasswd-1.html emptypasswd-ref.html
+== emptypasswd-2.html emptypasswd-ref.html
+== caret_on_positioned.html caret_on_positioned-ref.html
+# Android turns off spellchecker (Bug 1541697)
+skip-if(Android) skip-if(cocoaWidget) needs-focus != spellcheck-input-disabled.html spellcheck-input-ref.html # Bug 1666056
+skip-if(Android) == spellcheck-input-attr-before.html spellcheck-input-nofocus-ref.html
+skip-if(Android) needs-focus != spellcheck-input-attr-before.html spellcheck-input-ref.html
+skip-if(Android) == spellcheck-input-attr-after.html spellcheck-input-nofocus-ref.html
+skip-if(Android) needs-focus != spellcheck-input-attr-after.html spellcheck-input-ref.html
+skip-if(Android) == spellcheck-input-attr-inherit.html spellcheck-input-nofocus-ref.html
+skip-if(Android) needs-focus != spellcheck-input-attr-inherit.html spellcheck-input-ref.html
+skip-if(Android) == spellcheck-input-attr-dynamic.html spellcheck-input-nofocus-ref.html
+skip-if(Android) needs-focus != spellcheck-input-attr-dynamic.html spellcheck-input-ref.html
+skip-if(Android) == spellcheck-input-attr-dynamic-inherit.html spellcheck-input-nofocus-ref.html
+skip-if(Android) needs-focus != spellcheck-input-attr-dynamic-inherit.html spellcheck-input-ref.html
+skip-if(Android) == spellcheck-input-property-dynamic.html spellcheck-input-nofocus-ref.html
+skip-if(Android) needs-focus != spellcheck-input-property-dynamic.html spellcheck-input-ref.html
+skip-if(Android) == spellcheck-input-property-dynamic-inherit.html spellcheck-input-nofocus-ref.html
+skip-if(Android) needs-focus != spellcheck-input-property-dynamic-inherit.html spellcheck-input-ref.html
+skip-if(Android) == spellcheck-input-attr-dynamic-override.html spellcheck-input-nofocus-ref.html
+skip-if(Android) needs-focus != spellcheck-input-attr-dynamic-override.html spellcheck-input-ref.html
+skip-if(Android) == spellcheck-input-attr-dynamic-override-inherit.html spellcheck-input-nofocus-ref.html
+skip-if(Android) needs-focus != spellcheck-input-attr-dynamic-override-inherit.html spellcheck-input-ref.html
+skip-if(Android) == spellcheck-input-property-dynamic-override.html spellcheck-input-nofocus-ref.html
+skip-if(Android) needs-focus != spellcheck-input-property-dynamic-override.html spellcheck-input-ref.html
+skip-if(Android) == spellcheck-input-property-dynamic-override-inherit.html spellcheck-input-nofocus-ref.html
+skip-if(Android) needs-focus != spellcheck-input-property-dynamic-override-inherit.html spellcheck-input-ref.html
+skip-if(Android) == spellcheck-textarea-attr.html spellcheck-textarea-nofocus-ref.html
+skip-if(Android) needs-focus != spellcheck-textarea-attr.html spellcheck-textarea-ref.html
+skip-if(Android) needs-focus == spellcheck-textarea-focused.html spellcheck-textarea-ref.html
+skip-if(Android) needs-focus == spellcheck-textarea-focused-reframe.html spellcheck-textarea-ref.html
+skip-if(Android) needs-focus == spellcheck-textarea-focused-notreadonly.html spellcheck-textarea-ref2.html
+skip-if(Android) needs-focus != spellcheck-textarea-nofocus.html spellcheck-textarea-ref.html
+skip-if(Android) needs-focus != spellcheck-textarea-disabled.html spellcheck-textarea-ref.html
+skip-if(Android) needs-focus != spellcheck-textarea-attr-inherit.html spellcheck-textarea-ref.html
+skip-if(Android) needs-focus != spellcheck-textarea-attr-dynamic.html spellcheck-textarea-ref.html
+skip-if(Android) needs-focus != spellcheck-textarea-attr-dynamic-inherit.html spellcheck-textarea-ref.html
+skip-if(Android) needs-focus != spellcheck-textarea-property-dynamic.html spellcheck-textarea-ref.html
+skip-if(Android) needs-focus != spellcheck-textarea-property-dynamic-inherit.html spellcheck-textarea-ref.html
+skip-if(Android) needs-focus != spellcheck-textarea-attr-dynamic-override.html spellcheck-textarea-ref.html
+skip-if(Android) needs-focus != spellcheck-textarea-attr-dynamic-override-inherit.html spellcheck-textarea-ref.html
+skip-if(Android) needs-focus != spellcheck-textarea-property-dynamic-override.html spellcheck-textarea-ref.html
+skip-if(Android) needs-focus != spellcheck-textarea-property-dynamic-override-inherit.html spellcheck-textarea-ref.html
+needs-focus == caret_on_focus.html caret_on_focus-ref.html
+needs-focus fails-if(useDrawSnapshot) != caret_on_textarea_lastline.html caret_on_textarea_lastline-ref.html
+fuzzy-if(Android,0-1,0-1) needs-focus == input-text-onfocus-reframe.html input-text-onfocus-reframe-ref.html
+fuzzy(0-5,0-1) needs-focus == input-text-notheme-onfocus-reframe.html input-text-notheme-onfocus-reframe-ref.html
+needs-focus == caret_after_reframe.html caret_after_reframe-ref.html
+== nobogusnode-1.html nobogusnode-ref.html
+== nobogusnode-2.html nobogusnode-ref.html
+# Android turns off spellchecker (Bug 1541697)
+skip-if(Android) fuzzy(0-3,0-1) == spellcheck-hyphen-valid.html spellcheck-hyphen-valid-ref.html
+skip-if(Android) needs-focus != spellcheck-hyphen-invalid.html spellcheck-hyphen-invalid-ref.html
+skip-if(Android) == spellcheck-slash-valid.html spellcheck-slash-valid-ref.html
+skip-if(Android) == spellcheck-period-valid.html spellcheck-period-valid-ref.html
+skip-if(Android) == spellcheck-space-valid.html spellcheck-space-valid-ref.html
+skip-if(Android) == spellcheck-comma-valid.html spellcheck-comma-valid-ref.html
+skip-if(Android) == spellcheck-hyphen-multiple-valid.html spellcheck-hyphen-multiple-valid-ref.html
+skip-if(Android) needs-focus != spellcheck-hyphen-multiple-invalid.html spellcheck-hyphen-multiple-invalid-ref.html
+skip-if(Android) == spellcheck-dotafterquote-valid.html spellcheck-dotafterquote-valid-ref.html
+skip-if(Android) == spellcheck-url-valid.html spellcheck-url-valid-ref.html
+skip-if(Android) fuzzy(0-32,0-1) needs-focus == spellcheck-non-latin-arabic.html spellcheck-non-latin-arabic-ref.html
+skip-if(Android) needs-focus == spellcheck-non-latin-chinese-simplified.html spellcheck-non-latin-chinese-simplified-ref.html
+skip-if(Android) needs-focus == spellcheck-non-latin-chinese-traditional.html spellcheck-non-latin-chinese-traditional-ref.html
+skip-if(Android) needs-focus == spellcheck-non-latin-hebrew.html spellcheck-non-latin-hebrew-ref.html
+skip-if(Android) needs-focus == spellcheck-non-latin-japanese.html spellcheck-non-latin-japanese-ref.html
+skip-if(Android) fuzzy(0-3,0-1) needs-focus == spellcheck-non-latin-korean.html spellcheck-non-latin-korean-ref.html
+== unneeded_scroll.html unneeded_scroll-ref.html
+== caret_on_presshell_reinit.html caret_on_presshell_reinit-ref.html
+fuzzy-if(browserIsRemote,0-255,0-3) asserts-if(browserIsRemote,0-3) == caret_on_presshell_reinit-2.html caret_on_presshell_reinit-ref.html # bug 959132 for assertions
+fuzzy-if(asyncPan&&!layersGPUAccelerated,0-102,0-2824) == 642800.html 642800-ref.html
+needs-focus == selection_visibility_after_reframe.html selection_visibility_after_reframe-ref.html
+needs-focus != selection_visibility_after_reframe-2.html selection_visibility_after_reframe-ref.html
+needs-focus != selection_visibility_after_reframe-3.html selection_visibility_after_reframe-ref.html
+== 672709.html 672709-ref.html
+== 338427-1.html 338427-1-ref.html
+needs-focus == 674212-spellcheck.html 674212-spellcheck-ref.html
+needs-focus == 338427-2.html 338427-2-ref.html
+needs-focus == 338427-3.html 338427-3-ref.html
+needs-focus == 462758-grabbers-resizers.html 462758-grabbers-resizers-ref.html
+== readwrite-non-editable.html readwrite-non-editable-ref.html
+== readwrite-editable.html readwrite-editable-ref.html
+== readonly-non-editable.html readonly-non-editable-ref.html
+== readonly-editable.html readonly-editable-ref.html
+== dynamic-overflow-change.html dynamic-overflow-change-ref.html
+== 694880-1.html 694880-ref.html
+== 694880-2.html 694880-ref.html
+== 694880-3.html 694880-ref.html
+== 388980-1.html 388980-1-ref.html
+# Android turns off spellchecker (Bug 1541697)
+skip-if(Android) needs-focus == spellcheck-superscript-1.html spellcheck-superscript-1-ref.html
+skip-if(Android) needs-focus != spellcheck-superscript-2.html spellcheck-superscript-2-ref.html
+fuzzy(0-1,0-3400) needs-focus pref(layout.accessiblecaret.enabled,false) pref(layout.accessiblecaret.enabled_on_touch,false) == 824080-1.html 824080-1-ref.html
+fuzzy-if(OSX,0-1,0-1) needs-focus pref(layout.accessiblecaret.enabled,false) pref(layout.accessiblecaret.enabled_on_touch,false) == 824080-2.html 824080-2-ref.html #Bug 1313253
+fuzzy-if(OSX,0-1,0-1) needs-focus pref(layout.accessiblecaret.enabled,false) pref(layout.accessiblecaret.enabled_on_touch,false) == 824080-3.html 824080-3-ref.html #Bug 1312951
+needs-focus != 824080-2.html 824080-3.html
+fuzzy(0-1,0-3200) needs-focus pref(layout.accessiblecaret.enabled,false) pref(layout.accessiblecaret.enabled_on_touch,false) == 824080-4.html 824080-4-ref.html
+fuzzy(0-2,0-1800) needs-focus pref(layout.accessiblecaret.enabled,false) pref(layout.accessiblecaret.enabled_on_touch,false) == 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 pref(layout.accessiblecaret.enabled,false) pref(layout.accessiblecaret.enabled_on_touch,false) == 824080-7.html 824080-7-ref.html
+needs-focus != 824080-6.html 824080-7.html
+# Android turns off spell checker (Bug 1541697)
+# Bug 674927: copy spellcheck-textarea tests to contenteditable
+skip-if(Android) == spellcheck-contenteditable-attr.html spellcheck-contenteditable-nofocus-ref.html
+skip-if(Android) needs-focus != spellcheck-contenteditable-attr.html spellcheck-contenteditable-ref.html
+skip-if(Android) needs-focus == spellcheck-contenteditable-focused.html spellcheck-contenteditable-ref.html
+skip-if(Android) needs-focus == spellcheck-contenteditable-focused-reframe.html spellcheck-contenteditable-ref.html
+skip-if(Android) == spellcheck-contenteditable-nofocus-1.html spellcheck-contenteditable-disabled-ref.html
+skip-if(Android) == spellcheck-contenteditable-nofocus-2.html spellcheck-contenteditable-disabled-ref.html
+skip-if(Android) == spellcheck-contenteditable-disabled.html spellcheck-contenteditable-disabled-ref.html
+skip-if(Android) == spellcheck-contenteditable-disabled-partial.html spellcheck-contenteditable-disabled-partial-ref.html
+skip-if(Android) == spellcheck-contenteditable-attr-inherit.html spellcheck-contenteditable-disabled-ref.html
+skip-if(Android) == spellcheck-contenteditable-attr-dynamic.html spellcheck-contenteditable-disabled-ref.html
+skip-if(Android) == spellcheck-contenteditable-attr-dynamic-inherit.html spellcheck-contenteditable-disabled-ref.html
+skip-if(Android) == spellcheck-contenteditable-property-dynamic.html spellcheck-contenteditable-disabled-ref.html
+skip-if(Android) == spellcheck-contenteditable-property-dynamic-inherit.html spellcheck-contenteditable-disabled-ref.html
+skip-if(Android) == spellcheck-contenteditable-attr-dynamic-override.html spellcheck-contenteditable-disabled-ref.html
+skip-if(Android) == spellcheck-contenteditable-attr-dynamic-override-inherit.html spellcheck-contenteditable-disabled-ref.html
+skip-if(Android) == spellcheck-contenteditable-property-dynamic-override.html spellcheck-contenteditable-disabled-ref.html
+skip-if(Android) == spellcheck-contenteditable-property-dynamic-override-inherit.html spellcheck-contenteditable-disabled-ref.html
+== 911201.html 911201-ref.html
+needs-focus == 969773.html 969773-ref.html
+fuzzy(0-1,0-220) == 997805.html 997805-ref.html
+fuzzy(0-1,0-220) == 1088158.html 1088158-ref.html
+fuzzy-if(Android,0-1,0-1) needs-focus == 1443902-1.html 1443902-1-ref.html
+fuzzy-if(Android,0-1,0-1) needs-focus == 1443902-2.html 1443902-2-ref.html
+fuzzy-if(Android,0-1,0-1) needs-focus == 1443902-3.html 1443902-3-ref.html
+fuzzy-if(Android,0-1,0-1) needs-focus == 1443902-4.html 1443902-4-ref.html
+== exec-command-indent-ws.html exec-command-indent-ws-ref.html
+needs-focus == inline-table-editor-position-after-updating-table-size-from-input-event-listener.html inline-table-editor-position-after-updating-table-size-from-input-event-listener-ref.html
diff --git a/editor/reftests/selection_visibility_after_reframe-2.html b/editor/reftests/selection_visibility_after_reframe-2.html
new file mode 100644
index 0000000000..579bbedd88
--- /dev/null
+++ b/editor/reftests/selection_visibility_after_reframe-2.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input value="foo">
+ <script>
+ var i = document.querySelector("input");
+ i.focus();
+ i.selectionStart = 1;
+ i.selectionEnd = 2;
+ </script>
+ </body>
+</html>
diff --git a/editor/reftests/selection_visibility_after_reframe-3.html b/editor/reftests/selection_visibility_after_reframe-3.html
new file mode 100644
index 0000000000..1a816a88cc
--- /dev/null
+++ b/editor/reftests/selection_visibility_after_reframe-3.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input value="foo">
+ <script>
+ var i = document.querySelector("input");
+ i.focus();
+ i.selectionStart = 1;
+ i.selectionEnd = 2;
+ i.style.display = "none";
+ document.body.clientHeight;
+ i.style.display = "";
+ </script>
+ </body>
+</html>
diff --git a/editor/reftests/selection_visibility_after_reframe-ref.html b/editor/reftests/selection_visibility_after_reframe-ref.html
new file mode 100644
index 0000000000..c227b39c8f
--- /dev/null
+++ b/editor/reftests/selection_visibility_after_reframe-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input value="foo">
+ </body>
+</html>
diff --git a/editor/reftests/selection_visibility_after_reframe.html b/editor/reftests/selection_visibility_after_reframe.html
new file mode 100644
index 0000000000..b72cec8296
--- /dev/null
+++ b/editor/reftests/selection_visibility_after_reframe.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input value="foo">
+ <script>
+ var i = document.querySelector("input");
+ i.selectionStart = 1;
+ i.selectionEnd = 2;
+ document.body.clientHeight;
+ i.style.display = "none";
+ document.body.clientHeight;
+ i.style.display = "";
+ </script>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-comma-valid-ref.html b/editor/reftests/spellcheck-comma-valid-ref.html
new file mode 100644
index 0000000000..d5856e06fb
--- /dev/null
+++ b/editor/reftests/spellcheck-comma-valid-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus spellcheck="false">good,nice</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-comma-valid.html b/editor/reftests/spellcheck-comma-valid.html
new file mode 100644
index 0000000000..768cdbcf2c
--- /dev/null
+++ b/editor/reftests/spellcheck-comma-valid.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus>good,nice</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-contenteditable-attr-dynamic-inherit.html b/editor/reftests/spellcheck-contenteditable-attr-dynamic-inherit.html
new file mode 100644
index 0000000000..aa4e47c2ca
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-attr-dynamic-override-inherit.html b/editor/reftests/spellcheck-contenteditable-attr-dynamic-override-inherit.html
new file mode 100644
index 0000000000..1b4a0ab3b9
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-attr-dynamic-override.html b/editor/reftests/spellcheck-contenteditable-attr-dynamic-override.html
new file mode 100644
index 0000000000..e3a4d90772
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-attr-dynamic.html b/editor/reftests/spellcheck-contenteditable-attr-dynamic.html
new file mode 100644
index 0000000000..37ba9f6514
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-attr-inherit.html b/editor/reftests/spellcheck-contenteditable-attr-inherit.html
new file mode 100644
index 0000000000..6cbfcb3da3
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-attr.html b/editor/reftests/spellcheck-contenteditable-attr.html
new file mode 100644
index 0000000000..df119a9975
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-attr.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <div contenteditable>blahblahblah</div>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-contenteditable-disabled-partial-ref.html b/editor/reftests/spellcheck-contenteditable-disabled-partial-ref.html
new file mode 100644
index 0000000000..30fe7a6bf9
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-disabled-partial.html b/editor/reftests/spellcheck-contenteditable-disabled-partial.html
new file mode 100644
index 0000000000..c7b6c427c4
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-disabled-ref.html b/editor/reftests/spellcheck-contenteditable-disabled-ref.html
new file mode 100644
index 0000000000..23571fa5e8
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-disabled-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <div>blahblahblah</div>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-contenteditable-disabled.html b/editor/reftests/spellcheck-contenteditable-disabled.html
new file mode 100644
index 0000000000..3794f5767c
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-focused-reframe.html b/editor/reftests/spellcheck-contenteditable-focused-reframe.html
new file mode 100644
index 0000000000..733ee05bb3
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-focused.html b/editor/reftests/spellcheck-contenteditable-focused.html
new file mode 100644
index 0000000000..8086673997
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-nofocus-1.html b/editor/reftests/spellcheck-contenteditable-nofocus-1.html
new file mode 100644
index 0000000000..7e88dc3e18
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-nofocus-1.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <div contenteditable>blahblahblah</div>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-contenteditable-nofocus-2.html b/editor/reftests/spellcheck-contenteditable-nofocus-2.html
new file mode 100644
index 0000000000..fd7cdb8827
--- /dev/null
+++ b/editor/reftests/spellcheck-contenteditable-nofocus-2.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<html><body><div contenteditable>blahblahblah</div></body></html> \ No newline at end of file
diff --git a/editor/reftests/spellcheck-contenteditable-nofocus-ref.html b/editor/reftests/spellcheck-contenteditable-nofocus-ref.html
new file mode 100644
index 0000000000..67241fb7f1
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-property-dynamic-inherit.html b/editor/reftests/spellcheck-contenteditable-property-dynamic-inherit.html
new file mode 100644
index 0000000000..feb623dbb6
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-property-dynamic-override-inherit.html b/editor/reftests/spellcheck-contenteditable-property-dynamic-override-inherit.html
new file mode 100644
index 0000000000..26c5a42236
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-property-dynamic-override.html b/editor/reftests/spellcheck-contenteditable-property-dynamic-override.html
new file mode 100644
index 0000000000..dd16894b89
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-property-dynamic.html b/editor/reftests/spellcheck-contenteditable-property-dynamic.html
new file mode 100644
index 0000000000..eaf2db29a6
--- /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>
diff --git a/editor/reftests/spellcheck-contenteditable-ref.html b/editor/reftests/spellcheck-contenteditable-ref.html
new file mode 100644
index 0000000000..d28dbcf96b
--- /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>
diff --git a/editor/reftests/spellcheck-dotafterquote-valid-ref.html b/editor/reftests/spellcheck-dotafterquote-valid-ref.html
new file mode 100644
index 0000000000..b61904400b
--- /dev/null
+++ b/editor/reftests/spellcheck-dotafterquote-valid-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus spellcheck="false">'Apple'.</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-dotafterquote-valid.html b/editor/reftests/spellcheck-dotafterquote-valid.html
new file mode 100644
index 0000000000..1d3a605bb0
--- /dev/null
+++ b/editor/reftests/spellcheck-dotafterquote-valid.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus>'Apple'.</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-hyphen-invalid-ref.html b/editor/reftests/spellcheck-hyphen-invalid-ref.html
new file mode 100644
index 0000000000..856fd840ec
--- /dev/null
+++ b/editor/reftests/spellcheck-hyphen-invalid-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus spellcheck="false">dddf-gggy</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-hyphen-invalid.html b/editor/reftests/spellcheck-hyphen-invalid.html
new file mode 100644
index 0000000000..bc4e4e240b
--- /dev/null
+++ b/editor/reftests/spellcheck-hyphen-invalid.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus>dddf-gggy</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-hyphen-multiple-invalid-ref.html b/editor/reftests/spellcheck-hyphen-multiple-invalid-ref.html
new file mode 100644
index 0000000000..ab4cbd05a5
--- /dev/null
+++ b/editor/reftests/spellcheck-hyphen-multiple-invalid-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea style="width: 400px; height: 200px;" autofocus spellcheck="false">-hlloe hlloe- --hlloe --hlloe ---hlloe hlloe--- ---hlloe----</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-hyphen-multiple-invalid.html b/editor/reftests/spellcheck-hyphen-multiple-invalid.html
new file mode 100644
index 0000000000..bcc3f71133
--- /dev/null
+++ b/editor/reftests/spellcheck-hyphen-multiple-invalid.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea style="width: 400px; height: 200px;" autofocus>-hlloe hlloe- --hlloe --hlloe ---hlloe hlloe--- ---hlloe----</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-hyphen-multiple-valid-ref.html b/editor/reftests/spellcheck-hyphen-multiple-valid-ref.html
new file mode 100644
index 0000000000..324a566c49
--- /dev/null
+++ b/editor/reftests/spellcheck-hyphen-multiple-valid-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea style="width: 400px; height: 200px;" autofocus spellcheck="false">- -- --- -hello hello- --hello --hello ---hello hello--- ---hello----</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-hyphen-multiple-valid.html b/editor/reftests/spellcheck-hyphen-multiple-valid.html
new file mode 100644
index 0000000000..7f0ce681cb
--- /dev/null
+++ b/editor/reftests/spellcheck-hyphen-multiple-valid.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea style="width: 400px; height: 200px;" autofocus>- -- --- -hello hello- --hello --hello ---hello hello--- ---hello----</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-hyphen-valid-ref.html b/editor/reftests/spellcheck-hyphen-valid-ref.html
new file mode 100644
index 0000000000..73b507a3dc
--- /dev/null
+++ b/editor/reftests/spellcheck-hyphen-valid-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus spellcheck="false">scot-free</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-hyphen-valid.html b/editor/reftests/spellcheck-hyphen-valid.html
new file mode 100644
index 0000000000..2b56a6e24c
--- /dev/null
+++ b/editor/reftests/spellcheck-hyphen-valid.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus>scot-free</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-input-attr-after.html b/editor/reftests/spellcheck-input-attr-after.html
new file mode 100644
index 0000000000..1e878b5d15
--- /dev/null
+++ b/editor/reftests/spellcheck-input-attr-after.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="text" value="blahblahblah" spellcheck="true">
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-input-attr-before.html b/editor/reftests/spellcheck-input-attr-before.html
new file mode 100644
index 0000000000..8456e6c8cd
--- /dev/null
+++ b/editor/reftests/spellcheck-input-attr-before.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="text" spellcheck="true" value="blahblahblah">
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-input-attr-dynamic-inherit.html b/editor/reftests/spellcheck-input-attr-dynamic-inherit.html
new file mode 100644
index 0000000000..c87be7c3e3
--- /dev/null
+++ b/editor/reftests/spellcheck-input-attr-dynamic-inherit.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+ <input class="spell-checked" type="text" value="blahblahblah">
+ <script>
+ function init() {
+ document.body.setAttribute("spellcheck", "true");
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-input-attr-dynamic-override-inherit.html b/editor/reftests/spellcheck-input-attr-dynamic-override-inherit.html
new file mode 100644
index 0000000000..d7d12b78da
--- /dev/null
+++ b/editor/reftests/spellcheck-input-attr-dynamic-override-inherit.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()" spellcheck="false">
+ <input class="spell-checked" type="text" value="blahblahblah">
+ <script>
+ function init() {
+ document.body.setAttribute("spellcheck", "true");
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-input-attr-dynamic-override.html b/editor/reftests/spellcheck-input-attr-dynamic-override.html
new file mode 100644
index 0000000000..0f6095bd07
--- /dev/null
+++ b/editor/reftests/spellcheck-input-attr-dynamic-override.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+ <input class="spell-checked" type="text" spellcheck="false" value="blahblahblah">
+ <script>
+ function init() {
+ document.querySelector("input").setAttribute("spellcheck", "true");
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-input-attr-dynamic.html b/editor/reftests/spellcheck-input-attr-dynamic.html
new file mode 100644
index 0000000000..27c8281faf
--- /dev/null
+++ b/editor/reftests/spellcheck-input-attr-dynamic.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+ <input class="spell-checked" type="text" value="blahblahblah">
+ <script>
+ function init() {
+ document.querySelector("input").setAttribute("spellcheck", "true");
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-input-attr-inherit.html b/editor/reftests/spellcheck-input-attr-inherit.html
new file mode 100644
index 0000000000..c851bd189c
--- /dev/null
+++ b/editor/reftests/spellcheck-input-attr-inherit.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <span spellcheck="true"><input class="spell-checked" type="text" value="blahblahblah"></span>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-input-disabled.html b/editor/reftests/spellcheck-input-disabled.html
new file mode 100644
index 0000000000..f3b2f2ba97
--- /dev/null
+++ b/editor/reftests/spellcheck-input-disabled.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="text" value="blahblahblah">
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-input-nofocus-ref.html b/editor/reftests/spellcheck-input-nofocus-ref.html
new file mode 100644
index 0000000000..1e878b5d15
--- /dev/null
+++ b/editor/reftests/spellcheck-input-nofocus-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <input type="text" value="blahblahblah" spellcheck="true">
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-input-property-dynamic-inherit.html b/editor/reftests/spellcheck-input-property-dynamic-inherit.html
new file mode 100644
index 0000000000..1cf839baee
--- /dev/null
+++ b/editor/reftests/spellcheck-input-property-dynamic-inherit.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+ <input class="spell-checked" type="text" value="blahblahblah">
+ <script>
+ function init() {
+ document.body.spellcheck = true;
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-input-property-dynamic-override-inherit.html b/editor/reftests/spellcheck-input-property-dynamic-override-inherit.html
new file mode 100644
index 0000000000..eb380dc960
--- /dev/null
+++ b/editor/reftests/spellcheck-input-property-dynamic-override-inherit.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()" spellcheck="false">
+ <input class="spell-checked" type="text" value="blahblahblah">
+ <script>
+ function init() {
+ document.body.spellcheck = true;
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-input-property-dynamic-override.html b/editor/reftests/spellcheck-input-property-dynamic-override.html
new file mode 100644
index 0000000000..fad2fb3ed4
--- /dev/null
+++ b/editor/reftests/spellcheck-input-property-dynamic-override.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+ <input class="spell-checked" type="text" spellcheck="false" value="blahblahblah">
+ <script>
+ function init() {
+ document.querySelector("input").spellcheck = true;
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-input-property-dynamic.html b/editor/reftests/spellcheck-input-property-dynamic.html
new file mode 100644
index 0000000000..dd59ec6ea7
--- /dev/null
+++ b/editor/reftests/spellcheck-input-property-dynamic.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+ <input class="spell-checked" type="text" value="blahblahblah">
+ <script>
+ function init() {
+ document.querySelector("input").spellcheck = true;
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-input-ref.html b/editor/reftests/spellcheck-input-ref.html
new file mode 100644
index 0000000000..2c2e48d6b6
--- /dev/null
+++ b/editor/reftests/spellcheck-input-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<body>
+ <input type="text" value="blahblahblah" spellcheck="true">
+ <script>
+ var i = document.getElementsByTagName("input")[0];
+ i.focus(); // init the editor
+ i.blur(); // we actually don't need the focus
+
+ // Try to ensure the input element is repainted.
+ let rAFCounter = 0;
+ requestIdleCallback(function rAF() {
+ if (rAFCounter < 10) {
+ ++rAFCounter;
+ requestAnimationFrame(rAF);
+ } else {
+ document.documentElement.removeAttribute("class");
+ }
+ });
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-non-latin-arabic-ref.html b/editor/reftests/spellcheck-non-latin-arabic-ref.html
new file mode 100644
index 0000000000..67850b46cb
--- /dev/null
+++ b/editor/reftests/spellcheck-non-latin-arabic-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <textarea autofocus spellcheck="false">سلام</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-non-latin-arabic.html b/editor/reftests/spellcheck-non-latin-arabic.html
new file mode 100644
index 0000000000..fbbe193889
--- /dev/null
+++ b/editor/reftests/spellcheck-non-latin-arabic.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <textarea autofocus>سلام</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-non-latin-chinese-simplified-ref.html b/editor/reftests/spellcheck-non-latin-chinese-simplified-ref.html
new file mode 100644
index 0000000000..83ad79c265
--- /dev/null
+++ b/editor/reftests/spellcheck-non-latin-chinese-simplified-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <textarea autofocus spellcheck="false">你好</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-non-latin-chinese-simplified.html b/editor/reftests/spellcheck-non-latin-chinese-simplified.html
new file mode 100644
index 0000000000..8db16489a9
--- /dev/null
+++ b/editor/reftests/spellcheck-non-latin-chinese-simplified.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <textarea autofocus>你好</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-non-latin-chinese-traditional-ref.html b/editor/reftests/spellcheck-non-latin-chinese-traditional-ref.html
new file mode 100644
index 0000000000..83ad79c265
--- /dev/null
+++ b/editor/reftests/spellcheck-non-latin-chinese-traditional-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <textarea autofocus spellcheck="false">你好</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-non-latin-chinese-traditional.html b/editor/reftests/spellcheck-non-latin-chinese-traditional.html
new file mode 100644
index 0000000000..8db16489a9
--- /dev/null
+++ b/editor/reftests/spellcheck-non-latin-chinese-traditional.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <textarea autofocus>你好</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-non-latin-hebrew-ref.html b/editor/reftests/spellcheck-non-latin-hebrew-ref.html
new file mode 100644
index 0000000000..e2bd7c6d2c
--- /dev/null
+++ b/editor/reftests/spellcheck-non-latin-hebrew-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <textarea autofocus spellcheck="false">שלום</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-non-latin-hebrew.html b/editor/reftests/spellcheck-non-latin-hebrew.html
new file mode 100644
index 0000000000..9372c4e9a2
--- /dev/null
+++ b/editor/reftests/spellcheck-non-latin-hebrew.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <textarea autofocus>שלום</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-non-latin-japanese-ref.html b/editor/reftests/spellcheck-non-latin-japanese-ref.html
new file mode 100644
index 0000000000..a978cd3cef
--- /dev/null
+++ b/editor/reftests/spellcheck-non-latin-japanese-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <textarea autofocus spellcheck="false">こんにちは</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-non-latin-japanese.html b/editor/reftests/spellcheck-non-latin-japanese.html
new file mode 100644
index 0000000000..d79bb0e5ea
--- /dev/null
+++ b/editor/reftests/spellcheck-non-latin-japanese.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <textarea autofocus>こんにちは</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-non-latin-korean-ref.html b/editor/reftests/spellcheck-non-latin-korean-ref.html
new file mode 100644
index 0000000000..53d1909f38
--- /dev/null
+++ b/editor/reftests/spellcheck-non-latin-korean-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <textarea autofocus spellcheck="false">안녕하세요</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-non-latin-korean.html b/editor/reftests/spellcheck-non-latin-korean.html
new file mode 100644
index 0000000000..f0f65e82e3
--- /dev/null
+++ b/editor/reftests/spellcheck-non-latin-korean.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body>
+ <textarea autofocus>안녕하세요</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-period-valid-ref.html b/editor/reftests/spellcheck-period-valid-ref.html
new file mode 100644
index 0000000000..5ee87992b6
--- /dev/null
+++ b/editor/reftests/spellcheck-period-valid-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus spellcheck="false">good.nice</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-period-valid.html b/editor/reftests/spellcheck-period-valid.html
new file mode 100644
index 0000000000..aaa5aa4686
--- /dev/null
+++ b/editor/reftests/spellcheck-period-valid.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus>good.nice</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-slash-valid-ref.html b/editor/reftests/spellcheck-slash-valid-ref.html
new file mode 100644
index 0000000000..fddc032525
--- /dev/null
+++ b/editor/reftests/spellcheck-slash-valid-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus spellcheck="false">good/nice</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-slash-valid.html b/editor/reftests/spellcheck-slash-valid.html
new file mode 100644
index 0000000000..37e8d1bf4c
--- /dev/null
+++ b/editor/reftests/spellcheck-slash-valid.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus>good/nice</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-space-valid-ref.html b/editor/reftests/spellcheck-space-valid-ref.html
new file mode 100644
index 0000000000..9fea33e961
--- /dev/null
+++ b/editor/reftests/spellcheck-space-valid-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus spellcheck="false">good nice</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-space-valid.html b/editor/reftests/spellcheck-space-valid.html
new file mode 100644
index 0000000000..575426d470
--- /dev/null
+++ b/editor/reftests/spellcheck-space-valid.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus>good nice</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-superscript-1-ref.html b/editor/reftests/spellcheck-superscript-1-ref.html
new file mode 100644
index 0000000000..35df20d70b
--- /dev/null
+++ b/editor/reftests/spellcheck-superscript-1-ref.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<textarea spellcheck=false>&sup1; &sup2; &sup3;</textarea>
+<script>document.body.firstChild.focus()</script>
diff --git a/editor/reftests/spellcheck-superscript-1.html b/editor/reftests/spellcheck-superscript-1.html
new file mode 100644
index 0000000000..b7b317295a
--- /dev/null
+++ b/editor/reftests/spellcheck-superscript-1.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<textarea>&sup1; &sup2; &sup3;</textarea>
+<script>document.body.firstChild.focus()</script>
diff --git a/editor/reftests/spellcheck-superscript-2-ref.html b/editor/reftests/spellcheck-superscript-2-ref.html
new file mode 100644
index 0000000000..19276bd71a
--- /dev/null
+++ b/editor/reftests/spellcheck-superscript-2-ref.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<textarea>&sup1; &sup2; &sup3; mispeled</textarea>
+<script>document.body.firstChild.focus()</script>
diff --git a/editor/reftests/spellcheck-superscript-2.html b/editor/reftests/spellcheck-superscript-2.html
new file mode 100644
index 0000000000..350d2bc8cf
--- /dev/null
+++ b/editor/reftests/spellcheck-superscript-2.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<textarea spellcheck=false>&sup1; &sup2; &sup3; mispeled</textarea>
+<script>document.body.firstChild.focus()</script>
diff --git a/editor/reftests/spellcheck-textarea-attr-dynamic-inherit.html b/editor/reftests/spellcheck-textarea-attr-dynamic-inherit.html
new file mode 100644
index 0000000000..a4a938494b
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-attr-dynamic-inherit.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+ <textarea>blahblahblah</textarea>
+ <script>
+ function init() {
+ document.body.setAttribute("spellcheck", "false");
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-attr-dynamic-override-inherit.html b/editor/reftests/spellcheck-textarea-attr-dynamic-override-inherit.html
new file mode 100644
index 0000000000..a6ae716b5a
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-attr-dynamic-override-inherit.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()" spellcheck="true">
+ <textarea>blahblahblah</textarea>
+ <script>
+ function init() {
+ document.body.setAttribute("spellcheck", "false");
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-attr-dynamic-override.html b/editor/reftests/spellcheck-textarea-attr-dynamic-override.html
new file mode 100644
index 0000000000..96e9566081
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-attr-dynamic-override.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+ <textarea spellcheck="true">blahblahblah</textarea>
+ <script>
+ function init() {
+ document.querySelector("textarea").setAttribute("spellcheck", "false");
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-attr-dynamic.html b/editor/reftests/spellcheck-textarea-attr-dynamic.html
new file mode 100644
index 0000000000..745e66c7c8
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-attr-dynamic.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+ <textarea>blahblahblah</textarea>
+ <script>
+ function init() {
+ document.querySelector("textarea").setAttribute("spellcheck", "false");
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-attr-inherit.html b/editor/reftests/spellcheck-textarea-attr-inherit.html
new file mode 100644
index 0000000000..c261fec5a4
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-attr-inherit.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <span spellcheck="false"><textarea>blahblahblah</textarea></span>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-attr.html b/editor/reftests/spellcheck-textarea-attr.html
new file mode 100644
index 0000000000..223f948dc3
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-attr.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <textarea>blahblahblah</textarea>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-disabled.html b/editor/reftests/spellcheck-textarea-disabled.html
new file mode 100644
index 0000000000..cfaf3ed53d
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-disabled.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <textarea spellcheck="false">blahblahblah</textarea>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-focused-notreadonly.html b/editor/reftests/spellcheck-textarea-focused-notreadonly.html
new file mode 100644
index 0000000000..475ae60020
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-focused-notreadonly.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<body>
+
+ <textarea id="testBox" style="padding:2px;" readonly></textarea>
+ <script type="text/javascript">
+ //Adding focus to the textbox should trigger a spellcheck
+ var textbox = document.getElementById("testBox");
+ addEventListener("load", function() {
+ textbox.readOnly = false;
+ textbox.focus();
+ textbox.value = "blahblahblah";
+ textbox.selectionStart = textbox.selectionEnd = 0;
+ textbox.blur();
+ }, false);
+ </script>
+
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-focused-reframe.html b/editor/reftests/spellcheck-textarea-focused-reframe.html
new file mode 100644
index 0000000000..6e6f871dda
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-focused-reframe.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<body>
+
+ <textarea id="testBox" onfocus="reframe(this);">blahblahblah</textarea>
+ <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>
diff --git a/editor/reftests/spellcheck-textarea-focused.html b/editor/reftests/spellcheck-textarea-focused.html
new file mode 100644
index 0000000000..04d689cc1a
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-focused.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<body>
+
+ <textarea id="testBox">blahblahblah</textarea>
+ <script type="text/javascript">
+ //Adding focus to the textbox should trigger a spellcheck
+ document.getElementById("testBox").focus();
+ document.getElementById("testBox").blur();
+ </script>
+
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-nofocus-ref.html b/editor/reftests/spellcheck-textarea-nofocus-ref.html
new file mode 100644
index 0000000000..8d993983eb
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-nofocus-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <textarea spellcheck="true">blahblahblah</textarea>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-nofocus.html b/editor/reftests/spellcheck-textarea-nofocus.html
new file mode 100644
index 0000000000..a1ce1a0a98
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-nofocus.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <textarea>blahblahblah</textarea>
+</body>
+</html> \ No newline at end of file
diff --git a/editor/reftests/spellcheck-textarea-property-dynamic-inherit.html b/editor/reftests/spellcheck-textarea-property-dynamic-inherit.html
new file mode 100644
index 0000000000..125f578bf9
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-property-dynamic-inherit.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+ <textarea>blahblahblah</textarea>
+ <script>
+ function init() {
+ document.body.spellcheck = false;
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-property-dynamic-override-inherit.html b/editor/reftests/spellcheck-textarea-property-dynamic-override-inherit.html
new file mode 100644
index 0000000000..0e773646e4
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-property-dynamic-override-inherit.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()" spellcheck="true">
+ <textarea>blahblahblah</textarea>
+ <script>
+ function init() {
+ document.body.spellcheck = false;
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-property-dynamic-override.html b/editor/reftests/spellcheck-textarea-property-dynamic-override.html
new file mode 100644
index 0000000000..f929d3bec9
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-property-dynamic-override.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+ <textarea spellcheck="true">blahblahblah</textarea>
+ <script>
+ function init() {
+ document.querySelector("textarea").spellcheck = false;
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-property-dynamic.html b/editor/reftests/spellcheck-textarea-property-dynamic.html
new file mode 100644
index 0000000000..d0c94f68e8
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-property-dynamic.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="init()">
+ <textarea>blahblahblah</textarea>
+ <script>
+ function init() {
+ document.querySelector("textarea").spellcheck = false;
+ }
+ </script>
+</body>
+</html>
diff --git a/editor/reftests/spellcheck-textarea-ref.html b/editor/reftests/spellcheck-textarea-ref.html
new file mode 100644
index 0000000000..91ecd1d8e9
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <textarea spellcheck="true">blahblahblah</textarea>
+ <script type="text/javascript">
+ var box = document.getElementsByTagName("textarea")[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>
diff --git a/editor/reftests/spellcheck-textarea-ref2.html b/editor/reftests/spellcheck-textarea-ref2.html
new file mode 100644
index 0000000000..6bd588a235
--- /dev/null
+++ b/editor/reftests/spellcheck-textarea-ref2.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <textarea spellcheck="true" style="padding:2px;">blahblahblah</textarea>
+ <script type="text/javascript">
+ var box = document.getElementsByTagName("textarea")[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>
diff --git a/editor/reftests/spellcheck-url-valid-ref.html b/editor/reftests/spellcheck-url-valid-ref.html
new file mode 100644
index 0000000000..7f9f7530dd
--- /dev/null
+++ b/editor/reftests/spellcheck-url-valid-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus rows=10 cols=60 spellcheck=false>
+http://fooi.barj/bazk
+https://fooi.barj/bazk
+news://fooi.barj/bazk
+ftp://fooi.barj/bazk
+data:fooi/barj,bazk
+javascript:fooi.barj.bazk();
+fooi@barj.bazk
+</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/spellcheck-url-valid.html b/editor/reftests/spellcheck-url-valid.html
new file mode 100644
index 0000000000..f492560a2b
--- /dev/null
+++ b/editor/reftests/spellcheck-url-valid.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea autofocus rows=10 cols=60>
+http://fooi.barj/bazk
+https://fooi.barj/bazk
+news://fooi.barj/bazk
+ftp://fooi.barj/bazk
+data:fooi/barj,bazk
+javascript:fooi.barj.bazk();
+fooi@barj.bazk
+</textarea>
+ </body>
+</html>
diff --git a/editor/reftests/unneeded_scroll-ref.html b/editor/reftests/unneeded_scroll-ref.html
new file mode 100644
index 0000000000..9d6ec25bbd
--- /dev/null
+++ b/editor/reftests/unneeded_scroll-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <div>
+ <textarea>I
+ am
+ a
+ long
+ long
+ long
+ long
+ textarea
+ </textarea>
+ </div>
+ </body>
+</html>
diff --git a/editor/reftests/unneeded_scroll.html b/editor/reftests/unneeded_scroll.html
new file mode 100644
index 0000000000..55c0ba6ba3
--- /dev/null
+++ b/editor/reftests/unneeded_scroll.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <script>
+ document.addEventListener("DOMContentLoaded", function() {
+ var t = document.querySelector("textarea");
+ t.focus();
+ document.querySelector("#dst").appendChild(t);
+ });
+ </script>
+ <div>
+ <textarea>I
+ am
+ a
+ long
+ long
+ long
+ long
+ textarea
+ </textarea>
+ </div>
+ <div id="dst"></div>
+ </body>
+</html>
diff --git a/editor/reftests/xul/empty-ref.xhtml b/editor/reftests/xul/empty-ref.xhtml
new file mode 100644
index 0000000000..b5700fc158
--- /dev/null
+++ b/editor/reftests/xul/empty-ref.xhtml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="resource://reftest/input.css" type="text/css"?>
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ title="Textbox tests">
+
+ <script type="text/javascript" src="platform.js"/>
+
+ <html:input class="empty" value=" test"/>
+
+</window>
diff --git a/editor/reftests/xul/emptytextbox-4.xhtml b/editor/reftests/xul/emptytextbox-4.xhtml
new file mode 100644
index 0000000000..90ba9a004b
--- /dev/null
+++ b/editor/reftests/xul/emptytextbox-4.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ title="Textbox tests">
+
+ <script type="text/javascript" src="platform.js"/>
+
+ <search-textbox/>
+
+</window>
diff --git a/editor/reftests/xul/emptytextbox-ref.xhtml b/editor/reftests/xul/emptytextbox-ref.xhtml
new file mode 100644
index 0000000000..eb48d52d79
--- /dev/null
+++ b/editor/reftests/xul/emptytextbox-ref.xhtml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="resource://reftest/input.css" type="text/css"?>
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ title="Textbox tests">
+
+ <script type="text/javascript" src="platform.js"/>
+
+ <html:input/>
+
+</window>
diff --git a/editor/reftests/xul/input.css b/editor/reftests/xul/input.css
new file mode 100644
index 0000000000..17432527b2
--- /dev/null
+++ b/editor/reftests/xul/input.css
@@ -0,0 +1,36 @@
+@namespace url('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul');
+@namespace html url('http://www.w3.org/1999/xhtml');
+
+:root > html|input {
+ margin: 2px 4px;
+ padding: 2px 2px 3px;
+ padding-inline-start: 5px;
+}
+
+#mac > html|input {
+ margin: 4px;
+ padding: 0 1px;
+}
+
+html|input {
+ font: inherit;
+}
+
+html|input.empty {
+ color: graytext;
+}
+
+@media (-moz-windows-default-theme) and (-moz-platform: windows-win7) {
+ :root:not(.winxp) html|input.empty {
+ font-style: italic;
+ }
+}
+
+html|input.num {
+ text-align: end;
+}
+
+/* .textbox-input has 1px extra padding on Linux */
+#linux html|input.num {
+ padding-inline-end: 3px;
+}
diff --git a/editor/reftests/xul/placeholder-reset.css b/editor/reftests/xul/placeholder-reset.css
new file mode 100644
index 0000000000..a2c41e69b0
--- /dev/null
+++ b/editor/reftests/xul/placeholder-reset.css
@@ -0,0 +1,8 @@
+@namespace url('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul');
+@namespace html url('http://www.w3.org/1999/xhtml');
+
+/* We need to have a non-transparent placeholder so we can test it. */
+html|input::placeholder {
+ opacity: 1.0;
+ color: graytext;
+}
diff --git a/editor/reftests/xul/platform.js b/editor/reftests/xul/platform.js
new file mode 100644
index 0000000000..f45e6d1f5c
--- /dev/null
+++ b/editor/reftests/xul/platform.js
@@ -0,0 +1,28 @@
+// The appearance of XUL elements is platform-specific, so we set the
+// style of the root element according to the platform, so that the
+// CSS code inside input.css can select the correct styles for each
+// platform.
+
+var id;
+var ua = navigator.userAgent;
+
+if (/Windows/.test(ua)) {
+ id = "win";
+ if (/NT 5\.1/.test(ua) || /NT 5\.2; Win64/.test(ua))
+ var classname = "winxp";
+}
+else if (/Linux/.test(ua))
+ id = "linux";
+else if (/SunOS/.test(ua))
+ id = "linux";
+else if (/Mac OS X/.test(ua))
+ id = "mac";
+
+if (id)
+ document.documentElement.setAttribute("id", id);
+else
+ document.documentElement.appendChild(
+ document.createTextNode("Unrecognized platform")
+ );
+if (classname)
+ document.documentElement.setAttribute("class", classname);
diff --git a/editor/reftests/xul/reftest.list b/editor/reftests/xul/reftest.list
new file mode 100644
index 0000000000..591ee8f6c7
--- /dev/null
+++ b/editor/reftests/xul/reftest.list
@@ -0,0 +1 @@
+!= chrome://reftest/content/editor/reftests/xul/emptytextbox-4.xhtml chrome://reftest/content/editor/reftests/xul/emptytextbox-ref.xhtml