[webkit-reviews] review granted: [Bug 178016] DataTransfer.items does not contain items for custom types supplied via add or setData : [Attachment 323115] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Oct 7 23:45:28 PDT 2017


Darin Adler <darin at apple.com> has granted Wenson Hsieh
<wenson_hsieh at apple.com>'s request for review:
Bug 178016: DataTransfer.items does not contain items for custom types supplied
via add or setData
https://bugs.webkit.org/show_bug.cgi?id=178016

Attachment 323115: Patch

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




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

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

> Source/WebCore/dom/DataTransfer.cpp:145
> +    auto lowercaseType = type.stripWhiteSpace().convertToASCIILowercase();

It is probably not right to use stringWhiteSpace here; that function uses the
Unicode definition of whitespace, not the one that we’d normally use in HTML.
Instead we would normally use stripLeadingAndTrailingHTMLSpaces.

> Source/WebCore/dom/DataTransfer.cpp:146
> +    if (Settings::customPasteboardDataEnabled() &&
!Pasteboard::isSafeTypeForDOMToReadAndWrite(lowercaseType))

It would be nice to have a named function for this test that we do in three
different places in this patch.


More information about the webkit-reviews mailing list