Bug 704430 - Remove nsLayoutUtils::GetFrameFor. r=Ms2ger sr=roc
authorJignesh Kakadiya <jigneshhk1992@gmail.com>
Mon, 09 Jan 2012 10:56:04 +0100
changeset 85255 6a84838e8c98279465b523a513905effbff8953d
parent 85254 6d3dbf8ffab25e6f3938fd843c64388073ef1563
child 85256 a3a0382b5de842eb4b793aba6c815db31a9c2021
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger, roc
bugs704430
milestone12.0a1
Bug 704430 - Remove nsLayoutUtils::GetFrameFor. r=Ms2ger sr=roc
content/events/src/nsContentEventHandler.cpp
layout/base/nsLayoutUtils.h
--- a/content/events/src/nsContentEventHandler.cpp
+++ b/content/events/src/nsContentEventHandler.cpp
@@ -805,17 +805,17 @@ nsContentEventHandler::OnQueryCharacterA
   NS_ENSURE_TRUE(rootWidget, NS_ERROR_FAILURE);
 
   // The root frame's widget might be different, e.g., the event was fired on
   // a popup but the rootFrame is the document root.
   if (rootWidget != aEvent->widget) {
     NS_PRECONDITION(aEvent->widget, "The event must have the widget");
     nsIView* view = nsIView::GetViewFor(aEvent->widget);
     NS_ENSURE_TRUE(view, NS_ERROR_FAILURE);
-    rootFrame = nsLayoutUtils::GetFrameFor(view);
+    rootFrame = view->GetFrame();
     NS_ENSURE_TRUE(rootFrame, NS_ERROR_FAILURE);
     rootWidget = rootFrame->GetNearestWidget();
     NS_ENSURE_TRUE(rootWidget, NS_ERROR_FAILURE);
   }
 
   nsQueryContentEvent eventOnRoot(true, NS_QUERY_CHARACTER_AT_POINT,
                                   rootWidget);
   eventOnRoot.refPoint = aEvent->refPoint;
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -339,23 +339,16 @@ public:
   static nsIFrame* GetActiveScrolledRootFor(nsDisplayItem* aItem,
                                             nsDisplayListBuilder* aBuilder,
                                             bool* aShouldFixToViewport = nsnull);
 
   static bool ScrolledByViewportScrolling(nsIFrame* aActiveScrolledRoot,
                                             nsDisplayListBuilder* aBuilder);
 
   /**
-    * GetFrameFor returns the root frame for a view
-    * @param aView is the view to return the root frame for
-    * @return the root frame for the view
-    */
-  static nsIFrame* GetFrameFor(nsIView *aView) { return aView->GetFrame(); }
-
-  /**
     * GetScrollableFrameFor returns the scrollable frame for a scrolled frame
     */
   static nsIScrollableFrame* GetScrollableFrameFor(nsIFrame *aScrolledFrame);
 
   /**
    * GetNearestScrollableFrameForDirection locates the first ancestor of
    * aFrame (or aFrame itself) that is scrollable with overflow:scroll or
    * overflow:auto in the given direction and where either the scrollbar for