Bug 674212 - Modifying text of a contenteditable DOM Node removes spellcheck underlinings; r=ehsan
authorFabien Cazenave <kaze@kompozer.net>
Wed, 17 Aug 2011 17:12:46 -0400
changeset 75436 800f7541fb20db6cecf427c9342fde4efdb8abe4
parent 75435 2c5ef30a89b26fc38d88c0848c391e68db8756dd
child 75437 f345becaf55b05b3f0a05fd9aea4d7d4457377a0
push id21023
push usermak77@bonardo.net
push dateThu, 18 Aug 2011 09:39:20 +0000
treeherdermozilla-central@f69a10f23bf3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs674212
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 674212 - Modifying text of a contenteditable DOM Node removes spellcheck underlinings; r=ehsan
editor/libeditor/html/nsHTMLEditRules.cpp
layout/reftests/editor/674212-spellcheck-ref.html
layout/reftests/editor/674212-spellcheck.html
layout/reftests/editor/reftest.list
--- a/editor/libeditor/html/nsHTMLEditRules.cpp
+++ b/editor/libeditor/html/nsHTMLEditRules.cpp
@@ -9256,9 +9256,12 @@ nsHTMLEditRules::DocumentModifiedWorker(
   // empty any more.
   if (mBogusNode) {
     mEditor->DeleteNode(mBogusNode);
     mBogusNode = nsnull;
   }
 
   // Try to recreate the bogus node if needed.
   CreateBogusNodeIfNeeded(selection);
-}
+
+  // Reset the spell checker
+  mEditor->SyncRealTimeSpell();
+}
new file mode 100644
--- /dev/null
+++ b/layout/reftests/editor/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);
+      }, false);
+      editor.focus();
+    }
+  </script>
+</head>
+<body onload="init()">
+  <div contenteditable spellcheck>This is another misspellored word.</div>
+</body>
+</html>
+
new file mode 100644
--- /dev/null
+++ b/layout/reftests/editor/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);
+      }, false);
+      editor.focus();
+    }
+  </script>
+</head>
+<body onload="init()">
+  <div contenteditable spellcheck>This is a misspellored word.</div>
+</body>
+</html>
--- a/layout/reftests/editor/reftest.list
+++ b/layout/reftests/editor/reftest.list
@@ -60,10 +60,11 @@ fails-if(Android) != spellcheck-hyphen-m
 == caret_on_presshell_reinit.html caret_on_presshell_reinit-ref.html
 == caret_on_presshell_reinit-2.html caret_on_presshell_reinit-ref.html
 == 642800.html 642800-ref.html
 == selection_visibility_after_reframe.html selection_visibility_after_reframe-ref.html
 != selection_visibility_after_reframe-2.html selection_visibility_after_reframe-ref.html
 != selection_visibility_after_reframe-3.html selection_visibility_after_reframe-ref.html
 == 672709.html 672709-ref.html
 == 338427-1.html 338427-1-ref.html
+== 674212-spellcheck.html 674212-spellcheck-ref.html
 skip-if(Android) == 338427-2.html 338427-2-ref.html
 skip-if(Android) == 338427-3.html 338427-3-ref.html