github web-platform-tests/wpt merge_pr_47147

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
6 months ago

Text Fragments: Ensure to scroll the first text directive on a page into the center of the view.

Before this patch, it could happen that PresShell::GoToAnchor() was called while loading a document.
This method did not know about text fragments before,
and would scroll the anchor (ie., the first text directive) to the top of the view.
This was noticeable for pages that took longer to load, where the text directive was scrolled to the center first, and then to the top.

This patch saves the desired vertical scroll position as a member in PresShell and makes GoToAnchor() scroll to the center as well.

Additionally, this patch updates the test file target document to make it more mobile-friendly.

Differential Revision: https://phabricator.services.mozilla.com/D216039

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1906134
gecko-commit: 067e00e20558b4e940b8f111efc47096c7ce7b93
gecko-reviewers: emilio

Don't miss a new wpt release

NewReleases is sending notifications on new releases.