[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 18:20:22 PST 2021


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
 Attachment #444457|review?                     |review+
              Flags|                            |

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

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

> Source/WebCore/css/CSSImageValue.cpp:87
> +    if (CSSValue::isCSSLocalURL(m_location.resolvedURL.string()))

This can just be:

   if (isCSSLocalURL(...

Since CSSImageValue derives from CSSValue.

> Source/WebCore/css/CSSImageValue.cpp:88
> +        return URL(URL(), m_location.resolvedURL.string());

This can just be:

    return m_location.resolvedURL;

No need to re-create the URL from a string.

> Source/WebCore/css/CSSValue.h:157
> +    // Empty URLs and fragment-only URLs should not be resolved relative to the base
> +    // URL.

Let’s not break the word URL onto a separate line.

> Source/WebCore/css/CSSValue.h:158
> +    static bool isCSSLocalURL(const String& url)

I might name this argument "relativeURL". I suggest this take a StringView, not a const String&.

If it was me, I would also move this function body out of the class definition.

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/20211117/8f277852/attachment.htm>

More information about the webkit-unassigned mailing list