Backout part 1 of bug 1195431 (cf841511b71a).

This commit is contained in:
Timothy Nikkel 2015-10-12 15:21:48 -05:00
Родитель 77afdaa94b
Коммит d566a599fe
4 изменённых файлов: 13 добавлений и 36 удалений

Просмотреть файл

@ -3037,25 +3037,6 @@ nsLayoutUtils::CalculateAndSetDisplayPortMargins(nsIScrollableFrame* aScrollFram
content, presShell, displayportMargins, 0, aRepaintMode);
}
bool
nsLayoutUtils::WantDisplayPort(const nsDisplayListBuilder* aBuilder,
nsIFrame* aScrollFrame)
{
nsIScrollableFrame* scrollableFrame = do_QueryFrame(aScrollFrame);
if (!scrollableFrame) {
return false;
}
// We perform an optimization where we ensure that at least one
// async-scrollable frame (i.e. one that WantAsyncScroll()) has a displayport.
// If that's not the case yet, and we are async-scrollable, we will get a
// displayport.
return aBuilder->IsPaintingToWindow() &&
nsLayoutUtils::AsyncPanZoomEnabled(aScrollFrame) &&
!aBuilder->HaveScrollableDisplayPort() &&
scrollableFrame->WantAsyncScroll();
}
bool
nsLayoutUtils::GetOrMaybeCreateDisplayPort(nsDisplayListBuilder& aBuilder,
nsIFrame* aScrollFrame,
@ -3074,7 +3055,17 @@ nsLayoutUtils::GetOrMaybeCreateDisplayPort(nsDisplayListBuilder& aBuilder,
bool haveDisplayPort = GetDisplayPort(content, aOutDisplayport);
if (WantDisplayPort(&aBuilder, aScrollFrame)) {
// We perform an optimization where we ensure that at least one
// async-scrollable frame (i.e. one that WantsAsyncScroll()) has a displayport.
// If that's not the case yet, and we are async-scrollable, we will get a
// displayport.
// Note: we only do this in processes where we do subframe scrolling to
// begin with (i.e., not in the parent process on B2G).
if (aBuilder.IsPaintingToWindow() &&
nsLayoutUtils::AsyncPanZoomEnabled(aScrollFrame) &&
!aBuilder.HaveScrollableDisplayPort() &&
scrollableFrame->WantAsyncScroll()) {
// If we don't already have a displayport, calculate and set one.
if (!haveDisplayPort) {
CalculateAndSetDisplayPortMargins(scrollableFrame, nsLayoutUtils::RepaintMode::DoNotRepaint);

Просмотреть файл

@ -2651,12 +2651,6 @@ public:
static bool CalculateAndSetDisplayPortMargins(nsIScrollableFrame* aScrollFrame,
RepaintMode aRepaintMode);
/**
* Return true if GetOrMaybeCreateDisplayPort would create a displayport.
*/
static bool WantDisplayPort(const nsDisplayListBuilder* aBuilder,
nsIFrame* aScrollFrame);
/**
* Get the display port for |aScrollFrame|'s content. If |aScrollFrame|
* WantsAsyncScroll() and we don't have a scrollable displayport yet (as

Просмотреть файл

@ -2824,13 +2824,6 @@ ClipListsExceptCaret(nsDisplayListCollection* aLists,
ClipItemsExceptCaret(aLists->Content(), aBuilder, aClipFrame, clip, aUsingDisplayPort);
}
bool
ScrollFrameHelper::IsUsingDisplayPort(const nsDisplayListBuilder* aBuilder) const
{
return aBuilder->IsPaintingToWindow() &&
nsLayoutUtils::GetDisplayPort(mOuter->GetContent());
}
void
ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
@ -2871,7 +2864,8 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
bool createLayersForScrollbars = mIsRoot &&
mOuter->PresContext()->IsRootContentDocument();
bool usingDisplayPort = IsUsingDisplayPort(aBuilder);
bool usingDisplayPort = aBuilder->IsPaintingToWindow() &&
nsLayoutUtils::GetDisplayPort(mOuter->GetContent());
if (aBuilder->GetIgnoreScrollFrame() == mOuter || IsIgnoringViewportClipping()) {
// Root scrollframes have FrameMetrics and clipping on their container

Просмотреть файл

@ -81,8 +81,6 @@ public:
bool aCreateLayer,
bool aPositioned);
bool IsUsingDisplayPort(const nsDisplayListBuilder* aBuilder) const;
bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
Sides aSkipSides, nscoord aRadii[8]) const;