Text-Fragments: Implement same-document navigation
Categories
(Core :: DOM: Navigation, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox128 | --- | fixed |
People
(Reporter: jjaschke, Assigned: jjaschke)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
This bug tracks the implementation of handling text fragments for same-document navigations.
Assignee | ||
Comment 1•26 days ago
|
||
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.
Assignee | ||
Comment 2•26 days ago
|
||
Pushed by jjaschke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d00d182fcf81 Text Fragments: Implement same-document navigation. r=farre,dom-core
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/46343 for changes under testing/web-platform/tests
Comment 5•16 days ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Description
•