github web-platform-tests/wpt merge_pr_48660

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
4 months ago

[Clipboard API] Support creating ClipboardItem with Promise

Chromium allows |ClipboardItem| creation using |Promise| only.
Spec defines the ClipboardItem can be created with
|Promise<(DOMString or Blob)>| -
https://w3c.github.io/clipboard-apis/#typedefdef-clipboarditemdata

This CL adds support for |Promise| as valid input to the
ClipboardItem constructor in Chromium.

The |ClipboardItem::getType()| API returns a Blob. Therefore, even if
the ClipboardItem is created with DOMString inputs, they need to be
converted to Blob types to support this API. This conversion is
implemented in the |UnionToBlobResolverFunction::Call()| function
in clipboard_item.cc.

The change is put behind a runtime enabled feature which is disabled
by default. Chrome status entry for this change -
https://chromestatus.com/feature/4926138582040576

Bug: 40766145
Change-Id: I856fc3831eb9fd982959b87c8ad8cd34f88b1215
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5759427
Reviewed-by: Ayu Ishii ayui@chromium.org
Reviewed-by: Kent Tamura tkent@chromium.org
Commit-Queue: Sambamurthy Bandaru sambamurthy.bandaru@microsoft.com
Reviewed-by: Sanket Joshi sajos@microsoft.com
Cr-Commit-Position: refs/heads/main@{#1369789}

Don't miss a new wpt release

NewReleases is sending notifications on new releases.