Bug 1433669: Remove dead function. r?masayuki draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 29 Jan 2018 12:12:52 +0100
changeset 748253 a622549ed3235891ec88193d9d249d784010b22b
parent 748252 44659865c0153b3d7114fd10c098816af8b279b7
child 748254 03d052426eb3a099e68bdfff2e7d96bc2845614c
push id97096
push userbmo:emilio@crisal.io
push dateMon, 29 Jan 2018 11:17:44 +0000
reviewersmasayuki
bugs1433669
milestone60.0a1
Bug 1433669: Remove dead function. r?masayuki MozReview-Commit-ID: ETgeBXd5nya
dom/events/ContentEventHandler.cpp
dom/events/ContentEventHandler.h
--- a/dom/events/ContentEventHandler.cpp
+++ b/dom/events/ContentEventHandler.cpp
@@ -3072,37 +3072,16 @@ ContentEventHandler::AdjustCollapsedRang
     aRawRange.CollapseTo(RawRangeBoundary(childNode, offsetInChildNode));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
   return NS_OK;
 }
 
 nsresult
-ContentEventHandler::GetStartFrameAndOffset(const RawRange& aRawRange,
-                                            nsIFrame*& aFrame,
-                                            int32_t& aOffsetInFrame)
-{
-  aFrame = nullptr;
-  aOffsetInFrame = -1;
-
-  nsINode* node = aRawRange.GetStartContainer();
-  if (NS_WARN_IF(!node) || NS_WARN_IF(!node->IsContent())) {
-    return NS_ERROR_FAILURE;
-  }
-  RefPtr<nsFrameSelection> fs = mPresShell->FrameSelection();
-  aFrame = fs->GetFrameForNodeOffset(node->AsContent(), aRawRange.StartOffset(),
-                                     fs->GetHint(), &aOffsetInFrame);
-  if (NS_WARN_IF(!aFrame)) {
-    return NS_ERROR_FAILURE;
-  }
-  return NS_OK;
-}
-
-nsresult
 ContentEventHandler::ConvertToRootRelativeOffset(nsIFrame* aFrame,
                                                  nsRect& aRect)
 {
   NS_ASSERTION(aFrame, "aFrame must not be null");
 
   nsPresContext* thisPC = aFrame->PresContext();
   nsPresContext* rootPC = thisPC->GetRootPresContext();
   if (NS_WARN_IF(!rootPC)) {
--- a/dom/events/ContentEventHandler.h
+++ b/dom/events/ContentEventHandler.h
@@ -332,20 +332,16 @@ protected:
                                          uint32_t aLength,
                                          LineBreakType aLineBreakType,
                                          bool aExpandToClusterBoundaries,
                                          uint32_t* aNewOffset = nullptr,
                                          nsIContent** aLastTextNode = nullptr);
   // If the aCollapsedRawRange isn't in text node but next to a text node,
   // this method modifies it in the text node.  Otherwise, not modified.
   nsresult AdjustCollapsedRangeMaybeIntoTextNode(RawRange& aCollapsedRawRange);
-  // Find the first frame for the range and get the start offset in it.
-  nsresult GetStartFrameAndOffset(const RawRange& aRawRange,
-                                  nsIFrame*& aFrame,
-                                  int32_t& aOffsetInFrame);
   // Convert the frame relative offset to be relative to the root frame of the
   // root presContext (but still measured in appUnits of aFrame's presContext).
   nsresult ConvertToRootRelativeOffset(nsIFrame* aFrame,
                                        nsRect& aRect);
   // Expand aXPOffset to the nearest offset in cluster boundary. aForward is
   // true, it is expanded to forward.
   nsresult ExpandToClusterBoundary(nsIContent* aContent, bool aForward,
                                    uint32_t* aXPOffset);