Bug 1905247 - Convert logicalScrollRange into writingMode. r=emilio

`logicalScrollRange` is used to clamp each candidate snap position inside the
scroll range. If we used `aWritingModeOnScroller` for `logicalScrollRange`,
clamping will be done in a wrong axis in some cases.

With the next commit but without this change running
scroll-snap-writing-mode-000.html [1] causes a lot of
"ASSERTION: writing-mode mismatch" warnings.

[1] https://searchfox.org/mozilla-central/rev/16a5f0e868a01d3f3a4a7364206bef2a64e80735/testing/web-platform/tests/css/css-scroll-snap/snap-after-initial-layout/scroll-snap-writing-mode-000.html

Differential Revision: https://phabricator.services.mozilla.com/D215314
This commit is contained in:
Hiroyuki Ikezoe
2024-07-02 21:53:14 +00:00
parent 07bd74474f
commit 44d88fd9fa

View File

@@ -7319,6 +7319,8 @@ static void AppendScrollPositionsForSnap(
// what we need here is (0, 0), so we use an
// empty size.
nsSize());
logicalScrollRange = logicalScrollRange.ConvertTo(
writingMode, aWritingModeOnScroller, nsSize());
Maybe<nscoord> blockDirectionPosition;
const nsStyleDisplay* styleDisplay = aFrame->StyleDisplay();