Bug 1277123 - Only clear the containing block clip when entering an out of flow with an unknown clip. r=mattwoodrow, a=gchang
The content clip is still valid, as we are only descending into content descendants.
The clip for content descendants that the root scroll frame creates so content doesn't overflow (visually or for event handling) the main scrollbar can get cleared otherwise.
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2760,17 +2760,17 @@ nsIFrame::BuildDisplayListForChild(nsDis
clipState.SetScrollClipForContainingBlockDescendants(
savedOutOfFlowData->mContainingBlockScrollClip);
} else if (GetStateBits() & NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO &&
isPlaceholder) {
// If we have nested out-of-flow frames and the outer one isn't visible
// then we won't have stored clip data for it. We can just clear the clip
// instead since we know we won't render anything, and the inner out-of-flow
// frame will setup the correct clip for itself.
- clipState.Clear();
+ clipState.SetClipForContainingBlockDescendants(nullptr);
clipState.SetScrollClipForContainingBlockDescendants(nullptr);
}
// Setup clipping for the parent's overflow:-moz-hidden-unscrollable,
// or overflow:hidden on elements that don't support scrolling (and therefore
// don't create nsHTML/XULScrollFrame). This clipping needs to not clip
// anything directly rendered by the parent, only the rendering of its
// children.