Bug 1245925 - Don't allow expiring the displayport on root scrollframes. r=tnikkel

MozReview-Commit-ID: 8LGsk9uKyL5
This commit is contained in:
Kartikaya Gupta 2016-02-10 17:11:28 -05:00
parent c072530c75
commit 92d131a10a
2 changed files with 14 additions and 2 deletions

View File

@ -2353,7 +2353,7 @@ RemoveDisplayPortCallback(nsITimer* aTimer, void* aClosure)
MOZ_ASSERT(helper->mDisplayPortExpiryTimer);
helper->mDisplayPortExpiryTimer = nullptr;
if (helper->IsAlwaysActive() || helper->mIsScrollParent) {
if (!helper->AllowDisplayPortExpiration() || helper->mIsScrollParent) {
// If this is a scroll parent for some other scrollable frame, don't
// expire the displayport because it would break scroll handoff. Once the
// descendant scrollframes have their displayports expired, they will
@ -2417,9 +2417,20 @@ void ScrollFrameHelper::ResetDisplayPortExpiryTimer()
}
}
void ScrollFrameHelper::TriggerDisplayPortExpiration()
bool ScrollFrameHelper::AllowDisplayPortExpiration()
{
if (IsAlwaysActive()) {
return false;
}
if (mIsRoot && mOuter->PresContext()->IsRoot()) {
return false;
}
return true;
}
void ScrollFrameHelper::TriggerDisplayPortExpiration()
{
if (!AllowDisplayPortExpiration()) {
return;
}

View File

@ -370,6 +370,7 @@ public:
void NotifyImageVisibilityUpdate();
bool GetDisplayPortAtLastImageVisibilityUpdate(nsRect* aDisplayPort);
bool AllowDisplayPortExpiration();
void TriggerDisplayPortExpiration();
void ResetDisplayPortExpiryTimer();