Fix handling of trailing whitespace on url('#foo ') #22414
Merged
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.
When |is_local_| was true we'd extract the fragment "manually" from the
relative URL string. Always get the fragment from the resolved/absolute
URL instead to make behavior is consistent w.r.t trimming whitespace.
This requires making sure that base URLs are provided/set up properly in
a few more cases, so do that. Drop the |is_local_| check from
ReResolveUrl() because we now rely on the absolute URL in that case too.
This matches the behavior of SVGURLReferenceResolver's
FragmentIdentifier() which is used for non-CSS URL resolving for SVG
element references. Add test for the case of an invalid base URL.
Also add some tests for various non-CSS uses.
Bug: 949135, 1063694
Change-Id: I2ffb30677b196d650ddaf2a712d82ac6c20b50fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2115650
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752812}