gecko-dev/docshell
Jan-Niklas Jaeschke 8726853107 Bug 1895555 - Text Fragments: Implement same-document navigation. r=farre,dom-core
Same-document navigation follows a different code path than normal navigation
and was therefore not covered in the initial implementation for text fragments.
Same-document navigation does not set a URI in the `Document`, which
is the way cross-document navigation would parse text directives from the URL.

Instead, `nsDocShell::ScrollToAnchor()` is called via
`nsDocShell::InternalLoad()`-> `nsDocShell::HandleSameDocumentNavigation()`.
This code path needs to parse and remove the fragment directive from the new
fragment to be able to find text fragments and to allow for element-id fallback.
`nsDocShell::ScrollToAnchor()` needs to start an attempt to scroll to the text fragment
if it exists. It must not, however, clear the uninvoked text directives,  because a
same-document navigation could happen before the document is fully loaded,
hence the target text might not be part of the DOM tree.

As per spec, a second attempt to scroll to the text fragment is done after the load
is completed. This is done by `Document::ScrollToRef()`, which is called by
`nsDocumentViewer::LoadComplete()` after the load has finished.
This call will clear the uninvoked directives.

Differential Revision: https://phabricator.services.mozilla.com/D209726
2024-05-17 12:16:00 +00:00
..
base Bug 1895555 - Text Fragments: Implement same-document navigation. r=farre,dom-core 2024-05-17 12:16:00 +00:00
build Bug 1882422: Use a local testing page to return complex data and make use of it in C++-land r=peterv 2024-04-03 23:43:17 +00:00
shistory Bug 1881863 - Part 1: Standardize on boolean over bool in xpidl, r=xpcom-reviewers,necko-reviewers,valentin,extension-reviewers,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,search-reviewers,anti-tracking-reviewers,places-reviewers,nalexander,emilio,zombie,sgalich,karlt,lina,Standard8 2024-04-04 18:45:21 +00:00
test Bug 1880914 - Move BrowserForceEncodingDetection. r=Gijs 2024-04-15 10:22:45 +00:00
moz.build Bug 1859890 - batch 14 convert xpcshell.ini -> .toml. r=aryx,dom-storage-reviewers,jesup 2023-11-28 01:02:01 +00:00