Repository navigation
Resolve double-quoted URLs in style sheets against the sheet - #278
Merged
Merged
Conversation
eXpl0it3r
force-pushed
the
fix/quoted-relative-url
branch
from
November 10, 2026 19:06
6c427e6 to
846bbdd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A relative URL in a linked style sheet is supposed to resolve against the style sheet's URL, but this only worked for
url(yellow)andurl('yellow'). Withurl("yellow")inhttps://example.org/style/basic.css, the background image or@font-facefont got requested fromhttps://example.org/style/%22yellow%22and failed to load.StylesheetLoadHandler.CorrectRelativeUrlsonly stripped single quotes before rebasing the URL, so the double quotes ended up as part of the path. Escapes weren't handled either, e.g.url('a\'b.png')turned the backslash into a/andurl("a)b.png")got cut off at the first).The
url()argument is now read the way CSS 2.1 defines it, with optional whitespace, either quote style and backslash escapes, then resolved against the style sheet and written back quoted, so characters like'and(in the absolute URL don't break the token.How to test this PR?
CI should succeed.
FontFaceInALinkedStyleSheet_ResolvesAgainstTheStyleSheetUrlchecks the requested font URL for unquoted, single-quoted, double-quoted and escapedurl()values, the double-quoted, padded and escaped cases fail on master.