Backed out changeset af7955546902 (bug 1342009) for mochitest failures

This commit is contained in:
Carsten "Tomcat" Book 2017-04-20 11:39:31 +02:00
Родитель a95a0d86fa
Коммит b174b84642
2 изменённых файлов: 29 добавлений и 116 удалений

Просмотреть файл

@ -977,8 +977,7 @@ nsFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
PresContext()->SetBidiEnabled();
}
RemoveStateBits(NS_FRAME_SIMPLE_EVENT_REGIONS |
NS_FRAME_SIMPLE_DISPLAYLIST);
RemoveStateBits(NS_FRAME_SIMPLE_EVENT_REGIONS);
}
void
@ -2157,10 +2156,8 @@ nsIFrame::GetClipPropClipRect(const nsStyleDisplay* aDisp,
* handled by constructing a dedicated nsHTML/XULScrollFrame, set up clipping
* for that overflow in aBuilder->ClipState() to clip all containing-block
* descendants.
*
* Return true if clipping was applied.
*/
static bool
static void
ApplyOverflowClipping(nsDisplayListBuilder* aBuilder,
const nsIFrame* aFrame,
const nsStyleDisplay* aDisp,
@ -2172,7 +2169,7 @@ ApplyOverflowClipping(nsDisplayListBuilder* aBuilder,
// is required by comboboxes which make their display text (an inline frame)
// have clipping.
if (!nsFrame::ShouldApplyOverflowClipping(aFrame, aDisp)) {
return false;
return;
}
nsRect clipRect;
bool haveRadii = false;
@ -2188,7 +2185,6 @@ ApplyOverflowClipping(nsDisplayListBuilder* aBuilder,
// XXX border-radius
}
aClipState.ClipContainingBlockDescendantsExtra(clipRect, haveRadii ? radii : nullptr);
return true;
}
#ifdef DEBUG
@ -2868,45 +2864,6 @@ WrapInWrapList(nsDisplayListBuilder* aBuilder,
return item;
}
/**
* Check if a frame should be visited for building display list.
*/
static bool
DescendIntoChild(nsDisplayListBuilder* aBuilder, nsIFrame *aChild,
const nsRect& aDirty)
{
nsIFrame* child = aChild;
const nsRect& dirty = aDirty;
if (!(child->GetStateBits() & NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO)) {
// No need to descend into child to catch placeholders for visible
// positioned stuff. So see if we can short-circuit frame traversal here.
// We can stop if child's frame subtree's intersection with the
// dirty area is empty.
// If the child is a scrollframe that we want to ignore, then we need
// to descend into it because its scrolled child may intersect the dirty
// area even if the scrollframe itself doesn't.
// There are cases where the "ignore scroll frame" on the builder is not set
// correctly, and so we additionally want to catch cases where the child is
// a root scrollframe and we are ignoring scrolling on the viewport.
nsIPresShell* shell = child->PresContext()->PresShell();
bool keepDescending = child == aBuilder->GetIgnoreScrollFrame() ||
(shell->IgnoringViewportScrolling() && child == shell->GetRootScrollFrame());
if (!keepDescending) {
nsRect childDirty;
if (!childDirty.IntersectRect(dirty, child->GetVisualOverflowRect()))
return false;
// Usually we could set dirty to childDirty now but there's no
// benefit, and it can be confusing. It can especially confuse
// situations where we're going to ignore a scrollframe's clipping;
// we wouldn't want to clip the dirty area to the scrollframe's
// bounds in that case.
}
}
return true;
}
void
nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
nsIFrame* aChild,
@ -2929,59 +2886,11 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
if (child->GetStateBits() & NS_FRAME_TOO_DEEP_IN_FRAME_TREE)
return;
const bool doingShortcut =
(child->GetStateBits() & NS_FRAME_SIMPLE_DISPLAYLIST) &&
aBuilder->IsPaintingToWindow() &&
// This would be changed by the change of preference.
aBuilder->IsBuildingLayerEventRegions() &&
// Animations may change the value of |HasOpacity()|.
!(child->GetContent() &&
child->GetContent()->MayHaveAnimations());
if (doingShortcut) {
// This is the shortcut for frames been handled along the common
// path, the most common one of THE COMMON CASE mentioned later.
MOZ_ASSERT(child->GetType() != nsGkAtoms::placeholderFrame);
MOZ_ASSERT(!aBuilder->GetSelectedFramesOnly() &&
!aBuilder->GetIncludeAllOutOfFlows(),
"It should be held for painting to window");
// dirty rect in child-relative coordinates
nsRect dirty = aDirtyRect - child->GetOffsetTo(this);
if (!DescendIntoChild(aBuilder, child, dirty)) {
return;
}
nsDisplayListBuilder::AutoBuildingDisplayList
buildingForChild(aBuilder, child, dirty, false);
CheckForApzAwareEventHandlers(aBuilder, child);
nsDisplayLayerEventRegions* eventRegions = aBuilder->GetLayerEventRegions();
if (eventRegions) {
eventRegions->AddFrame(aBuilder, child);
}
child->MarkAbsoluteFramesForDisplayList(aBuilder, dirty);
aBuilder->AdjustWindowDraggingRegion(child);
child->BuildDisplayList(aBuilder, dirty, aLists);
aBuilder->DisplayCaret(child, dirty, aLists.Content());
#ifdef DEBUG
DisplayDebugBorders(aBuilder, child, aLists);
#endif
return;
}
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 &&
(aFlags & DISPLAY_CHILD_INLINE) &&
!child->IsFrameOfType(eLineParticipant)) {
@ -2989,7 +2898,6 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
// it acts like inline-block or inline-table. Therefore it is a
// pseudo-stacking-context.
pseudoStackingContext = true;
awayFromCommonPath = true;
}
// dirty rect in child-relative coordinates
@ -3035,7 +2943,6 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
dirty.SetEmpty();
}
pseudoStackingContext = true;
awayFromCommonPath = true;
}
NS_ASSERTION(childType != nsGkAtoms::placeholderFrame,
@ -3049,9 +2956,31 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
if (aBuilder->GetIncludeAllOutOfFlows() &&
(child->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) {
dirty = child->GetVisualOverflowRect();
awayFromCommonPath = true;
} else if (!DescendIntoChild(aBuilder, child, dirty)) {
return;
} else if (!(child->GetStateBits() & NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO)) {
// No need to descend into child to catch placeholders for visible
// positioned stuff. So see if we can short-circuit frame traversal here.
// We can stop if child's frame subtree's intersection with the
// dirty area is empty.
// If the child is a scrollframe that we want to ignore, then we need
// to descend into it because its scrolled child may intersect the dirty
// area even if the scrollframe itself doesn't.
// There are cases where the "ignore scroll frame" on the builder is not set
// correctly, and so we additionally want to catch cases where the child is
// a root scrollframe and we are ignoring scrolling on the viewport.
nsIPresShell* shell = PresContext()->PresShell();
bool keepDescending = child == aBuilder->GetIgnoreScrollFrame() ||
(shell->IgnoringViewportScrolling() && child == shell->GetRootScrollFrame());
if (!keepDescending) {
nsRect childDirty;
if (!childDirty.IntersectRect(dirty, child->GetVisualOverflowRect()))
return;
// Usually we could set dirty to childDirty now but there's no
// benefit, and it can be confusing. It can especially confuse
// situations where we're going to ignore a scrollframe's clipping;
// we wouldn't want to clip the dirty area to the scrollframe's
// bounds in that case.
}
}
// XXX need to have inline-block and inline-table set pseudoStackingContext
@ -3068,7 +2997,6 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
// within the displayport.
if (aBuilder->IsPaintingToWindow() && child->TrackingVisibility()) {
child->PresContext()->PresShell()->EnsureFrameInApproximatelyVisibleList(child);
awayFromCommonPath = true;
}
// Child is composited if it's transformed, partially transparent, or has
@ -3100,7 +3028,6 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
(aFlags & DISPLAY_CHILD_FORCE_STACKING_CONTEXT)) {
// If you change this, also change IsPseudoStackingContextFromStyle()
pseudoStackingContext = true;
awayFromCommonPath = true;
}
NS_ASSERTION(!isStackingContext || pseudoStackingContext,
"Stacking contexts must also be pseudo-stacking-contexts");
@ -3118,7 +3045,6 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
savedOutOfFlowData->mContainingBlockClipChain);
asrSetter.SetCurrentActiveScrolledRoot(
savedOutOfFlowData->mContainingBlockActiveScrolledRoot);
MOZ_ASSERT(awayFromCommonPath, "It is impossible when savedOutOfFlowData is true");
} else if (GetStateBits() & NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO &&
isPlaceholder) {
NS_ASSERTION(dirty.IsEmpty(), "should have empty dirty rect");
@ -3132,7 +3058,6 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
// 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,
@ -3146,9 +3071,7 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
nsIFrame* parent = child->GetParent();
const nsStyleDisplay* parentDisp =
parent == this ? ourDisp : parent->StyleDisplay();
if (ApplyOverflowClipping(aBuilder, parent, parentDisp, clipState)) {
awayFromCommonPath = true;
}
ApplyOverflowClipping(aBuilder, parent, parentDisp, clipState);
nsDisplayList list;
nsDisplayList extraPositionedDescendants;
@ -3171,7 +3094,6 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
dirty.IntersectRect(dirty, *clipPropClip);
clipState.ClipContentDescendants(
*clipPropClip + aBuilder->ToReferenceFrame(child));
awayFromCommonPath = true;
}
child->MarkAbsoluteFramesForDisplayList(aBuilder, dirty);
@ -3197,11 +3119,6 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
if (eventRegions) {
eventRegions->AddFrame(aBuilder, child);
}
if (!awayFromCommonPath &&
aBuilder->IsPaintingToWindow()) {
// The shortcut is available for the child for next time.
child->AddStateBits(NS_FRAME_SIMPLE_DISPLAYLIST);
}
}
}

Просмотреть файл

@ -273,10 +273,6 @@ FRAME_STATE_BIT(Generic, 55, NS_FRAME_OWNS_ANON_BOXES)
// Frame has properties in the nsIFrame::Properties() hash.
FRAME_STATE_BIT(Generic, 56, NS_FRAME_HAS_PROPERTIES)
// The display list of the frame can be handled by the shortcut for
// COMMON CASE.
FRAME_STATE_BIT(Generic, 57, NS_FRAME_SIMPLE_DISPLAYLIST)
// Set for all descendants of MathML sub/supscript elements (other than the
// base frame) to indicate that the SSTY font feature should be used.
FRAME_STATE_BIT(Generic, 58, NS_FRAME_MATHML_SCRIPT_DESCENDANT)