mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 846901 - Skip nsDisplayWrapList construction if there's only one item to wrap and it already has the right frame. r=mattwoodrow
This commit is contained in:
parent
95b5365899
commit
f935d48612
@ -2054,6 +2054,18 @@ IsRootScrollFrameActive(nsIPresShell* aPresShell)
|
||||
return sf && sf->IsScrollingActive();
|
||||
}
|
||||
|
||||
static nsDisplayItem*
|
||||
WrapInWrapList(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame, nsDisplayList* aList)
|
||||
{
|
||||
nsDisplayItem* item = aList->GetBottom();
|
||||
if (!item || item->GetAbove() || item->GetUnderlyingFrame() != aFrame) {
|
||||
return new (aBuilder) nsDisplayWrapList(aBuilder, aFrame, aList);
|
||||
}
|
||||
aList->RemoveBottom();
|
||||
return item;
|
||||
}
|
||||
|
||||
void
|
||||
nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aChild,
|
||||
@ -2288,7 +2300,7 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
|
||||
if (buildFixedPositionItem) {
|
||||
item = new (aBuilder) nsDisplayFixedPosition(aBuilder, child, child, &list);
|
||||
} else {
|
||||
item = new (aBuilder) nsDisplayWrapList(aBuilder, child, &list);
|
||||
item = WrapInWrapList(aBuilder, child, &list);
|
||||
}
|
||||
if (isSVG) {
|
||||
aLists.Content()->AppendNewToTop(item);
|
||||
@ -2311,8 +2323,7 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
} else if (!isSVG && disp->IsFloating(child)) {
|
||||
if (!list.IsEmpty()) {
|
||||
aLists.Floats()->AppendNewToTop(new (aBuilder)
|
||||
nsDisplayWrapList(aBuilder, child, &list));
|
||||
aLists.Floats()->AppendNewToTop(WrapInWrapList(aBuilder, child, &list));
|
||||
}
|
||||
} else {
|
||||
aLists.Content()->AppendToTop(&list);
|
||||
|
Loading…
Reference in New Issue
Block a user