bug 1030741 - Make FrameMetrics::mIsRoot private and add getter/setter methods to manipulate it. r=kats
authorEmma Benoit <kylma@kylma.fr>
Sat, 23 Aug 2014 19:09:10 -0400
changeset 222933 1135f5842f1f708ffb2156ce797a73320cb0832f
parent 222932 00188cde54d6d8a1528933c4b6ecff8a97b7d9ec
child 222934 e6abbd1b9555865c077ebfb5b269ec24b33c4a3b
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1030741
milestone34.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 1030741 - Make FrameMetrics::mIsRoot private and add getter/setter methods to manipulate it. r=kats
dom/ipc/TabChild.cpp
gfx/layers/FrameMetrics.h
gfx/layers/apz/src/AsyncPanZoomController.cpp
layout/base/nsDisplayList.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -436,17 +436,17 @@ TabChildBase::DispatchMessageManagerMess
                        aMessageName, false, &cloneData, nullptr, nullptr, nullptr);
 }
 
 bool
 TabChildBase::UpdateFrameHandler(const FrameMetrics& aFrameMetrics)
 {
   MOZ_ASSERT(aFrameMetrics.GetScrollId() != FrameMetrics::NULL_SCROLL_ID);
 
-  if (aFrameMetrics.mIsRoot) {
+  if (aFrameMetrics.GetIsRoot()) {
     nsCOMPtr<nsIDOMWindowUtils> utils(GetDOMWindowUtils());
     if (APZCCallbackHelper::HasValidPresShellId(utils, aFrameMetrics)) {
       mLastRootMetrics = ProcessUpdateFrame(aFrameMetrics);
       APZCCallbackHelper::UpdateCallbackTransform(aFrameMetrics, mLastRootMetrics);
       return true;
     }
   } else {
     // aFrameMetrics.mIsRoot is false, so we are trying to update a subframe.
--- a/gfx/layers/FrameMetrics.h
+++ b/gfx/layers/FrameMetrics.h
@@ -332,20 +332,27 @@ public:
   CSSToLayoutDeviceScale mDevPixelsPerCSSPixel;
 
   // Whether or not this frame may have touch listeners.
   bool mMayHaveTouchListeners;
 
   // Whether or not this frame may have touch caret.
   bool mMayHaveTouchCaret;
 
-  // Whether or not this is the root scroll frame for the root content document.
-  bool mIsRoot;
+public:
+  void SetIsRoot(bool aIsRoot)
+  {
+    mIsRoot = aIsRoot;
+  }
 
-public:
+  bool GetIsRoot() const
+  {
+    return mIsRoot;
+  }
+
   void SetHasScrollgrab(bool aHasScrollgrab)
   {
     mHasScrollgrab = aHasScrollgrab;
   }
 
   bool GetHasScrollgrab() const
   {
     return mHasScrollgrab;
@@ -446,16 +453,19 @@ public:
   {
     return mViewport;
   }
 
 private:
   // New fields from now on should be made private and old fields should
   // be refactored to be private.
 
+  // Whether or not this is the root scroll frame for the root content document.
+  bool mIsRoot;
+
   // Whether or not this frame is for an element marked 'scrollgrab'.
   bool mHasScrollgrab;
 
   // A unique ID assigned to each scrollable frame.
   ViewID mScrollId;
 
   // The position of the top-left of the CSS viewport, relative to the document
   // (or the document relative to the viewport, if that helps understand it).
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -2859,17 +2859,17 @@ void AsyncPanZoomController::SendAsyncSc
   }
 
   bool isRoot;
   CSSRect contentRect;
   CSSSize scrollableSize;
   {
     ReentrantMonitorAutoEnter lock(mMonitor);
 
-    isRoot = mFrameMetrics.mIsRoot;
+    isRoot = mFrameMetrics.GetIsRoot();
     scrollableSize = mFrameMetrics.mScrollableRect.Size();
     contentRect = mFrameMetrics.CalculateCompositedRectInCssPixels();
     contentRect.MoveTo(mCurrentAsyncScrollOffset);
   }
 
   controller->SendAsyncScrollDOMEvent(isRoot, contentRect, scrollableSize);
 }
 
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -699,17 +699,17 @@ static void RecordFrameMetrics(nsIFrame*
     // its scroll offset.
     nsIAtom* originOfLastScroll = scrollableFrame->OriginOfLastScroll();
     if (originOfLastScroll && originOfLastScroll != nsGkAtoms::apz) {
       metrics.SetScrollOffsetUpdated(scrollableFrame->CurrentScrollGeneration());
     }
   }
 
   metrics.SetScrollId(scrollId);
-  metrics.mIsRoot = aIsRoot;
+  metrics.SetIsRoot(aIsRoot);
 
   // Only the root scrollable frame for a given presShell should pick up
   // the presShell's resolution. All the other frames are 1.0.
   if (aScrollFrame == presShell->GetRootScrollFrame()) {
     metrics.mResolution = ParentLayerToLayerScale(presShell->GetXResolution(),
                                                   presShell->GetYResolution());
   } else {
     metrics.mResolution = ParentLayerToLayerScale(1.0f);