Bug 1692991. Set the MinimalDisplayPort property before calling SetDisplayPortMargins so a display port expiry timer isn't incorrectly started for it. r=botond

This came up while improving test_layerization.html in bug 1691878, so that will test this.

Differential Revision: https://phabricator.services.mozilla.com/D105284
This commit is contained in:
Timothy Nikkel 2021-02-18 02:29:28 +00:00
Родитель 4732bd71ba
Коммит d3f260db6d
1 изменённых файлов: 8 добавлений и 2 удалений

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

@ -4329,12 +4329,18 @@ bool ScrollFrameHelper::DecideScrollableLayer(
!DisplayPortUtils::HasDisplayPort(content) &&
nsLayoutUtils::AsyncPanZoomEnabled(mOuter) && WantAsyncScroll() &&
aBuilder->IsPaintingToWindow() && aSetBase) {
// SetDisplayPortMargins calls TriggerDisplayPortExpiration which starts a
// display port expiry timer for display ports that do expire. However
// minimal display ports do not expire, so the display port has to be
// marked before the SetDisplayPortMargins call so the expiry timer
// doesn't get started.
content->SetProperty(nsGkAtoms::MinimalDisplayPort,
reinterpret_cast<void*>(true));
DisplayPortUtils::SetDisplayPortMargins(
content, mOuter->PresShell(), DisplayPortMargins::Empty(content),
DisplayPortUtils::ClearMinimalDisplayPortProperty::No, 0,
DisplayPortUtils::RepaintMode::DoNotRepaint);
content->SetProperty(nsGkAtoms::MinimalDisplayPort,
reinterpret_cast<void*>(true));
}
bool usingDisplayPort = DisplayPortUtils::HasDisplayPort(content);