Bug
1706373 [wpt PR 28599] - Allow text fragments in same-document navigations, a=testonly
Automatic update from web-platform-tests
Allow text fragments in same-document navigations
This CL lifts the restriction on text fragments in the specific case of
a same-document navigation initiated by an origin that's same-origin
with the current document. In this case, the two documents already have
full access to each other's content so text fragments present no risk.
Enabling them allows using anchor links to text-fragments on the current
page as well as allowing coordinating origins to pass a text-fragment
into an iframe.
To do this, we update DocumentLoader's |is_same_origin_navigation_|
member on same-document navigations (and we rename it to be more
specific that the initiator is same-origin or browser).
We also make another small adjustment in allowing text fragments to be
invoked on replacement navigations (e.g. location.replace) which don't
create a new history entry. This was simply an unintentional omission in
the implementation.
Change-Id: Id82f46294b87d12d6a7355e0f7e4936e7fae75d6
Bug:
1198668
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/
2811999
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#875755}
--
wpt-commits:
6750e28408598c11106f58afc1a1e2574a9e4ea4
wpt-pr: 28599