Bug 1307134 - Rename nsGlobalWindow::EnsureSizeUpToDate to EnsureSizeAndPositionUpToDate. r=tnikkel
authorL. David Baron <dbaron@dbaron.org>
Tue, 18 Apr 2017 11:28:52 +0900
changeset 353551 3067c20eeccb1671b379ef882c37288219f4207b
parent 353550 ae32bc1ac57f30144fb13e82345f448ea44df579
child 353552 751cc121aa3f3243e94a97b71e5ae305978eb3e3
push id31671
push usercbook@mozilla.com
push dateTue, 18 Apr 2017 08:21:51 +0000
treeherdermozilla-central@bb38d935d699 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1307134
milestone55.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 1307134 - Rename nsGlobalWindow::EnsureSizeUpToDate to EnsureSizeAndPositionUpToDate. r=tnikkel This is because it does ensure both, and some of the callers care about size and some care about position. MozReview-Commit-ID: 3e8II6Lf72X
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
dom/base/nsPIDOMWindow.h
layout/base/nsLayoutUtils.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -5502,17 +5502,17 @@ nsGlobalWindow::CSSToDevIntPixels(nsIntS
     presContext->CSSPixelsToDevPixels(px.height));
 }
 
 nsresult
 nsGlobalWindow::GetInnerSize(CSSIntSize& aSize)
 {
   MOZ_ASSERT(IsOuterWindow());
 
-  EnsureSizeUpToDate();
+  EnsureSizeAndPositionUpToDate();
 
   NS_ENSURE_STATE(mDocShell);
 
   RefPtr<nsPresContext> presContext;
   mDocShell->GetPresContext(getter_AddRefs(presContext));
   RefPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
 
   if (!presContext || !presShell) {
@@ -5978,17 +5978,17 @@ nsRect
 nsGlobalWindow::GetInnerScreenRect()
 {
   MOZ_ASSERT(IsOuterWindow());
 
   if (!mDocShell) {
     return nsRect();
   }
 
-  EnsureSizeUpToDate();
+  EnsureSizeAndPositionUpToDate();
 
   if (!mDocShell) {
     return nsRect();
   }
 
   nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
   if (!presShell) {
     return nsRect();
@@ -6455,17 +6455,17 @@ nsGlobalWindow::GetScrollMaxY(ErrorResul
 CSSPoint
 nsGlobalWindow::GetScrollXY(bool aDoFlush)
 {
   MOZ_ASSERT(IsOuterWindow());
 
   if (aDoFlush) {
     FlushPendingNotifications(FlushType::Layout);
   } else {
-    EnsureSizeUpToDate();
+    EnsureSizeAndPositionUpToDate();
   }
 
   nsIScrollableFrame *sf = GetScrollFrame();
   if (!sf) {
     return CSSIntPoint(0, 0);
   }
 
   nsPoint scrollPos = sf->GetScrollPosition();
@@ -13213,17 +13213,17 @@ void
 nsGlobalWindow::FlushPendingNotifications(FlushType aType)
 {
   if (mDoc) {
     mDoc->FlushPendingNotifications(aType);
   }
 }
 
 void
-nsGlobalWindow::EnsureSizeUpToDate()
+nsGlobalWindow::EnsureSizeAndPositionUpToDate()
 {
   MOZ_ASSERT(IsOuterWindow());
 
   // If we're a subframe, make sure our size is up to date.  It's OK that this
   // crosses the content/chrome boundary, since chrome can have pending reflows
   // too.
   nsGlobalWindow *parent = nsGlobalWindow::Cast(GetPrivateParent());
   if (parent) {
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -418,17 +418,17 @@ public:
 
   // Outer windows only.
   void DispatchDOMWindowCreated();
 
   virtual void SetOpenerWindow(nsPIDOMWindowOuter* aOpener,
                                bool aOriginalOpener) override;
 
   // Outer windows only.
-  virtual void EnsureSizeUpToDate() override;
+  virtual void EnsureSizeAndPositionUpToDate() override;
 
   virtual void EnterModalState() override;
   virtual void LeaveModalState() override;
 
   // Outer windows only.
   virtual bool CanClose() override;
   virtual void ForceClose() override;
 
--- a/dom/base/nsPIDOMWindow.h
+++ b/dom/base/nsPIDOMWindow.h
@@ -313,17 +313,17 @@ public:
   virtual void SetOpenerWindow(nsPIDOMWindowOuter* aOpener,
                                bool aOriginalOpener) = 0;
 
   /**
    * Ensure the size and position of this window are up-to-date by doing
    * a layout flush in the parent (which will in turn, do a layout flush
    * in its parent, etc.).
    */
-  virtual void EnsureSizeUpToDate() = 0;
+  virtual void EnsureSizeAndPositionUpToDate() = 0;
 
   /**
    * Callback for notifying a window about a modal dialog being
    * opened/closed with the window as a parent.
    */
   virtual void EnterModalState() = 0;
   virtual void LeaveModalState() = 0;
 
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -7139,17 +7139,17 @@ nsLayoutUtils::GetDeviceContextForScreen
     // the caller.  It will also make sure that our prescontext has been created,
     // if we're supposed to have one.
     nsCOMPtr<nsPIDOMWindowOuter> win = docShell->GetWindow();
     if (!win) {
       // No reason to go on
       return nullptr;
     }
 
-    win->EnsureSizeUpToDate();
+    win->EnsureSizeAndPositionUpToDate();
 
     RefPtr<nsPresContext> presContext;
     docShell->GetPresContext(getter_AddRefs(presContext));
     if (presContext) {
       nsDeviceContext* context = presContext->DeviceContext();
       if (context) {
         return context;
       }