Bug 390423 - Simplify the signature of nsIFrame::GetPointFromOffset, patch by Ben Karel <web+moz@eschew.org>, r=aaronlev/elif, sr=roc, a1.9=dbaron
authorphilringnalda@gmail.com
Thu, 16 Aug 2007 20:43:00 -0700
changeset 4741 053fd31db48faafebd4aeabadf4a31d352e8ae27
parent 4740 103489b531f1caa0a6fb2b8aefb29dd350aa269c
child 4742 a56766f9bd6dc0cddb5bc4719ae216022407e227
push idunknown
push userunknown
push dateunknown
reviewersaaronlev, elif, roc
bugs390423
milestone1.9a8pre
Bug 390423 - Simplify the signature of nsIFrame::GetPointFromOffset, patch by Ben Karel <web+moz@eschew.org>, r=aaronlev/elif, sr=roc, a1.9=dbaron
accessible/src/html/nsHyperTextAccessible.cpp
accessible/src/msaa/nsTextAccessibleWrap.cpp
accessible/src/msaa/nsTextAccessibleWrap.h
layout/base/nsCaret.cpp
layout/base/nsPresShell.cpp
layout/generic/nsFrame.cpp
layout/generic/nsFrame.h
layout/generic/nsIFrame.h
layout/generic/nsSelection.cpp
layout/generic/nsTextFrameThebes.cpp
--- a/accessible/src/html/nsHyperTextAccessible.cpp
+++ b/accessible/src/html/nsHyperTextAccessible.cpp
@@ -284,23 +284,23 @@ nsIntRect nsHyperTextAccessible::GetBoun
     PRInt32 startFrameTextOffset, endFrameTextOffset;
     frame->GetOffsets(startFrameTextOffset, endFrameTextOffset);
     PRInt32 frameTotalTextLength = endFrameTextOffset - startFrameTextOffset;
     PRInt32 seekLength = endContentOffset - startContentOffset;
     PRInt32 frameSubStringLength = PR_MIN(frameTotalTextLength - startContentOffsetInFrame, seekLength);
 
     // Add the point where the string starts to the frameScreenRect
     nsPoint frameTextStartPoint;
-    rv = frame->GetPointFromOffset(context, rc, startContentOffset, &frameTextStartPoint);
+    rv = frame->GetPointFromOffset(startContentOffset, &frameTextStartPoint);
     NS_ENSURE_SUCCESS(rv, nsRect());   
     frameScreenRect.x += context->AppUnitsToDevPixels(frameTextStartPoint.x);
 
     // Use the point for the end offset to calculate the width
     nsPoint frameTextEndPoint;
-    rv = frame->GetPointFromOffset(context, rc, startContentOffset + frameSubStringLength, &frameTextEndPoint);
+    rv = frame->GetPointFromOffset(startContentOffset + frameSubStringLength, &frameTextEndPoint);
     NS_ENSURE_SUCCESS(rv, nsRect());   
     frameScreenRect.width = context->AppUnitsToDevPixels(frameTextEndPoint.x - frameTextStartPoint.x);
 
     screenRect.UnionRect(frameScreenRect, screenRect);
 
     // Get ready to loop back for next frame continuation
     startContentOffset += frameSubStringLength;
     startContentOffsetInFrame = 0;
--- a/accessible/src/msaa/nsTextAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsTextAccessibleWrap.cpp
@@ -191,30 +191,28 @@ STDMETHODIMP nsTextAccessibleWrap::scrol
 
     domSel->CollapseToStart();
   }
 
   return S_OK;
 }
 
 nsIFrame* nsTextAccessibleWrap::GetPointFromOffset(nsIFrame *aContainingFrame, 
-                                                   nsPresContext *aPresContext,
-                                                   nsIRenderingContext *aRendContext,
                                                    PRInt32 aOffset, 
                                                    PRBool aPreferNext, 
                                                    nsPoint& aOutPoint)
 {
   nsIFrame *textFrame = nsnull;
   PRInt32 outOffset;
   aContainingFrame->GetChildFrameContainingOffset(aOffset, aPreferNext, &outOffset, &textFrame);
   if (!textFrame) {
     return nsnull;
   }
 
-  textFrame->GetPointFromOffset(aPresContext, aRendContext, aOffset, &aOutPoint);
+  textFrame->GetPointFromOffset(aOffset, &aOutPoint);
 
   return textFrame;
 }
 
 /*
  * Given an offset, the x, y, width, and height values are filled appropriately.
  */
 nsresult nsTextAccessibleWrap::GetCharacterExtents(PRInt32 aStartOffset, PRInt32 aEndOffset,
@@ -224,24 +222,20 @@ nsresult nsTextAccessibleWrap::GetCharac
   nsPresContext *presContext = GetPresContext();
   NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE);
 
   nsIFrame *frame = GetFrame();
   NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
 
   nsIWidget *widget = frame->GetWindow();
   NS_ENSURE_TRUE(widget, NS_ERROR_FAILURE);
-
-  nsCOMPtr<nsIRenderingContext> rendContext(getter_AddRefs(widget->GetRenderingContext()));
   
   nsPoint startPoint, endPoint;
-  nsIFrame *startFrame = GetPointFromOffset(frame, presContext, rendContext, 
-                                            aStartOffset, PR_TRUE, startPoint);
-  nsIFrame *endFrame = GetPointFromOffset(frame, presContext, rendContext, 
-                                          aEndOffset, PR_FALSE, endPoint);
+  nsIFrame *startFrame = GetPointFromOffset(frame, aStartOffset, PR_TRUE, startPoint);
+  nsIFrame *endFrame = GetPointFromOffset(frame, aEndOffset, PR_FALSE, endPoint);
   if (!startFrame || !endFrame) {
     return E_FAIL;
   }
   
   nsRect sum(0, 0, 0, 0);
   nsIFrame *iter = startFrame;
   nsIFrame *stopLoopFrame = endFrame->GetNextContinuation();
   for (; iter != stopLoopFrame; iter = iter->GetNextContinuation()) {
--- a/accessible/src/msaa/nsTextAccessibleWrap.h
+++ b/accessible/src/msaa/nsTextAccessibleWrap.h
@@ -86,15 +86,14 @@ class nsTextAccessibleWrap : public nsTe
         /* [retval][out] */ BSTR __RPC_FAR *fontFamily);
     
   protected:
     nsresult GetCharacterExtents(PRInt32 aStartOffset, PRInt32 aEndOffset,
                                  PRInt32* aX, PRInt32* aY, 
                                  PRInt32* aWidth, PRInt32* aHeight);
 
     // Return child frame containing offset on success
-    nsIFrame* GetPointFromOffset(nsIFrame *aContainingFrame, nsPresContext *aPresContext,
-                                 nsIRenderingContext *aRenderingContext,
+    nsIFrame* GetPointFromOffset(nsIFrame *aContainingFrame,
                                  PRInt32 aOffset, PRBool aPreferNext, nsPoint& aOutPoint);
 };
 
 #endif
 
--- a/layout/base/nsCaret.cpp
+++ b/layout/base/nsCaret.cpp
@@ -310,36 +310,19 @@ NS_IMETHODIMP nsCaret::GetCaretCoordinat
     return err;
   
   nsPoint   viewOffset(0, 0);
   nsIView   *drawingView;     // views are not refcounted
 
   GetViewForRendering(theFrame, aRelativeToType, viewOffset, &drawingView, outView);
   if (!drawingView)
     return NS_ERROR_UNEXPECTED;
-  // ramp up to make a rendering context for measuring text.
-  // First, we get the pres context ...
-  nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShell);
-  if (!presShell)
-    return NS_ERROR_FAILURE;
-  nsPresContext *presContext = presShell->GetPresContext();
-
-  // ... then tell it to make a rendering context
-  nsCOMPtr<nsIRenderingContext> rendContext;  
-  err = presContext->DeviceContext()->
-    CreateRenderingContext(drawingView, *getter_AddRefs(rendContext));
-  if (NS_FAILED(err))
-    return err;
-  if (!rendContext)
-    return NS_ERROR_UNEXPECTED;
-
-  // now we can measure the offset into the frame.
+ 
   nsPoint   framePos(0, 0);
-  err = theFrame->GetPointFromOffset(presContext, rendContext, theFrameOffset,
-                                     &framePos);
+  err = theFrame->GetPointFromOffset(theFrameOffset, &framePos);
   if (NS_FAILED(err))
     return err;
 
   // we don't need drawingView anymore so reuse that; reset viewOffset values for our purposes
   if (aRelativeToType == eClosestViewCoordinates)
   {
     theFrame->GetOffsetFromView(viewOffset, &drawingView);
     if (outView)
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -1055,23 +1055,21 @@ protected:
   nsresult SetPrefNoFramesRule(void);
 
   // methods for painting a range to an offscreen buffer
 
   // given a display list, clip the items within the list to
   // the range
   nsRect ClipListToRange(nsDisplayListBuilder *aBuilder,
                          nsDisplayList* aList,
-                         nsIRange* aRange,
-                         nsIRenderingContext* aRenderingContext);
+                         nsIRange* aRange);
 
   // create a RangePaintInfo for the range aRange containing the
   // display list needed to paint the range to a surface
   RangePaintInfo* CreateRangePaintInfo(nsIDOMRange* aRange,
-                                       nsIRenderingContext* aRenderingContext,
                                        nsRect& aSurfaceRect);
 
   /*
    * Paint the items to a new surface and return it.
    *
    * aSelection - selection being painted, if any
    * aRegion - clip region, if any
    * aArea - area that the surface occupies, relative to the root frame
@@ -4803,18 +4801,17 @@ PresShell::RenderDocument(const nsRect& 
 
 /*
  * Clip the display list aList to a range. Returns the clipped
  * rectangle surrounding the range.
  */
 nsRect
 PresShell::ClipListToRange(nsDisplayListBuilder *aBuilder,
                            nsDisplayList* aList,
-                           nsIRange* aRange,
-                           nsIRenderingContext* aRenderingContext)
+                           nsIRange* aRange)
 {
   // iterate though the display items and add up the bounding boxes of each.
   // This will allow the total area of the frames within the range to be
   // determined. To do this, remove an item from the bottom of the list, check
   // whether it should be part of the range, and if so, append it to the top
   // of the temporary list tmpList. If the item is a text frame at the end of
   // the selection range, wrap it in an nsDisplayClip to clip the display to
   // the portion of the text frame that is part of the selection. Then, append
@@ -4841,20 +4838,18 @@ PresShell::ClipListToRange(nsDisplayList
           PRInt32 hilightStart =
             atStart ? PR_MAX(aRange->StartOffset(), frameStartOffset) : frameStartOffset;
           PRInt32 hilightEnd =
             atEnd ? PR_MIN(aRange->EndOffset(), frameEndOffset) : frameEndOffset;
           if (hilightStart < hilightEnd) {
             // determine the location of the start and end edges of the range.
             nsPoint startPoint, endPoint;
             nsPresContext* presContext = GetPresContext();
-            frame->GetPointFromOffset(presContext, aRenderingContext,
-                                      hilightStart, &startPoint);
-            frame->GetPointFromOffset(presContext, aRenderingContext,
-                                      hilightEnd, &endPoint);
+            frame->GetPointFromOffset(hilightStart, &startPoint);
+            frame->GetPointFromOffset(hilightEnd, &endPoint);
 
             // the clip rectangle is determined by taking the the start and
             // end points of the range, offset from the reference frame.
             // Because of rtl, the end point may be to the left of the
             // start point, so x is set to the lowest value
             nsRect textRect(aBuilder->ToReferenceFrame(frame), frame->GetSize());
             nscoord x = PR_MIN(startPoint.x, endPoint.x);
             textRect.x += x;
@@ -4882,33 +4877,32 @@ PresShell::ClipListToRange(nsDisplayList
     // insert the item into the list if necessary. If the item has a child
     // list, insert that as well
     nsDisplayList* sublist = i->GetList();
     if (itemToInsert || sublist) {
       tmpList.AppendToTop(itemToInsert ? itemToInsert : i);
       // if the item is a list, iterate over it as well
       if (sublist)
         surfaceRect.UnionRect(surfaceRect,
-          ClipListToRange(aBuilder, sublist, aRange, aRenderingContext));
+          ClipListToRange(aBuilder, sublist, aRange));
     }
     else {
       // otherwise, just delete the item and don't readd it to the list
       i->~nsDisplayItem();
     }
   }
 
   // now add all the items back onto the original list again
   aList->AppendToTop(&tmpList);
 
   return surfaceRect;
 }
 
 RangePaintInfo*
 PresShell::CreateRangePaintInfo(nsIDOMRange* aRange,
-                                nsIRenderingContext* aRenderingContext,
                                 nsRect& aSurfaceRect)
 {
   RangePaintInfo* info = nsnull;
 
   nsCOMPtr<nsIRange> range = do_QueryInterface(aRange);
   if (!range)
     return nsnull;
 
@@ -4952,18 +4946,17 @@ PresShell::CreateRangePaintInfo(nsIDOMRa
 
   // get a display list containing the range
   info->mBuilder.SetPaintAllFrames();
   info->mBuilder.EnterPresShell(ancestorFrame, ancestorRect);
   ancestorFrame->BuildDisplayListForStackingContext(&info->mBuilder,
                                                     ancestorRect, &info->mList);
   info->mBuilder.LeavePresShell(ancestorFrame, ancestorRect);
 
-  nsRect rangeRect = ClipListToRange(&info->mBuilder, &info->mList,
-                                     range, aRenderingContext);
+  nsRect rangeRect = ClipListToRange(&info->mBuilder, &info->mList, range);
 
   // determine the offset of the reference frame for the display list
   // to the root frame. This will allow the coordinates used when painting
   // to all be offset from the same point
   info->mRootOffset = ancestorFrame->GetOffsetTo(rootFrame);
   rangeRect.MoveBy(info->mRootOffset);
   aSurfaceRect.UnionRect(aSurfaceRect, rangeRect);
 
@@ -5088,31 +5081,26 @@ PresShell::PaintRangePaintInfo(nsTArray<
 }
 
 already_AddRefed<gfxASurface>
 PresShell::RenderNode(nsIDOMNode* aNode,
                       nsIRegion* aRegion,
                       nsPoint& aPoint,
                       nsRect* aScreenRect)
 {
-  // create a temporary rendering context for text measuring
-  nsCOMPtr<nsIRenderingContext> tmprc;
-  nsresult rv = CreateRenderingContext(GetRootFrame(), getter_AddRefs(tmprc));
-  NS_ENSURE_SUCCESS(rv, nsnull);
-
   // area will hold the size of the surface needed to draw the node, measured
   // from the root frame.
   nsRect area;
   nsTArray<nsAutoPtr<RangePaintInfo> > rangeItems;
 
   nsCOMPtr<nsIDOMRange> range;
   NS_NewRange(getter_AddRefs(range));
   range->SelectNode(aNode);
 
-  RangePaintInfo* info = CreateRangePaintInfo(range, tmprc, area);
+  RangePaintInfo* info = CreateRangePaintInfo(range, area);
   if (info && !rangeItems.AppendElement(info)) {
     delete info;
     return nsnull;
   }
 
   if (aRegion) {
     // combine the area with the supplied region
     nsRect rrectPixels;
@@ -5136,21 +5124,16 @@ PresShell::RenderNode(nsIDOMNode* aNode,
                              aScreenRect);
 }
 
 already_AddRefed<gfxASurface>
 PresShell::RenderSelection(nsISelection* aSelection,
                            nsPoint& aPoint,
                            nsRect* aScreenRect)
 {
-  // create a temporary rendering context for text measuring
-  nsCOMPtr<nsIRenderingContext> tmprc;
-  nsresult rv = CreateRenderingContext(GetRootFrame(), getter_AddRefs(tmprc));
-  NS_ENSURE_SUCCESS(rv, nsnull);
-
   // area will hold the size of the surface needed to draw the selection,
   // measured from the root frame.
   nsRect area;
   nsTArray<nsAutoPtr<RangePaintInfo> > rangeItems;
 
   // iterate over each range and collect them into the rangeItems array.
   // This is done so that the size of selection can be determined so as
   // to allocate a surface area
@@ -5158,17 +5141,17 @@ PresShell::RenderSelection(nsISelection*
   aSelection->GetRangeCount(&numRanges);
   NS_ASSERTION(numRanges > 0, "RenderSelection called with no selection");
 
   for (PRInt32 r = 0; r < numRanges; r++)
   {
     nsCOMPtr<nsIDOMRange> range;
     aSelection->GetRangeAt(r, getter_AddRefs(range));
 
-    RangePaintInfo* info = CreateRangePaintInfo(range, tmprc, area);
+    RangePaintInfo* info = CreateRangePaintInfo(range, area);
     if (info && !rangeItems.AppendElement(info)) {
       delete info;
       return nsnull;
     }
   }
 
   return PaintRangePaintInfo(&rangeItems, aSelection, nsnull, area, aPoint,
                              aScreenRect);
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -4275,17 +4275,17 @@ nsFrame::GetSelected(PRBool *aSelected) 
 {
   if (!aSelected )
     return NS_ERROR_NULL_POINTER;
   *aSelected = (PRBool)(mState & NS_FRAME_SELECTED_CONTENT);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFrame::GetPointFromOffset(nsPresContext* inPresContext, nsIRenderingContext* inRendContext, PRInt32 inOffset, nsPoint* outPoint)
+nsFrame::GetPointFromOffset(PRInt32 inOffset, nsPoint* outPoint)
 {
   NS_PRECONDITION(outPoint != nsnull, "Null parameter");
   nsPoint bottomLeft(0, 0);
   if (mContent)
   {
     nsIContent* newContent = mContent->GetParent();
     if (newContent){
       PRInt32 newOffset = newContent->IndexOf(mContent);
--- a/layout/generic/nsFrame.h
+++ b/layout/generic/nsFrame.h
@@ -184,19 +184,17 @@ public:
                           nsGUIEvent*     aEvent,
                           nsEventStatus*  aEventStatus);
   NS_IMETHOD  GetContentForEvent(nsPresContext* aPresContext,
                                  nsEvent* aEvent,
                                  nsIContent** aContent);
   NS_IMETHOD  GetCursor(const nsPoint&    aPoint,
                         nsIFrame::Cursor& aCursor);
 
-  NS_IMETHOD  GetPointFromOffset(nsPresContext*        inPresContext,
-                                 nsIRenderingContext*   inRendContext,
-                                 PRInt32                inOffset,
+  NS_IMETHOD  GetPointFromOffset(PRInt32                inOffset,
                                  nsPoint*               outPoint);
 
   NS_IMETHOD  GetChildFrameContainingOffset(PRInt32     inContentOffset,
                                  PRBool                 inHint,
                                  PRInt32*               outFrameContentOffset,
                                  nsIFrame*              *outChildFrame);
 
   static nsresult  GetNextPrevLineFromeBlockFrame(nsPresContext* aPresContext,
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -97,20 +97,20 @@ struct nsPeekOffsetStruct;
 struct nsPoint;
 struct nsRect;
 struct nsSize;
 struct nsMargin;
 
 typedef class nsIFrame nsIBox;
 
 // IID for the nsIFrame interface 
-// 4c0cfb5b-864d-46c5-ad78-b1b4de35a4c3
+// 39681dd7-5db6-4e38-b84c-5d9a163c987a
 #define NS_IFRAME_IID \
-{ 0x4c0cfb5b, 0x864d, 0x46c5, \
-  { 0xad, 0x78, 0xb1, 0xb4, 0xde, 0x35, 0xa4, 0xc3 } }
+{ 0x39681dd7, 0x5db6, 0x4e38, \
+  { 0xb8, 0x4c, 0x5d, 0x9a, 0x16, 0x3c, 0x98, 0x7a } }
 
 /**
  * Indication of how the frame can be split. This is used when doing runaround
  * of floats, and when pulling up child frames from a next-in-flow.
  *
  * The choices are splittable, not splittable at all, and splittable in
  * a non-rectangular fashion. This last type only applies to block-level
  * elements, and indicates whether splitting can be used when doing runaround.
@@ -986,19 +986,17 @@ public:
   NS_IMETHOD  GetCursor(const nsPoint&  aPoint,
                         Cursor&         aCursor) = 0;
 
   /**
    * Get a point (in the frame's coordinate space) given an offset into
    * the content. This point should be on the baseline of text with
    * the correct horizontal offset
    */
-  NS_IMETHOD  GetPointFromOffset(nsPresContext*          inPresContext,
-                                 nsIRenderingContext*     inRendContext,
-                                 PRInt32                  inOffset,
+  NS_IMETHOD  GetPointFromOffset(PRInt32                  inOffset,
                                  nsPoint*                 outPoint) = 0;
   
   /**
    * Get the child frame of this frame which contains the given
    * content offset. outChildFrame may be this frame, or nsnull on return.
    * outContentOffset returns the content offset relative to the start
    * of the returned node. You can also pass a hint which tells the method
    * to stick to the end of the first found frame or the beginning of the 
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -6926,29 +6926,16 @@ nsTypedSelection::GetPointFromOffset(nsI
     return NS_ERROR_FAILURE;//nothing to do
   if (!aFrame || !aPoint)
     return NS_ERROR_NULL_POINTER;
 
   aPoint->x = 0;
   aPoint->y = 0;
 
   //
-  // Retrieve the device context. We need one to create
-  // a rendering context.
-  //
-
-  nsIPresShell *shell = mFrameSelection->GetShell();
-  if (!shell)
-    return NS_ERROR_NULL_POINTER;
-
-  nsPresContext *presContext = shell->GetPresContext();
-  if (!presContext)
-    return NS_ERROR_NULL_POINTER;
-  
-  //
   // Now get the closest view with a widget so we can create
   // a rendering context.
   //
 
   nsIWidget* widget = nsnull;
   nsIView *closestView = nsnull;
   nsPoint offset(0, 0);
 
@@ -6963,37 +6950,20 @@ nsTypedSelection::GetPointFromOffset(nsI
       closestView = closestView->GetParent();
     }
   }
 
   if (!closestView)
     return NS_ERROR_FAILURE;
 
   //
-  // Create a rendering context. This context is used by text frames
-  // to calculate text widths so it can figure out where the point is
-  // in the frame.
-  //
-
-  nsCOMPtr<nsIRenderingContext> rendContext;
-
-  rv = presContext->DeviceContext()->
-    CreateRenderingContext(closestView, *getter_AddRefs(rendContext));
-  
-  if (NS_FAILED(rv))
-    return rv;
-
-  if (!rendContext)
-    return NS_ERROR_NULL_POINTER;
-
-  //
   // Now get the point and return!
   //
 
-  rv = aFrame->GetPointFromOffset(presContext, rendContext, aContentOffset, aPoint);
+  rv = aFrame->GetPointFromOffset(aContentOffset, aPoint);
 
   return rv;
 }
 
 nsresult
 nsTypedSelection::GetSelectionRegionRectAndScrollableView(SelectionRegion aRegion, nsRect *aRect, nsIScrollableView **aScrollableView)
 {
   if (!mFrameSelection)
--- a/layout/generic/nsTextFrameThebes.cpp
+++ b/layout/generic/nsTextFrameThebes.cpp
@@ -398,19 +398,17 @@ public:
   
   // Update offsets to account for new length. This may clear mTextRun.
   void SetLength(PRInt32 aLength);
   
   NS_IMETHOD GetOffsets(PRInt32 &start, PRInt32 &end)const;
   
   virtual void AdjustOffsetsForBidi(PRInt32 start, PRInt32 end);
   
-  NS_IMETHOD GetPointFromOffset(nsPresContext*         inPresContext,
-                                nsIRenderingContext*    inRendContext,
-                                PRInt32                 inOffset,
+  NS_IMETHOD GetPointFromOffset(PRInt32                 inOffset,
                                 nsPoint*                outPoint);
   
   NS_IMETHOD  GetChildFrameContainingOffset(PRInt32     inContentOffset,
                                             PRBool                  inHint,
                                             PRInt32*                outFrameContentOffset,
                                             nsIFrame*               *outChildFrame);
   
   virtual PRBool IsVisibleInSelection(nsISelection* aSelection);
@@ -4517,22 +4515,20 @@ nsTextFrame::SetSelected(nsPresContext* 
       frame->SetSelected(aPresContext, aRange,aSelected,eSpreadNone);
       frame = frame->GetNextContinuation();
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsTextFrame::GetPointFromOffset(nsPresContext* aPresContext,
-                                nsIRenderingContext* inRendContext,
-                                PRInt32 inOffset,
+nsTextFrame::GetPointFromOffset(PRInt32 inOffset,
                                 nsPoint* outPoint)
 {
-  if (!aPresContext || !inRendContext || !outPoint)
+  if (!outPoint)
     return NS_ERROR_NULL_POINTER;
 
   outPoint->x = 0;
   outPoint->y = 0;
 
   DEBUG_VERIFY_NOT_DIRTY(mState);
   if (mState & NS_FRAME_IS_DIRTY)
     return NS_ERROR_UNEXPECTED;