Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 16bc52c

Browse files
committed
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
1 parent a1ca766 commit 16bc52c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

layout/painting/nsDisplayList.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,17 @@ void nsDisplayListBuilder::UpdateShouldBuildAsyncZoomContainer() {
847847
mBuildAsyncZoomContainer = !mIsRelativeToLayoutViewport &&
848848
!document->Fullscreen() &&
849849
nsLayoutUtils::AllowZoomingForDocument(document);
850+
851+
// If mIsRelativeToLayoutViewport == false, hit-testing on this
852+
// display list will take into account the pres shell resolution.
853+
// If we're not building an async zoom container (meaning, the
854+
// resolution will not take effect visually), the resolution better
855+
// be 1.0, otherwise rendering and hit-testing are out of sync.
856+
#ifdef DEBUG
857+
if (!mIsRelativeToLayoutViewport && !mBuildAsyncZoomContainer) {
858+
MOZ_ASSERT(document->GetPresShell()->GetResolution() == 1.0f);
859+
}
860+
#endif
850861
}
851862

852863
// Certain prefs may cause display list items to be added or removed when they

0 commit comments

Comments
 (0)