From c1dace61dffab2cb6e962884c65ce620c00998b5 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Sun, 24 Jun 2012 10:30:34 +0300 Subject: [PATCH] Back out bac4434b31d2 for test failures --HG-- extra : rebase_source : e23e10a4638b34026ae3f79573575d85700ff8df --- editor/libeditor/html/crashtests/766387.html | 20 ------------- .../libeditor/html/crashtests/crashtests.list | 1 - editor/libeditor/html/nsHTMLEditor.cpp | 30 ------------------- editor/libeditor/html/nsHTMLEditor.h | 2 -- 4 files changed, 53 deletions(-) delete mode 100644 editor/libeditor/html/crashtests/766387.html diff --git a/editor/libeditor/html/crashtests/766387.html b/editor/libeditor/html/crashtests/766387.html deleted file mode 100644 index 20ccc60d446a..000000000000 --- a/editor/libeditor/html/crashtests/766387.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - -
a
- diff --git a/editor/libeditor/html/crashtests/crashtests.list b/editor/libeditor/html/crashtests/crashtests.list index 365a1e04e1d8..244c1380508e 100644 --- a/editor/libeditor/html/crashtests/crashtests.list +++ b/editor/libeditor/html/crashtests/crashtests.list @@ -30,4 +30,3 @@ load 759748.html load 761861.html load 766795.html load 766305.html -load 766387.html diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp index 356541a2a1f1..a1c348484ff8 100644 --- a/editor/libeditor/html/nsHTMLEditor.cpp +++ b/editor/libeditor/html/nsHTMLEditor.cpp @@ -3598,36 +3598,6 @@ nsHTMLEditor::IsModifiableNode(nsINode *aNode) return !aNode || aNode->IsEditable(); } -NS_IMETHODIMP -nsHTMLEditor::GetIsSelectionEditable(bool* aIsSelectionEditable) -{ - MOZ_ASSERT(aIsSelectionEditable); - - nsRefPtr selection = GetSelection(); - NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER); - - // Per the editing spec as of June 2012: we have to have a selection whose - // start and end nodes are editable, and which share an ancestor editing - // host. (Bug 766387.) - *aIsSelectionEditable = selection->GetRangeCount() && - selection->GetAnchorNode()->IsEditable() && - selection->GetFocusNode()->IsEditable(); - - if (*aIsSelectionEditable) { - nsINode* commonAncestor = - selection->GetAnchorFocusRange()->GetCommonAncestor(); - while (commonAncestor && !commonAncestor->IsEditable()) { - commonAncestor = commonAncestor->GetNodeParent(); - } - if (!commonAncestor) { - // No editable common ancestor - *aIsSelectionEditable = false; - } - } - - return NS_OK; -} - static nsresult SetSelectionAroundHeadChildren(nsISelection* aSelection, nsIWeakReference* aDocWeak) diff --git a/editor/libeditor/html/nsHTMLEditor.h b/editor/libeditor/html/nsHTMLEditor.h index 60f5e0c43c5a..d488021417fd 100644 --- a/editor/libeditor/html/nsHTMLEditor.h +++ b/editor/libeditor/html/nsHTMLEditor.h @@ -310,8 +310,6 @@ public: NS_IMETHOD_(bool) IsModifiableNode(nsIDOMNode *aNode); virtual bool IsModifiableNode(nsINode *aNode); - NS_IMETHOD GetIsSelectionEditable(bool* aIsSelectionEditable); - NS_IMETHOD SelectAll(); NS_IMETHOD GetRootElement(nsIDOMElement **aRootElement);