[webkit-reviews] review granted: [Bug 211511] [GTK] Rework clipboard handling in preparation for GTK4 : [Attachment 399013] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 12 06:50:52 PDT 2020


Adrian Perez <aperez at igalia.com> has granted Carlos Garcia Campos
<cgarcia at igalia.com>'s request for review:
Bug 211511: [GTK] Rework clipboard handling in preparation for GTK4
https://bugs.webkit.org/show_bug.cgi?id=211511

Attachment 399013: Patch

https://bugs.webkit.org/attachment.cgi?id=399013&action=review




--- Comment #4 from Adrian Perez <aperez at igalia.com> ---
Comment on attachment 399013
  --> https://bugs.webkit.org/attachment.cgi?id=399013
Patch

Looks good overall, with a few nits you may want to take a look at before
landing.


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

> Source/WebCore/editing/gtk/WebContentReaderGtk.cpp:53
> +bool WebContentReader::readFilePaths(const Vector<String>& paths)

This is exactly the same implementation as for Cocoa, and it seems like a
reasonable
default implementation for any port. I would move this into
“WebContentReader.cpp” and
share the code.

> Source/WebCore/editing/gtk/WebContentReaderGtk.cpp:93
> +bool WebContentReader::readURL(const URL&, const String&)

The Cocoa port creates an anchor element when reading an URL, resulting in a
fragment with something like “<a href="url">title-or-url</a>” being added.

I think it makes sense to mimic that behavior. Feel free to leave a TODO note
here to do that later on as a follow-up patch.

> Source/WebCore/editing/gtk/WebContentReaderGtk.cpp:98
> +bool WebContentMarkupReader::readHTML(const String&)

This could also be implemented, seems easy enough to call “sanitizeMarkup()” on
the
input string and use the result from that.

Feel free to leave it as a TODO for a follow-up patch as well.

> Source/WebCore/platform/gtk/PasteboardGtk.cpp:106
> +    ASSERT(m_selectionData);

Shouldn't this be also a “RELEASE_ASSERT()” as above? It looks like to me
that both assertions should be of the same kind.


More information about the webkit-reviews mailing list