diff --git a/layout/generic/ScrollContainerFrame.cpp b/layout/generic/ScrollContainerFrame.cpp index 8329ffdaad48..9108e8e6d4dd 100644 --- a/layout/generic/ScrollContainerFrame.cpp +++ b/layout/generic/ScrollContainerFrame.cpp @@ -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); diff --git a/layout/generic/crashtests/1858798.html b/layout/generic/crashtests/1858798.html new file mode 100644 index 000000000000..2be83f616f26 --- /dev/null +++ b/layout/generic/crashtests/1858798.html @@ -0,0 +1,9 @@ + + diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list index 6e9c5efd1cd4..c2db73c81fbd 100644 --- a/layout/generic/crashtests/crashtests.list +++ b/layout/generic/crashtests/crashtests.list @@ -815,5 +815,6 @@ asserts(0-14) load 1816574.html # Bug 1913247 load 1821603.html load 1822118.html load 1825434.html +load 1858798.html load 1915006.html asserts(0-85) load 1881375-1.html # bug 1890687 - assertions about fragmentation invariants, failing many times because the test runs in a loop