Bug 841192. Part 14: Convert all usage of nsDisplayClip(RoundedRect) to use DisplayListClipState/DisplayItemClip. r=mattwoodrow
This patch does several things. Sorry. In BuildDisplayList implementations, instead of wrapping display items in nsDisplayClip, we push clip state onto the nsDisplayListBuilder and give the display items an explicit clip when they're created. In FrameLayerBuilder, we use the explicit clips we find on display items instead of computing our own. We remove nsDisplayClip and everything that depends on it. We remove ExplodeAnonymousChildLists. With nsDisplayClip gone, and nsDisplayOptionEventGrabber removed in a previous patch, there are no anonymous child lists. nsDisplayItem::TryMerge implementations need to make sure they have the same clip before being merged. I ripped out the part of PruneDisplayListForExtraPage that adjusts clip rects. As far as I can tell, it isn't actually necessary.
This commit is contained in:
@@ -351,20 +351,26 @@ nsFileControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayBoxShadowOuter(aBuilder, this));
|
||||
}
|
||||
|
||||
// Our background is inherited to the text input, and we don't really want to
|
||||
// paint it or out padding and borders (which we never have anyway, per
|
||||
// styles in forms.css) -- doing it just makes us look ugly in some cases and
|
||||
// has no effect in others.
|
||||
nsDisplayListCollection tempList;
|
||||
nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, tempList);
|
||||
|
||||
tempList.BorderBackground()->DeleteAll();
|
||||
|
||||
// Clip height only
|
||||
nsRect clipRect(aBuilder->ToReferenceFrame(this), GetSize());
|
||||
clipRect.width = GetVisualOverflowRect().XMost();
|
||||
nscoord radii[8] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
OverflowClip(aBuilder, tempList, aLists, clipRect, radii);
|
||||
|
||||
nsDisplayListCollection tempList;
|
||||
{
|
||||
DisplayListClipState::AutoSaveRestore saveClipState(aBuilder->ClipState());
|
||||
DisplayItemClip clipOnStack;
|
||||
aBuilder->ClipState().ClipContainingBlockDescendants(clipRect, nullptr, clipOnStack);
|
||||
|
||||
// Our background is inherited to the text input, and we don't really want to
|
||||
// paint it or out padding and borders (which we never have anyway, per
|
||||
// styles in forms.css) -- doing it just makes us look ugly in some cases and
|
||||
// has no effect in others.
|
||||
nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, tempList);
|
||||
}
|
||||
|
||||
tempList.BorderBackground()->DeleteAll();
|
||||
|
||||
tempList.MoveTo(aLists);
|
||||
|
||||
// Disabled file controls don't pass mouse events to their children, so we
|
||||
// put an invisible item in the display list above the children
|
||||
|
||||
Reference in New Issue
Block a user