Strip the fragment directive and update scroll-to-text WPT #18898
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Scroll to text defines a double-hash as the URL fragment directive[1].
The fragment directive should always be stripped from the URL to avoid
breaking pages that use the fragment for state. Our implementation
previously only stripped the fragment directive if we parsed targetText.
Also improved the web platform test to test whether the target scrolls
to the element or text fragment as expected.
Tested updated WPT locally with
run_web_tests.py --additional-driver-flag=
'--enable-blink-features=TextFragmentIdentifiers'
[1] whatwg/url#445
Bug: 994818
Change-Id: I48109683a5e5ba162f1db72b1c5b174f3b017251
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1772166
Commit-Queue: Nick Burris <nburris@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694407}