Backed out changeset 1f9bd1c29a40 (bug 923376) mochitest test 4 test failures
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 07 Apr 2014 15:51:05 +0200
changeset 195797 459a4f222dc4f2716c27c6311339e1933a76028b
parent 195796 79db871959fdd3ca1dcfecf1f1cfdc4eb855a0ca
child 195798 1cdcddd3c65646b7ed8fe7c1fed749cb1ffec388
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs923376
milestone31.0a1
backs out1f9bd1c29a40beb87403699cde01c083366e1d28
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
Backed out changeset 1f9bd1c29a40 (bug 923376) mochitest test 4 test failures
editor/libeditor/html/nsHTMLEditor.cpp
editor/libeditor/html/nsHTMLEditor.h
editor/libeditor/html/tests/923376-ref.html
editor/libeditor/html/tests/923376.html
editor/libeditor/html/tests/mochitest.ini
editor/libeditor/html/tests/test_bug923376.html
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -3222,33 +3222,23 @@ NS_IMETHODIMP nsHTMLEditor::InsertTextIm
   return nsEditor::InsertTextImpl(aStringToInsert, aInOutNode, aInOutOffset, aDoc);
 }
 
 void
 nsHTMLEditor::ContentAppended(nsIDocument *aDocument, nsIContent* aContainer,
                               nsIContent* aFirstNewContent,
                               int32_t aIndexInContainer)
 {
-  DoContentInserted(aDocument, aContainer, aFirstNewContent, aIndexInContainer,
-                    eAppended);
+  ContentInserted(aDocument, aContainer, aFirstNewContent, aIndexInContainer);
 }
 
 void
 nsHTMLEditor::ContentInserted(nsIDocument *aDocument, nsIContent* aContainer,
                               nsIContent* aChild, int32_t aIndexInContainer)
 {
-  DoContentInserted(aDocument, aContainer, aChild, aIndexInContainer,
-                    eInserted);
-}
-
-void
-nsHTMLEditor::DoContentInserted(nsIDocument* aDocument, nsIContent* aContainer,
-                                nsIContent* aChild, int32_t aIndexInContainer,
-                                InsertedOrAppended aInsertedOrAppended)
-{
   if (!aChild) {
     return;
   }
 
   nsCOMPtr<nsIHTMLEditor> kungFuDeathGrip(this);
 
   if (ShouldReplaceRootElement()) {
     nsContentUtils::AddScriptRunner(NS_NewRunnableMethod(
@@ -3262,27 +3252,18 @@ nsHTMLEditor::DoContentInserted(nsIDocum
     }
     // Protect the edit rules object from dying
     nsCOMPtr<nsIEditRules> kungFuDeathGrip(mRules);
     mRules->DocumentModified();
 
     // Update spellcheck for only the newly-inserted node (bug 743819)
     if (mInlineSpellChecker) {
       nsRefPtr<nsRange> range = new nsRange(aChild);
-      int32_t endIndex = aIndexInContainer + 1;
-      if (aInsertedOrAppended == eAppended) {
-        // Count all the appended nodes
-        nsIContent* sibling = aChild->GetNextSibling();
-        while (sibling) {
-          endIndex++;
-          sibling = sibling->GetNextSibling();
-        }
-      }
       nsresult res = range->Set(aContainer, aIndexInContainer,
-                                aContainer, endIndex);
+                                aContainer, aIndexInContainer + 1);
       if (NS_SUCCEEDED(res)) {
         mInlineSpellChecker->SpellCheckRange(range);
       }
     }
   }
 }
 
 void
--- a/editor/libeditor/html/nsHTMLEditor.h
+++ b/editor/libeditor/html/nsHTMLEditor.h
@@ -945,15 +945,12 @@ private:
   bool IsSimpleModifiableNode(nsIContent* aContent,
                               nsIAtom* aProperty,
                               const nsAString* aAttribute,
                               const nsAString* aValue);
   nsresult SetInlinePropertyOnNodeImpl(nsIContent* aNode,
                                        nsIAtom* aProperty,
                                        const nsAString* aAttribute,
                                        const nsAString* aValue);
-  typedef enum { eInserted, eAppended } InsertedOrAppended;
-  void DoContentInserted(nsIDocument* aDocument, nsIContent* aContainer,
-                         nsIContent* aChild, int32_t aIndexInContainer,
-                         InsertedOrAppended aInsertedOrAppended);
+
 };
 #endif //nsHTMLEditor_h__
 
deleted file mode 100644
--- a/editor/libeditor/html/tests/923376-ref.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!doctype html>
-<div contenteditable>something missspelled<br>something elsed#</div>
-<script src="/tests/SimpleTest/EventUtils.js"></script>
-<script>
-var div = document.body.firstChild;
-div.focus();
-SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm",
-                        window);
-onSpellCheck(div, function() {
-  div.blur();
-  parent.reportFinish();
-});
-</script>
deleted file mode 100644
--- a/editor/libeditor/html/tests/923376.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!doctype html>
-<div contenteditable></div>
-<script src="/tests/SimpleTest/EventUtils.js"></script>
-<script>
-var div = document.body.firstChild;
-div.focus();
-SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm",
-                        window);
-onSpellCheck(div, function() {
-  div.innerHTML = 'something missspelled<br>something elsed#';
-  onSpellCheck(div, function() {
-    div.blur();
-    parent.reportFinish();
-  });
-});
-</script>
--- a/editor/libeditor/html/tests/mochitest.ini
+++ b/editor/libeditor/html/tests/mochitest.ini
@@ -5,18 +5,16 @@ support-files =
   data/cfhtml-firefox.txt
   data/cfhtml-ie.txt
   data/cfhtml-ooo.txt
   data/cfhtml-nocontext.txt
   file_bug549262.html
   file_bug674770-1.html
   file_select_all_without_body.html
   green.png
-  923376.html
-  923376-ref.html
 
 [test_CF_HTML_clipboard.html]
 [test_bug200416.html]
 [test_bug289384.html]
 skip-if = os != "mac"
 [test_bug290026.html]
 [test_bug291780.html]
 [test_bug316447.html]
@@ -91,17 +89,16 @@ skip-if = toolkit == 'android' || e10s
 [test_bug757371.html]
 [test_bug767684.html]
 [test_bug780035.html]
 [test_bug787432.html]
 [test_bug790475.html]
 [test_bug796839.html]
 [test_bug832025.html]
 [test_bug857487.html]
-[test_bug923376.html]
 [test_bug966155.html]
 skip-if = os != "win"
 [test_bug966552.html]
 skip-if = os != "win"
 [test_contenteditable_focus.html]
 [test_dom_input_event_on_htmleditor.html]
 [test_keypress_untrusted_event.html]
 [test_root_element_replacement.html]
deleted file mode 100644
--- a/editor/libeditor/html/tests/test_bug923376.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE html>
-<!-- https://bugzilla.mozilla.org/show_bug.cgi?id=923376 -->
-<title>Test for Bug 923376</title>
-<script src="/tests/SimpleTest/SimpleTest.js"></script>
-<script src="/tests/SimpleTest/WindowSnapshot.js"></script>
-<link rel="stylesheet" href="/tests/SimpleTest/test.css">
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=923376">Mozilla Bug 923376</a>
-<script>
-SimpleTest.waitForExplicitFinish();
-
-var numFinished = 0;
-
-window.reportFinish = function() {
-  numFinished++;
-  if (numFinished == 2) {
-    doTest();
-  }
-}
-
-function doTest() {
-  var test = document.querySelectorAll("iframe")[0].contentWindow;
-  var ref = document.querySelectorAll("iframe")[1].contentWindow;
-
-  assertSnapshots(snapshotWindow(test, false), snapshotWindow(ref, false),
-                  true, "test", "ref");
-
-  SimpleTest.finish();
-}
-</script>
-<iframe src="923376.html"></iframe>
-<iframe src="923376-ref.html"></iframe>