Fix handling of trailing whitespace on url('#foo ')
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}
Showing
Please register or sign in to comment