зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1409114
- Part 7: Pass rects in display list coordinates to AppendBackgroundItemsToTop. r=miko
This helps for the next patch, since some of the table backgrounds items want to compute this without position:relative taken into account. Differential Revision: https://phabricator.services.mozilla.com/D29279 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
8bf47621c6
Коммит
1f9adb1ed4
|
@ -237,7 +237,7 @@ bool nsDisplayButtonBorder::CreateWebRenderCommands(
|
|||
nsDisplayListBuilder* aDisplayListBuilder) {
|
||||
// This is really a combination of paint box shadow inner +
|
||||
// paint border.
|
||||
nsRect buttonRect = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
||||
const nsRect buttonRect = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
||||
bool snap;
|
||||
nsRegion visible = GetBounds(aDisplayListBuilder, &snap);
|
||||
nsDisplayBoxShadowInner::CreateInsetBoxShadowWebRenderCommands(
|
||||
|
@ -394,7 +394,8 @@ nsresult nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
|
|||
GetFrame());
|
||||
}
|
||||
|
||||
nsRect buttonRect = mFrame->GetRectRelativeToSelf();
|
||||
nsRect buttonRect =
|
||||
mFrame->GetRectRelativeToSelf() + aBuilder->ToReferenceFrame(mFrame);
|
||||
|
||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, mFrame,
|
||||
buttonRect, aBackground);
|
||||
|
|
|
@ -224,9 +224,11 @@ void nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
IsVisibleForPainting()) {
|
||||
DisplayOutsetBoxShadowUnconditional(aBuilder, aLists.BorderBackground());
|
||||
|
||||
const nsRect rect =
|
||||
VisualBorderRectRelativeToSelf() + aBuilder->ToReferenceFrame(this);
|
||||
|
||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||
aBuilder, this, VisualBorderRectRelativeToSelf(),
|
||||
aLists.BorderBackground(),
|
||||
aBuilder, this, rect, aLists.BorderBackground(),
|
||||
/* aAllowWillPaintBorderOptimization = */ false);
|
||||
|
||||
aLists.BorderBackground()->AppendNewToTop<nsDisplayFieldSetBorder>(aBuilder,
|
||||
|
|
|
@ -2436,7 +2436,9 @@ bool nsFrame::DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder,
|
|||
!StyleBackground()->IsTransparent(this) ||
|
||||
StyleDisplay()->HasAppearance()) {
|
||||
return nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||
aBuilder, this, GetRectRelativeToSelf(), aLists.BorderBackground());
|
||||
aBuilder, this,
|
||||
GetRectRelativeToSelf() + aBuilder->ToReferenceFrame(this),
|
||||
aLists.BorderBackground());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1837,7 +1837,8 @@ void nsMathMLChar::Display(nsDisplayListBuilder* aBuilder, nsIFrame* aForFrame,
|
|||
NS_GET_A(computedStyle->StyleBackground()->BackgroundColor(
|
||||
computedStyle)) > 0) {
|
||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||
aBuilder, aForFrame, mRect, aLists.BorderBackground(),
|
||||
aBuilder, aForFrame, mRect + aBuilder->ToReferenceFrame(aForFrame),
|
||||
aLists.BorderBackground(),
|
||||
/* aAllowWillPaintBorderOptimization */ true, computedStyle);
|
||||
}
|
||||
// else
|
||||
|
|
|
@ -3820,10 +3820,10 @@ bool nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
|||
const nsRect& aBackgroundOriginRect, nsIFrame* aSecondaryReferenceFrame) {
|
||||
ComputedStyle* bgSC = aComputedStyle;
|
||||
const nsStyleBackground* bg = nullptr;
|
||||
nsRect bgRect = aBackgroundRect + aBuilder->ToReferenceFrame(aFrame);
|
||||
nsRect bgRect = aBackgroundRect;
|
||||
nsRect bgOriginRect = bgRect;
|
||||
if (!aBackgroundOriginRect.IsEmpty()) {
|
||||
bgOriginRect = aBackgroundOriginRect + aBuilder->ToReferenceFrame(aFrame);
|
||||
bgOriginRect = aBackgroundOriginRect;
|
||||
}
|
||||
nsPresContext* presContext = aFrame->PresContext();
|
||||
bool isThemed = aFrame->IsThemed();
|
||||
|
|
|
@ -450,12 +450,14 @@ void nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
aBuilder, this);
|
||||
}
|
||||
|
||||
nsRect bgRect = GetRectRelativeToSelf() + aBuilder->ToReferenceFrame(this);
|
||||
|
||||
// display background if we need to.
|
||||
if (aBuilder->IsForEventDelivery() ||
|
||||
!StyleBackground()->IsTransparent(this) ||
|
||||
StyleDisplay()->HasAppearance()) {
|
||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||
aBuilder, this, GetRectRelativeToSelf(), aLists.BorderBackground());
|
||||
aBuilder, this, bgRect, aLists.BorderBackground());
|
||||
}
|
||||
|
||||
// display inset box-shadows if we need to.
|
||||
|
|
|
@ -536,6 +536,7 @@ void nsTableRowFrame::PaintCellBackgroundsForFrame(
|
|||
nsIFrame* aFrame, nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayListSet& aLists, const nsPoint& aOffset) {
|
||||
// Compute background rect by iterating all cell frame.
|
||||
const nsPoint toReferenceFrame = aBuilder->ToReferenceFrame(aFrame);
|
||||
for (nsTableCellFrame* cell = GetFirstCell(); cell;
|
||||
cell = cell->GetNextCell()) {
|
||||
if (!cell->ShouldPaintBackground(aBuilder)) {
|
||||
|
@ -547,9 +548,10 @@ void nsTableRowFrame::PaintCellBackgroundsForFrame(
|
|||
if (!aBuilder->GetDirtyRect().Intersects(cellRect)) {
|
||||
continue;
|
||||
}
|
||||
cellRect += toReferenceFrame;
|
||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||
aBuilder, aFrame, cellRect, aLists.BorderBackground(), true, nullptr,
|
||||
aFrame->GetRectRelativeToSelf(), cell);
|
||||
aFrame->GetRectRelativeToSelf() + toReferenceFrame, cell);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -262,14 +262,16 @@ void nsTableRowGroupFrame::PaintCellBackgroundsForColumns(
|
|||
continue;
|
||||
}
|
||||
|
||||
auto cellPos = cell->GetNormalPosition() + rowPos;
|
||||
auto cellPos = cell->GetNormalPosition() + rowPos +
|
||||
aBuilder->ToReferenceFrame(aFrame);
|
||||
auto cellRect = nsRect(cellPos, cell->GetSize());
|
||||
if (!aBuilder->GetDirtyRect().Intersects(cellRect)) {
|
||||
continue;
|
||||
}
|
||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||
aBuilder, aFrame, cellRect, aList, false, nullptr,
|
||||
aFrame->GetRectRelativeToSelf(), cell);
|
||||
aFrame->GetRectRelativeToSelf() + aBuilder->ToReferenceFrame(aFrame),
|
||||
cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,7 +153,8 @@ void nsGroupBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
// Paint our background and border
|
||||
if (IsVisibleForPainting()) {
|
||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||
aBuilder, this, GetBackgroundRectRelativeToSelf(),
|
||||
aBuilder, this,
|
||||
GetBackgroundRectRelativeToSelf() + aBuilder->ToReferenceFrame(this),
|
||||
aLists.BorderBackground());
|
||||
aLists.BorderBackground()->AppendNewToTop<nsDisplayXULGroupBorder>(aBuilder,
|
||||
this);
|
||||
|
|
Загрузка…
Ссылка в новой задаче