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

MozReview-Commit-ID: 8LGsk9uKyL5

--HG--
extra : rebase_source : 9edf7c6a4ce795da670f1ad06c8f86f9f05e4850
This commit is contained in:
Kartikaya Gupta 2016-02-10 17:11:28 -05:00
Родитель deb846be89
Коммит 2970550b4e
2 изменённых файлов: 14 добавлений и 2 удалений

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

@ -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;
}

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

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