Backed out 1 changesets (bug 1443902) for reftest failures reftest/tests/editor/reftests/1443902-2.html CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Tue, 10 Jul 2018 05:50:31 +0300
changeset 425552 120a610ee8bafbaf44a3487da1f4409b5fde0205
parent 425551 fc9fd41ca2d3a50e5248327f255a49517ae400e3
child 425553 d5950b441d27d8f6b19142d1d9336d3bd63d8635
push id34258
push usertoros@mozilla.com
push dateTue, 10 Jul 2018 09:43:53 +0000
treeherdermozilla-central@0c55071115c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1443902
milestone63.0a1
backs out4c31558d3481dbd0d0f842fafc73120eb04cbd91
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 1 changesets (bug 1443902) for reftest failures reftest/tests/editor/reftests/1443902-2.html CLOSED TREE Backed out changeset 4c31558d3481 (bug 1443902)
dom/html/nsHTMLDocument.cpp
editor/libeditor/EditorBase.cpp
editor/libeditor/EditorBase.h
editor/reftests/1443902-1-ref.html
editor/reftests/1443902-1.html
editor/reftests/1443902-2-ref.html
editor/reftests/1443902-2.html
editor/reftests/1443902-3-ref.html
editor/reftests/1443902-3.html
editor/reftests/1443902-4-ref.html
editor/reftests/1443902-4.html
editor/reftests/reftest.list
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -2334,30 +2334,16 @@ nsHTMLDocument::TurnEditingOff()
   NS_ENSURE_SUCCESS(rv, rv);
 
   // turn editing off
   rv = editSession->TearDownEditorOnWindow(window);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mEditingState = eOff;
 
-  // Editor resets selection since it is being destroyed.  But if focus is
-  // still into editable control, we have to initialize selection again.
-  nsFocusManager* fm = nsFocusManager::GetFocusManager();
-  if (fm) {
-    Element* element = fm->GetFocusedElement();
-    nsCOMPtr<nsITextControlElement> txtCtrl = do_QueryInterface(element);
-    if (txtCtrl) {
-      RefPtr<TextEditor> textEditor = txtCtrl->GetTextEditor();
-      if (textEditor) {
-        textEditor->ReinitializeSelection(*element);
-      }
-    }
-  }
-
   return NS_OK;
 }
 
 static bool HasPresShell(nsPIDOMWindowOuter *aWindow)
 {
   nsIDocShell *docShell = aWindow->GetDocShell();
   if (!docShell)
     return false;
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -4794,33 +4794,16 @@ EditorBase::FinalizeSelection()
 
   // FinalizeSelection might be called from ContentRemoved even if selection
   // isn't updated.  So we need to call RepaintSelection after updated it.
   nsContentUtils::AddScriptRunner(
                     new RepaintSelectionRunner(selectionController));
   return NS_OK;
 }
 
-void
-EditorBase::ReinitializeSelection(Element& aElement)
-{
-  if (NS_WARN_IF(Destroyed())) {
-    return;
-  }
-
-  OnFocus(&aElement);
-
-  nsPresContext* context = GetPresContext();
-  if (NS_WARN_IF(!context)) {
-    return;
-  }
-  nsCOMPtr<nsIContent> focusedContent = GetFocusedContentForIME();
-  IMEStateManager::OnFocusInEditor(context, focusedContent, *this);
-}
-
 Element*
 EditorBase::GetEditorRoot()
 {
   return GetRoot();
 }
 
 Element*
 EditorBase::GetExposedRoot()
--- a/editor/libeditor/EditorBase.h
+++ b/editor/libeditor/EditorBase.h
@@ -667,24 +667,16 @@ public:
   void OnFocus(dom::EventTarget* aFocusEventTarget);
 
   /** Resyncs spellchecking state (enabled/disabled).  This should be called
     * when anything that affects spellchecking state changes, such as the
     * spellcheck attribute value.
     */
   void SyncRealTimeSpell();
 
- /**
-   * This method re-initializes the selection and caret state that are for
-   * current editor state. When editor session is destroyed, it always reset
-   * selection state even if this has no focus.  So if destroying editor,
-   * we have to call this method for focused editor to set selection state.
-   */
- void ReinitializeSelection(Element& aElement);
-
 protected: // May be called by friends.
   /****************************************************************************
    * Some classes like TextEditRules, HTMLEditRules, WSRunObject which are
    * part of handling edit actions are allowed to call the following protected
    * methods.  However, those methods won't prepare caches of some objects
    * which are necessary for them.  So, if you want some following methods
    * to do that for you, you need to create a wrapper method in public scope
    * and call it.
deleted file mode 100644
--- a/editor/reftests/1443902-1-ref.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!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>
deleted file mode 100644
--- a/editor/reftests/1443902-1.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!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>
deleted file mode 100644
--- a/editor/reftests/1443902-2-ref.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!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>
deleted file mode 100644
--- a/editor/reftests/1443902-2.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!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>
deleted file mode 100644
--- a/editor/reftests/1443902-3-ref.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!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>
deleted file mode 100644
--- a/editor/reftests/1443902-3.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!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>
deleted file mode 100644
--- a/editor/reftests/1443902-4-ref.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!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>
deleted file mode 100644
--- a/editor/reftests/1443902-4.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!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>
--- a/editor/reftests/reftest.list
+++ b/editor/reftests/reftest.list
@@ -130,12 +130,8 @@ needs-focus == spellcheck-contenteditabl
 == spellcheck-contenteditable-attr-dynamic-override.html spellcheck-contenteditable-disabled-ref.html
 == spellcheck-contenteditable-attr-dynamic-override-inherit.html spellcheck-contenteditable-disabled-ref.html
 == spellcheck-contenteditable-property-dynamic-override.html spellcheck-contenteditable-disabled-ref.html
 == spellcheck-contenteditable-property-dynamic-override-inherit.html spellcheck-contenteditable-disabled-ref.html
 == 911201.html 911201-ref.html
 needs-focus == 969773.html 969773-ref.html
 fuzzy-if(skiaContent,1,220) == 997805.html 997805-ref.html
 fuzzy-if(skiaContent,1,220) skip-if(verify&&OSX) == 1088158.html 1088158-ref.html
-needs-focus == 1443902-1.html 1443902-1-ref.html
-needs-focus == 1443902-2.html 1443902-2-ref.html
-needs-focus == 1443902-3.html 1443902-3-ref.html
-needs-focus == 1443902-4.html 1443902-4-ref.html