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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 15 17:47:13 PST 2021


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

--- Comment #17 from Darin Adler <darin at apple.com> ---
Comment on attachment 444322
  --> https://bugs.webkit.org/attachment.cgi?id=444322
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=444322&action=review

> Source/WebCore/dom/Document.cpp:5606
> +    // https://www.w3.org/TR/css-values-4/#local-urls
> +    // Empty URLs and fragment-only URLs should not be resolved relative to the base
> +    // URL.
> +    if (url.isEmpty() || url.startsWith('#'))
> +        return URL(URL(), url);

I think you are correct to say that it may be incorrect to have this here. We’ll need to see which regression tests fail.

Instead we may want to change CSSImageValue to use another function specific to CSS that adds this behavior and then calls through to Document::completeURL. I might put it in CSSParserContext as a static member function that takes a document, or somewhere else that CSSImageValue can find it. I think there are possibly other call sites like CSSCursorImageValue that may need the same code.

-- 
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/0ab52127/attachment.htm>


More information about the webkit-unassigned mailing list