Bug 1391978 - Part 5. Replace nsISelection::GetFocusOffset/GetAnchroOffset with Selection::FocusOffset/AnchorOffset. r?masayuki draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Fri, 25 Aug 2017 16:12:38 +0900
changeset 654196 3e57ddbebc7985ec0e5ada4b1e83631d6f1c83b5
parent 654195 c11007a58ee312a7845ba4b8c0886dec49cd8c39
child 654197 b217dd1d506229d848126b9c2494d1b4f9dc3a35
push id76495
push userbmo:m_kato@ga2.so-net.ne.jp
push dateMon, 28 Aug 2017 10:39:27 +0000
reviewersmasayuki
bugs1391978
milestone57.0a1
Bug 1391978 - Part 5. Replace nsISelection::GetFocusOffset/GetAnchroOffset with Selection::FocusOffset/AnchorOffset. r?masayuki MozReview-Commit-ID: 6OpO1GQyhFO
editor/libeditor/HTMLEditor.cpp
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -2463,27 +2463,27 @@ HTMLEditor::GetSelectedElement(const nsA
       // Link tag is a special case - we return the anchor node
       //  found for any selection that is totally within a link,
       //  included a collapsed selection (just a caret in a link)
       nsCOMPtr<nsIDOMNode> anchorNode;
       rv = selection->GetAnchorNode(getter_AddRefs(anchorNode));
       NS_ENSURE_SUCCESS(rv, rv);
       int32_t anchorOffset = -1;
       if (anchorNode) {
-        selection->GetAnchorOffset(&anchorOffset);
+        anchorOffset = selection->AnchorOffset();
       }
 
       nsCOMPtr<nsINode> focusNode = selection->GetFocusNode();
       int32_t focusOffset = -1;
       if (focusNode) {
-        selection->GetFocusOffset(&focusOffset);
+        focusOffset = selection->FocusOffset();
       }
 
       // Link node must be the same for both ends of selection
-      if (NS_SUCCEEDED(rv) && anchorNode) {
+      if (anchorNode) {
         nsCOMPtr<nsIDOMElement> parentLinkOfAnchor;
         rv = GetElementOrParentByTagName(NS_LITERAL_STRING("href"),
                                          anchorNode,
                                          getter_AddRefs(parentLinkOfAnchor));
         // XXX: ERROR_HANDLING  can parentLinkOfAnchor be null?
         if (NS_SUCCEEDED(rv) && parentLinkOfAnchor) {
           if (isCollapsed) {
             // We have just a caret in the link