Bug 1236828 part 2 - Apply proper clip state for top layer frames. r?mattwoodrow draft
authorXidorn Quan <quanxunzhen@gmail.com>
Wed, 06 Apr 2016 18:48:31 +1000
changeset 347992 a40ca7215aa61ec833a5f441f599eebca46bffd0
parent 347991 d90579dedddc676807d7bd829281552629eba707
child 347993 ede61fb46d963115c97ec28e6df4ade55e71d78f
push id14721
push userxquan@mozilla.com
push dateWed, 06 Apr 2016 08:50:23 +0000
reviewersmattwoodrow
bugs1236828
milestone48.0a1
Bug 1236828 part 2 - Apply proper clip state for top layer frames. r?mattwoodrow MozReview-Commit-ID: JW2tAFu4wIP
layout/generic/nsViewportFrame.cpp
--- a/layout/generic/nsViewportFrame.cpp
+++ b/layout/generic/nsViewportFrame.cpp
@@ -94,20 +94,25 @@ ShouldInTopLayerForFullscreen(Element* a
 #endif // DEBUG
 
 static void
 BuildDisplayListForTopLayerFrame(nsDisplayListBuilder* aBuilder,
                                  nsIFrame* aFrame,
                                  nsDisplayList* aList)
 {
   nsRect dirty;
+  DisplayListClipState::AutoClipMultiple clipState(aBuilder);
   nsDisplayListBuilder::OutOfFlowDisplayData*
     savedOutOfFlowData = nsDisplayListBuilder::GetOutOfFlowData(aFrame);
   if (savedOutOfFlowData) {
     dirty = savedOutOfFlowData->mDirtyRect;
+    clipState.SetClipForContainingBlockDescendants(
+      &savedOutOfFlowData->mContainingBlockClip);
+    clipState.SetScrollClipForContainingBlockDescendants(
+      savedOutOfFlowData->mContainingBlockScrollClip);
   }
   nsDisplayList list;
   aFrame->BuildDisplayListForStackingContext(aBuilder, dirty, &list);
   aList->AppendToTop(&list);
 }
 
 void
 ViewportFrame::BuildDisplayListForTopLayer(nsDisplayListBuilder* aBuilder,