script: Prevent "scroll to fragment" from scrolling offscreen (#32129)

Previously, the "scroll to fragment" operation could scroll past the end
of the screen, because the scroll position was not clamped to viewport
boundaries. Correct this by using the `Window::scroll()` method which
handles this case.

In addition, ensure that `Window`'s `current_viewport` member is
initialized properly when it is created.
This commit is contained in:
Martin Robinson 2024-04-25 02:12:16 +02:00 committed by GitHub
parent bef6c295aa
commit 1440406e91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 60 additions and 20 deletions

View file

@ -621660,6 +621660,13 @@
}
]
],
"scroll-position-inline-nearest.html": [
"4aab0aa5e5a1e4a3eea82282be2344586a9a6d02",
[
null,
{}
]
],
"scroll-position-vertical-lr.html": [
"57d99440e114968e7dcd1b61ebf2d18c7bca987b",
[

View file

@ -0,0 +1,3 @@
[scroll-position-vertical-lr.html]
[Fragment Navigation: Scroll to block start position in vertical-lr writing mode]
expected: FAIL