Bug 1858798 - Ignore any target snap points in the case of empty snapport. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D226574
This commit is contained in:
Hiroyuki Ikezoe
2024-10-25 21:13:34 +00:00
parent a9eb26f0a2
commit f49f73072b
3 changed files with 15 additions and 0 deletions

View File

@@ -7607,6 +7607,11 @@ ScrollSnapInfo ScrollContainerFrame::ComputeScrollSnapInfo() {
result.InitializeScrollSnapStrictness(writingMode, disp);
result.mSnapportSize = GetSnapportSize();
if (result.mSnapportSize.IsEmpty()) {
// Ignore any target snap points if the snapport is empty.
return result;
}
CollectScrollPositionsForSnap(
mScrolledFrame, mScrolledFrame, GetScrolledRect(), GetScrollPadding(),
GetLayoutScrollRange(), writingMode, result, &mSnapTargets);