Bug 798867 - Use the content offset that GetFrameForNodeOffset returns. r=roc
authorMats Palmgren <matspal@gmail.com>
Thu, 08 Nov 2012 17:09:38 +0100
changeset 112704 ac1fdaa261f2d65fd700adc53fdc4dac00be6d90
parent 112703 ea3dd343ee5e7c4349941bfc2daa04f55503a6c3
child 112705 9fa862c22f51addfbd0285ddd63eb265a7b93a42
push id23835
push userryanvm@gmail.com
push dateFri, 09 Nov 2012 00:52:02 +0000
treeherdermozilla-central@27ae6c86237f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs798867
milestone19.0a1
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
Bug 798867 - Use the content offset that GetFrameForNodeOffset returns. r=roc
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2871,30 +2871,29 @@ nsFrame::SelectByTypeAtPoint(nsPresConte
   // No point in selecting if selection is turned off
   if (DisplaySelection(aPresContext) == nsISelectionController::SELECTION_OFF)
     return NS_OK;
 
   ContentOffsets offsets = GetContentOffsetsFromPoint(aPoint, SKIP_HIDDEN);
   if (!offsets.content)
     return NS_ERROR_FAILURE;
 
-  nsIFrame* theFrame;
   int32_t offset;
   const nsFrameSelection* frameSelection =
     PresContext()->GetPresShell()->ConstFrameSelection();
-  theFrame = frameSelection->
+  nsIFrame* theFrame = frameSelection->
     GetFrameForNodeOffset(offsets.content, offsets.offset,
                           nsFrameSelection::HINT(offsets.associateWithNext),
                           &offset);
   if (!theFrame)
     return NS_ERROR_FAILURE;
 
   nsFrame* frame = static_cast<nsFrame*>(theFrame);
-  return frame->PeekBackwardAndForward(aBeginAmountType, aEndAmountType,
-                                       offsets.offset, aPresContext,
+  return frame->PeekBackwardAndForward(aBeginAmountType, aEndAmountType, 
+                                       offset, aPresContext,
                                        aBeginAmountType != eSelectWord,
                                        aSelectFlags);
 }
 
 /**
   * Multiple Mouse Press -- line or paragraph selection -- for the frame.
   * Wouldn't it be nice if this didn't have to be hardwired into Frame code?
  */