--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -3539,35 +3539,35 @@ nsIFrame::BuildDisplayListForChild(nsDis
child->BuildDisplayList(aBuilder, aLists);
aBuilder->DisplayCaret(child, aLists.Content());
#ifdef DEBUG
DisplayDebugBorders(aBuilder, child, aLists);
#endif
return;
}
- bool isSVG = (child->GetStateBits() & NS_FRAME_SVG_LAYOUT);
+ const bool isSVG = child->GetStateBits() & NS_FRAME_SVG_LAYOUT;
// It is raised if the control flow strays off the common path.
// The common path is the most common one of THE COMMON CASE
// mentioned later.
bool awayFromCommonPath = false;
// true if this is a real or pseudo stacking context
bool pseudoStackingContext =
(aFlags & DISPLAY_CHILD_FORCE_PSEUDO_STACKING_CONTEXT) != 0;
- awayFromCommonPath |= pseudoStackingContext;
- if (!isSVG &&
+
+ if (!pseudoStackingContext &&
+ !isSVG &&
(aFlags & DISPLAY_CHILD_INLINE) &&
!child->IsFrameOfType(eLineParticipant)) {
// child is a non-inline frame in an inline context, i.e.,
// it acts like inline-block or inline-table. Therefore it is a
// pseudo-stacking-context.
pseudoStackingContext = true;
- awayFromCommonPath = true;
}
nsDisplayListBuilder::OutOfFlowDisplayData* savedOutOfFlowData = nullptr;
bool isPlaceholder = false;
if (child->IsPlaceholderFrame()) {
isPlaceholder = true;
nsPlaceholderFrame* placeholder = static_cast<nsPlaceholderFrame*>(child);
child = placeholder->GetOutOfFlowFrame();
@@ -3596,18 +3596,18 @@ nsIFrame::BuildDisplayListForChild(nsDis
visible = savedOutOfFlowData->GetVisibleRectForFrame(aBuilder, child, &dirty);
} 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.
visible.SetEmpty();
dirty.SetEmpty();
}
+
pseudoStackingContext = true;
- awayFromCommonPath = true;
}
const nsStyleDisplay* disp = child->StyleDisplay();
if (child->HasPerspective(disp)) {
// We need to allocate a perspective index before a potential early
// return below.
aBuilder->AllocatePerspectiveItemIndex();
@@ -3616,21 +3616,19 @@ nsIFrame::BuildDisplayListForChild(nsDis
NS_ASSERTION(!child->IsPlaceholderFrame(),
"Should have dealt with placeholders already");
if (aBuilder->GetSelectedFramesOnly() &&
child->IsLeaf() &&
!aChild->IsSelected()) {
return;
}
- if (aBuilder->GetIncludeAllOutOfFlows() &&
- (child->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) {
+ if (aBuilder->GetIncludeAllOutOfFlows() && isPlaceholder) {
visible = child->GetVisualOverflowRect();
dirty = child->GetVisualOverflowRect();
- awayFromCommonPath = true;
} else if (!DescendIntoChild(aBuilder, child, visible, dirty)) {
return;
}
// XXX need to have inline-block and inline-table set pseudoStackingContext
const nsStyleDisplay* ourDisp = StyleDisplay();
// REVIEW: Taken from nsBoxFrame::Paint
@@ -3649,30 +3647,35 @@ nsIFrame::BuildDisplayListForChild(nsDis
child->SetBuiltDisplayList(true);
// Child is composited if it's transformed, partially transparent, or has
// SVG effects or a blend mode..
EffectSet* effectSet = EffectSet::GetEffectSet(child);
const nsStyleEffects* effects = child->StyleEffects();
const nsStylePosition* pos = child->StylePosition();
- bool isVisuallyAtomic = child->IsVisuallyAtomic(effectSet, disp, effects);
- bool isPositioned = disp->IsAbsPosContainingBlock(child);
- bool isStackingContext = child->IsStackingContext(disp, pos, isPositioned, isVisuallyAtomic) ||
- (aFlags & DISPLAY_CHILD_FORCE_STACKING_CONTEXT);
-
- if (isVisuallyAtomic || isPositioned || (!isSVG && disp->IsFloating(child)) ||
- ((effects->mClipFlags & NS_STYLE_CLIP_RECT) &&
- IsSVGContentWithCSSClip(child)) ||
- disp->mIsolation != NS_STYLE_ISOLATION_AUTO ||
- (disp->mWillChangeBitField & NS_STYLE_WILL_CHANGE_STACKING_CONTEXT) ||
- (aFlags & DISPLAY_CHILD_FORCE_STACKING_CONTEXT)) {
+
+ const bool isVisuallyAtomic =
+ child->IsVisuallyAtomic(effectSet, disp, effects);
+
+ const bool isPositioned =
+ disp->IsAbsPosContainingBlock(child);
+
+ const bool isStackingContext =
+ child->IsStackingContext(disp, pos, isPositioned, isVisuallyAtomic) ||
+ (aFlags & DISPLAY_CHILD_FORCE_STACKING_CONTEXT);
+
+ if (pseudoStackingContext || isStackingContext || isPositioned ||
+ (!isSVG && disp->IsFloating(child)) ||
+ (isSVG && (effects->mClipFlags & NS_STYLE_CLIP_RECT) &&
+ IsSVGContentWithCSSClip(child))) {
pseudoStackingContext = true;
awayFromCommonPath = true;
}
+
NS_ASSERTION(!isStackingContext || pseudoStackingContext,
"Stacking contexts must also be pseudo-stacking-contexts");
nsDisplayListBuilder::AutoBuildingDisplayList
buildingForChild(aBuilder, child, visible, dirty, pseudoStackingContext);
DisplayListClipState::AutoClipMultiple clipState(aBuilder);
nsDisplayListBuilder::AutoCurrentActiveScrolledRootSetter asrSetter(aBuilder);
CheckForApzAwareEventHandlers(aBuilder, child);
@@ -3693,17 +3696,16 @@ nsIFrame::BuildDisplayListForChild(nsDis
// restored when AutoBuildingDisplayList gets out of scope.
aBuilder->SetBuildingInvisibleItems(true);
// 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.SetClipChainForContainingBlockDescendants(nullptr);
- awayFromCommonPath = true;
}
// 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.
// Don't use overflowClip to restrict the dirty rect, since some of the