forked from mirrors/gecko-dev
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 |
||
|---|---|---|
| .. | ||
| crashtests | ||
| BaseHistory.cpp | ||
| BaseHistory.h | ||
| BrowsingContext.cpp | ||
| BrowsingContext.h | ||
| BrowsingContextGroup.cpp | ||
| BrowsingContextGroup.h | ||
| BrowsingContextWebProgress.cpp | ||
| BrowsingContextWebProgress.h | ||
| CanonicalBrowsingContext.cpp | ||
| CanonicalBrowsingContext.h | ||
| ChildProcessChannelListener.cpp | ||
| ChildProcessChannelListener.h | ||
| IHistory.h | ||
| LoadContext.cpp | ||
| LoadContext.h | ||
| metrics.yaml | ||
| moz.build | ||
| nsAboutRedirector.cpp | ||
| nsAboutRedirector.h | ||
| nsCTooltipTextProvider.h | ||
| nsDocShell.cpp | ||
| nsDocShell.h | ||
| nsDocShellEditorData.cpp | ||
| nsDocShellEditorData.h | ||
| nsDocShellEnumerator.cpp | ||
| nsDocShellEnumerator.h | ||
| nsDocShellLoadState.cpp | ||
| nsDocShellLoadState.h | ||
| nsDocShellLoadTypes.h | ||
| nsDocShellTelemetryUtils.cpp | ||
| nsDocShellTelemetryUtils.h | ||
| nsDocShellTreeOwner.cpp | ||
| nsDocShellTreeOwner.h | ||
| nsDSURIContentListener.cpp | ||
| nsDSURIContentListener.h | ||
| nsIDocShell.idl | ||
| nsIDocShellTreeItem.idl | ||
| nsIDocShellTreeOwner.idl | ||
| nsIDocumentLoaderFactory.idl | ||
| nsIDocumentViewer.idl | ||
| nsIDocumentViewerEdit.idl | ||
| nsILoadContext.idl | ||
| nsILoadURIDelegate.idl | ||
| nsIPrivacyTransitionObserver.idl | ||
| nsIReflowObserver.idl | ||
| nsIRefreshURI.idl | ||
| nsIScrollObserver.h | ||
| nsITooltipListener.idl | ||
| nsITooltipTextProvider.idl | ||
| nsIURIFixup.idl | ||
| nsIWebNavigation.idl | ||
| nsIWebNavigationInfo.idl | ||
| nsIWebPageDescriptor.idl | ||
| nsPingListener.cpp | ||
| nsPingListener.h | ||
| nsRefreshTimer.cpp | ||
| nsRefreshTimer.h | ||
| nsWebNavigationInfo.cpp | ||
| nsWebNavigationInfo.h | ||
| SerializedLoadContext.cpp | ||
| SerializedLoadContext.h | ||
| SyncedContext.h | ||
| SyncedContextInlines.h | ||
| URIFixup.sys.mjs | ||
| WindowContext.cpp | ||
| WindowContext.h | ||