Bug 1126230 part 7 - Add static method nsDisplayListBuilder::GetOutOfFlowData(). r=roc
authorXidorn Quan <quanxunzhen@gmail.com>
Wed, 07 Oct 2015 14:04:32 +1100
changeset 266479 4ebcc266fc3543ea447c53de29d85e1a83234077
parent 266478 1951399af17f9fe43a8b465059667e4873f84de3
child 266480 e6bc3e58c8acdafab75f38ddd2b2bc992bb01895
push id29493
push userkwierso@gmail.com
push dateWed, 07 Oct 2015 17:31:17 +0000
treeherdermozilla-central@49d87bbe0122 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1126230
milestone44.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 1126230 part 7 - Add static method nsDisplayListBuilder::GetOutOfFlowData(). r=roc
layout/base/nsDisplayList.h
layout/generic/nsFrame.cpp
--- a/layout/base/nsDisplayList.h
+++ b/layout/base/nsDisplayList.h
@@ -859,16 +859,23 @@ public:
       : mDirtyRect(aDirtyRect)
     {}
     DisplayItemClip mContainingBlockClip;
     nsRect mDirtyRect;
   };
 
   NS_DECLARE_FRAME_PROPERTY(OutOfFlowDisplayDataProperty,
                             DeleteValue<OutOfFlowDisplayData>)
+
+  static OutOfFlowDisplayData* GetOutOfFlowData(nsIFrame* aFrame)
+  {
+    return static_cast<OutOfFlowDisplayData*>(
+      aFrame->Properties().Get(OutOfFlowDisplayDataProperty()));
+  }
+
   NS_DECLARE_FRAME_PROPERTY(Preserve3DDirtyRectProperty, DeleteValue<nsRect>)
 
   nsPresContext* CurrentPresContext() {
     return CurrentPresShellState()->mPresShell->GetPresContext();
   }
 
   /**
    * Accumulates the bounds of box frames that have moz-appearance
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2328,18 +2328,17 @@ nsIFrame::BuildDisplayListForChild(nsDis
       return;
     // Make sure that any attempt to use childType below is disappointed. We
     // could call GetType again but since we don't currently need it, let's
     // avoid the virtual call.
     childType = nullptr;
     // Recheck NS_FRAME_TOO_DEEP_IN_FRAME_TREE
     if (child->GetStateBits() & NS_FRAME_TOO_DEEP_IN_FRAME_TREE)
       return;
-    savedOutOfFlowData = static_cast<nsDisplayListBuilder::OutOfFlowDisplayData*>
-      (child->Properties().Get(nsDisplayListBuilder::OutOfFlowDisplayDataProperty()));
+    savedOutOfFlowData = nsDisplayListBuilder::GetOutOfFlowData(child);
     if (savedOutOfFlowData) {
       dirty = savedOutOfFlowData->mDirtyRect;
     } else {
       // The out-of-flow frame did not intersect the dirty area. We may still
       // need to traverse into it, since it may contain placeholders we need
       // to enter to reach other out-of-flow frames that are visible.
       dirty.SetEmpty();
     }