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);

View File

@@ -0,0 +1,9 @@
<style>
* {
scroll-snap-align: end;
margin: 90% -100em;
scroll-snap-type: block mandatory ! important;
scroll-padding-inline: 54205949.19ch ! important;
}
</style>
<math href="" autofocus>

View File

@@ -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