Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of trailing whitespace on url('#foo ') #22414

Merged
merged 1 commit into from Mar 24, 2020

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Mar 24, 2020

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}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants