[Webkit-unassigned] [Bug 229917] Correctly support fragment-only URLs in CSS images

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 16 14:00:47 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=229917

--- Comment #20 from Matt Woodrow <m_woodrow at apple.com> ---
(In reply to Darin Adler from comment #19)

> CSSCursorImageValue has URLs that come from the CSS "cursor" property.
> Syntax like: "cursor: url(hand.cur), pointer" that is parsed by the
> consumeCursor function in CSSPropertyParser.cpp. It’s simply got less test
> coverage than CSSImageValue, but it has many of the same issues.

My understanding is that CSSCursorImageValue just wraps a CSSImageValue in that case (via m_imageValue), so fixing the completeURL lookups within CSSImageValue should be sufficient.

The call to document.completeURL from within CSSCursorImageValue looks to be specific to the case where the cursor property references an element within SVG, and we're looking up the href attribute from that.

> 
> It’s fine to put a static helper somewhere; it’s just much better to have
> this packaged as part of a URL completion algorithm rather than a check
> outside. Having a separate check will result in repetitive code outside the
> function. So maybe we should just add new completeImageURL or
> completeCSSImageURL functions that wrap the existing completeURL functions.
> 
> And yes, still nice to share the check for which URLs should not be resolved
> relative to the base for this case, and name based on the specification.
> Like a function named isCSSLocalURL.

The part I'm struggling with is that CSSImageValue wants to use the algorithm in Document, whereas the consumers in the parser want to use the CSSParserContext algorithm. These differ a fair bit in their resolution of the base url, and character encoding.

A single completeCSSImageURL function would need to take either a CSSParserContext or Document, and pick which completeURL function to call based on which was provided at runtime (or I could template it, since the args as the same).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211116/e2ad2261/attachment.htm>


More information about the webkit-unassigned mailing list