Bug 1082486 - Part 2 - Make GetCanvasFrame() returns nsCanvasFrame*. r=roc
authorTing-Yu Lin <tlin@mozilla.com>
Tue, 14 Oct 2014 03:07:00 +0200
changeset 211193 a1c2b6323e6ea305c2952aaa41a0f517210d735e
parent 211192 c39e875e01f3ba63ea2f1d1e91d00c96a42f3051
child 211194 b66bcf105809c23610c6e9ad247efb7e2ad102d0
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersroc
bugs1082486
milestone36.0a1
Bug 1082486 - Part 2 - Make GetCanvasFrame() returns nsCanvasFrame*. r=roc PresShell::GetCanvasFrame() already returns nsCanvasFrame*, and it's needed to access nsCanvasFrame's method in a later patch.
layout/base/TouchCaret.cpp
layout/base/TouchCaret.h
--- a/layout/base/TouchCaret.cpp
+++ b/layout/base/TouchCaret.cpp
@@ -108,17 +108,17 @@ TouchCaret::GetCaretFocusFrame(nsRect* a
 
   if (aOutRect) {
     *aOutRect = rect;
   }
 
   return frame;
 }
 
-nsIFrame*
+nsCanvasFrame*
 TouchCaret::GetCanvasFrame()
 {
   nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShell);
   if (!presShell) {
     return nullptr;
   }
   return presShell->GetCanvasFrame();
 }
--- a/layout/base/TouchCaret.h
+++ b/layout/base/TouchCaret.h
@@ -10,16 +10,17 @@
 #include "nsISelectionListener.h"
 #include "nsIScrollObserver.h"
 #include "nsIWeakReferenceUtils.h"
 #include "nsITimer.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/TouchEvents.h"
 #include "Units.h"
 
+class nsCanvasFrame;
 class nsIFrame;
 class nsIPresShell;
 
 namespace mozilla {
 
 /**
  * The TouchCaret places a touch caret according to caret position when the
  * caret is shown.
@@ -79,17 +80,17 @@ private:
   /**
    * Helper function to get caret's focus frame and caret's bounding rect.
    */
   nsIFrame* GetCaretFocusFrame(nsRect* aOutRect = nullptr);
 
   /**
    * Find the nsCanvasFrame which holds the touch caret.
    */
-  nsIFrame* GetCanvasFrame();
+  nsCanvasFrame* GetCanvasFrame();
 
   /**
    * Retrieve the bounding rectangle of the touch caret.
    *
    * @returns A nsRect representing the bounding rectangle of this touch caret.
    *          The returned offset is relative to the canvas frame.
    */
   nsRect GetTouchFrameRect();