Bug 1158323 - Make sure we set a base rect on document elements that have margins set. r=tn
This commit is contained in:
@@ -59,6 +59,8 @@ ChromeProcessController::InitializeRoot()
|
|||||||
uint32_t presShellId;
|
uint32_t presShellId;
|
||||||
FrameMetrics::ViewID viewId;
|
FrameMetrics::ViewID viewId;
|
||||||
if (APZCCallbackHelper::GetOrCreateScrollIdentifiers(content, &presShellId, &viewId)) {
|
if (APZCCallbackHelper::GetOrCreateScrollIdentifiers(content, &presShellId, &viewId)) {
|
||||||
|
// Note that the base rect that goes with these margins is set in
|
||||||
|
// nsRootBoxFrame::BuildDisplayList.
|
||||||
nsLayoutUtils::SetDisplayPortMargins(content, presShell, ScreenMargin(), 0,
|
nsLayoutUtils::SetDisplayPortMargins(content, presShell, ScreenMargin(), 0,
|
||||||
nsLayoutUtils::RepaintMode::DoNotRepaint);
|
nsLayoutUtils::RepaintMode::DoNotRepaint);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,6 +179,14 @@ nsRootBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||||||
const nsRect& aDirtyRect,
|
const nsRect& aDirtyRect,
|
||||||
const nsDisplayListSet& aLists)
|
const nsDisplayListSet& aLists)
|
||||||
{
|
{
|
||||||
|
if (mContent && mContent->GetProperty(nsGkAtoms::DisplayPortMargins)) {
|
||||||
|
// The XUL document's root element may have displayport margins set in
|
||||||
|
// ChromeProcessController::InitializeRoot, and we should to supply the
|
||||||
|
// base rect.
|
||||||
|
nsRect displayPortBase = aDirtyRect.Intersect(nsRect(nsPoint(0, 0), GetSize()));
|
||||||
|
nsLayoutUtils::SetDisplayPortBase(mContent, displayPortBase);
|
||||||
|
}
|
||||||
|
|
||||||
// root boxes don't need a debug border/outline or a selection overlay...
|
// root boxes don't need a debug border/outline or a selection overlay...
|
||||||
// They *may* have a background propagated to them, so force creation
|
// They *may* have a background propagated to them, so force creation
|
||||||
// of a background display list element.
|
// of a background display list element.
|
||||||
|
|||||||
Reference in New Issue
Block a user