Bug 1915051 - Add an assertion to ensure hit testing and rendering are not out of sync. r=hiro,tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D220201
This commit is contained in:
Botond Ballo 2024-09-08 21:37:18 +00:00
Родитель a1ca766a0a
Коммит 16bc52cd2d
1 изменённых файлов: 11 добавлений и 0 удалений

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

@ -847,6 +847,17 @@ void nsDisplayListBuilder::UpdateShouldBuildAsyncZoomContainer() {
mBuildAsyncZoomContainer = !mIsRelativeToLayoutViewport &&
!document->Fullscreen() &&
nsLayoutUtils::AllowZoomingForDocument(document);
// If mIsRelativeToLayoutViewport == false, hit-testing on this
// display list will take into account the pres shell resolution.
// If we're not building an async zoom container (meaning, the
// resolution will not take effect visually), the resolution better
// be 1.0, otherwise rendering and hit-testing are out of sync.
#ifdef DEBUG
if (!mIsRelativeToLayoutViewport && !mBuildAsyncZoomContainer) {
MOZ_ASSERT(document->GetPresShell()->GetResolution() == 1.0f);
}
#endif
}
// Certain prefs may cause display list items to be added or removed when they