Bug 1204535 - Flatten conditional structure one level. r=tn

This commit is contained in:
Kartikaya Gupta 2015-09-15 16:09:35 -04:00
parent a9f65b9841
commit 87fd2c59f6

View File

@ -2877,22 +2877,20 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (aBuilder->IsPaintingToWindow()) {
bool wasUsingDisplayPort = nsLayoutUtils::GetDisplayPort(mOuter->GetContent(), nullptr);
if (mIsRoot) {
if (gfxPrefs::LayoutUseContainersForRootFrames()) {
// For a root frame in a container, just get the value of the existing
// display port if any.
usingDisplayport = nsLayoutUtils::GetDisplayPort(mOuter->GetContent(), &displayPort);
} else {
// Override the value of the display port base rect, and possibly create a
// display port if there isn't one already.
nsRect displayportBase = dirtyRect;
if (mIsRoot && mOuter->PresContext()->IsRootContentDocument()) {
displayportBase =
nsRect(nsPoint(0, 0), nsLayoutUtils::CalculateCompositionSizeForFrame(mOuter));
}
usingDisplayport = nsLayoutUtils::GetOrMaybeCreateDisplayPort(
*aBuilder, mOuter, displayportBase, &displayPort);
if (mIsRoot && gfxPrefs::LayoutUseContainersForRootFrames()) {
// For a root frame in a container, just get the value of the existing
// display port if any.
usingDisplayport = nsLayoutUtils::GetDisplayPort(mOuter->GetContent(), &displayPort);
} else if (mIsRoot) {
// Override the value of the display port base rect, and possibly create a
// display port if there isn't one already.
nsRect displayportBase = dirtyRect;
if (mIsRoot && mOuter->PresContext()->IsRootContentDocument()) {
displayportBase =
nsRect(nsPoint(0, 0), nsLayoutUtils::CalculateCompositionSizeForFrame(mOuter));
}
usingDisplayport = nsLayoutUtils::GetOrMaybeCreateDisplayPort(
*aBuilder, mOuter, displayportBase, &displayPort);
} else {
// For a non-root scroll frame, override the value of the display port
// base rect, and possibly create a display port if there isn't one