Title: [250824] trunk
Revision
250824
Author
[email protected]
Date
2019-10-08 07:50:27 -0700 (Tue, 08 Oct 2019)

Log Message

[Clipboard API] Introduce bindings for the async Clipboard API
https://bugs.webkit.org/show_bug.cgi?id=202622
<rdar://problem/56038126>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Adds IDL for the async clipboard API (with the exception of delayed item generation interfaces, which
I'll iterate on and introduce separately). See: https://w3c.github.io/clipboard-apis/#async-clipboard-api for
more information.

Tests: editing/async-clipboard/clipboard-interfaces.html
       editing/async-clipboard/clipboard-wrapper-stays-alive.html

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/async-clipboard/Clipboard.cpp:
(WebCore::Clipboard::create):
(WebCore::Clipboard::Clipboard):
(WebCore::Clipboard::navigator):
(WebCore::Clipboard::eventTargetInterface const):
(WebCore::Clipboard::scriptExecutionContext const):
(WebCore::Clipboard::readText):
(WebCore::Clipboard::writeText):
(WebCore::Clipboard::read):
(WebCore::Clipboard::write):

Stub out these API calls for now by immediately rejecting the given promise.

* Modules/async-clipboard/Clipboard.h:
* Modules/async-clipboard/Clipboard.idl:
* Modules/async-clipboard/ClipboardItem.cpp:
(WebCore::ClipboardItem::ClipboardItem):
(WebCore::ClipboardItem::create):
(WebCore::ClipboardItem::types const):
(WebCore::ClipboardItem::getType):

Stub out these API calls for now by immediately rejecting the given promise.

(WebCore::navigator):
* Modules/async-clipboard/ClipboardItem.h:
(WebCore::ClipboardItem::presentationStyle const):
* Modules/async-clipboard/ClipboardItem.idl:
* Modules/async-clipboard/NavigatorClipboard.cpp:
(WebCore::NavigatorClipboard::NavigatorClipboard):
(WebCore::NavigatorClipboard::clipboard):
(WebCore::NavigatorClipboard::from):
(WebCore::NavigatorClipboard::supplementName):
* Modules/async-clipboard/NavigatorClipboard.h:
* Modules/async-clipboard/NavigatorClipboard.idl:
* Modules/mediastream/MediaStreamTrack.cpp:
* Modules/mediastream/RTCDTMFSender.cpp:
* Modules/mediastream/RTCRtpSender.cpp:
* Modules/webgpu/WebGPUPipeline.h:

More unified sources-related build fixes.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/DeviceOrientationOrMotionEvent.cpp:

Unified sources-related build fix.

* dom/EventTargetFactory.in:
* features.json:

Add Async Clipboard API as a feature in development on webkit.org.

* page/Settings.yaml:

Source/WebKit:

Adds a new experimental feature flag. See WebCore ChangeLog for more details.

* Shared/WebPreferences.yaml:

LayoutTests:

* editing/async-clipboard/clipboard-interfaces-expected.txt: Added.
* editing/async-clipboard/clipboard-interfaces.html: Added.

Add a new test to sanity check the new clipboard API interfaces and interface extensions.

* editing/async-clipboard/clipboard-wrapper-stays-alive-expected.txt: Added.
* editing/async-clipboard/clipboard-wrapper-stays-alive.html: Added.

Add a new test to make sure that the clipboard wrapper stays alive between GC passes, even when the clipboard's
navigator is kept alive, independently of its window object.

* fast/dom/navigator-detached-no-crash-expected.txt:
* platform/ios-wk1/TestExpectations:
* platform/mac-highsierra/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac-wk1/TestExpectations:
* platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/win/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/wincairo/fast/dom/navigator-detached-no-crash-expected.txt:

Update an existing layout test to include "navigator.clipboard".

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (250823 => 250824)


--- trunk/LayoutTests/ChangeLog	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/LayoutTests/ChangeLog	2019-10-08 14:50:27 UTC (rev 250824)
@@ -1,3 +1,33 @@
+2019-10-08  Wenson Hsieh  <[email protected]>
+
+        [Clipboard API] Introduce bindings for the async Clipboard API
+        https://bugs.webkit.org/show_bug.cgi?id=202622
+        <rdar://problem/56038126>
+
+        Reviewed by Ryosuke Niwa.
+
+        * editing/async-clipboard/clipboard-interfaces-expected.txt: Added.
+        * editing/async-clipboard/clipboard-interfaces.html: Added.
+
+        Add a new test to sanity check the new clipboard API interfaces and interface extensions.
+
+        * editing/async-clipboard/clipboard-wrapper-stays-alive-expected.txt: Added.
+        * editing/async-clipboard/clipboard-wrapper-stays-alive.html: Added.
+
+        Add a new test to make sure that the clipboard wrapper stays alive between GC passes, even when the clipboard's
+        navigator is kept alive, independently of its window object.
+
+        * fast/dom/navigator-detached-no-crash-expected.txt:
+        * platform/ios-wk1/TestExpectations:
+        * platform/mac-highsierra/fast/dom/navigator-detached-no-crash-expected.txt:
+        * platform/mac-wk1/TestExpectations:
+        * platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt:
+        * platform/mac/fast/dom/navigator-detached-no-crash-expected.txt:
+        * platform/win/fast/dom/navigator-detached-no-crash-expected.txt:
+        * platform/wincairo/fast/dom/navigator-detached-no-crash-expected.txt:
+
+        Update an existing layout test to include "navigator.clipboard".
+
 2019-10-08  Ali Juma  <[email protected]>
 
         Import autofocus Web Platform Tests

Added: trunk/LayoutTests/editing/async-clipboard/clipboard-interfaces-expected.txt (0 => 250824)


--- trunk/LayoutTests/editing/async-clipboard/clipboard-interfaces-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/editing/async-clipboard/clipboard-interfaces-expected.txt	2019-10-08 14:50:27 UTC (rev 250824)
@@ -0,0 +1,51 @@
+Tests the interfaces of the async clipboard API, which include Clipboard, ClipboardItem, and extensions to Navigator.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Testing Clipboard:
+PASS Clipboard instanceof Function is true
+PASS typeof Clipboard is "function"
+PASS navigator.clipboard instanceof Clipboard is true
+PASS Object.getPrototypeOf(navigator.clipboard) === Clipboard.prototype is true
+PASS Clipboard.prototype.readText instanceof Function is true
+PASS Clipboard.prototype.writeText instanceof Function is true
+PASS Clipboard.prototype.read instanceof Function is true
+PASS Clipboard.prototype.write instanceof Function is true
+PASS Clipboard() threw exception TypeError: Illegal constructor.
+PASS new Clipboard() threw exception TypeError: function is not a constructor (evaluating 'new Clipboard()').
+PASS Clipboard.toString() is "function Clipboard() {\n    [native code]\n}"
+PASS navigator.clipboard.toString() is "[object Clipboard]"
+PASS navigator.clipboard.writeText('foo') instanceof Promise is true
+PASS navigator.clipboard.write([ ]) instanceof Promise is true
+PASS navigator.clipboard.read() instanceof Promise is true
+PASS navigator.clipboard.readText() instanceof Promise is true
+PASS navigator.clipboard.write() rejected with TypeError: Not enough arguments
+PASS navigator.clipboard.writeText() rejected with TypeError: Not enough arguments
+PASS navigator.clipboard.write('foo') rejected with TypeError: Value is not a sequence
+PASS navigator.clipboard.write([1, 2, 3]) rejected with TypeError: Type error
+PASS navigator.clipboard.write(new ClipboardItem({ })) rejected with TypeError: Type error
+
+Testing ClipboardItem:
+PASS ClipboardItem instanceof Function is true
+PASS typeof ClipboardItem is "function"
+PASS ClipboardItem.prototype.getType instanceof Function is true
+PASS ClipboardItem() threw exception TypeError: Constructor requires 'new' operator.
+PASS new ClipboardItem() threw exception TypeError: Not enough arguments.
+PASS new ClipboardItem('foo') threw exception TypeError: Type error.
+PASS new ClipboardItem({ }) instanceof ClipboardItem is true
+PASS Object.getPrototypeOf(new ClipboardItem({ })) === ClipboardItem.prototype is true
+PASS new ClipboardItem({ }).types instanceof Array is true
+PASS ClipboardItem.toString() is "function ClipboardItem() {\n    [native code]\n}"
+PASS new ClipboardItem({ }).toString() is "[object ClipboardItem]"
+PASS new ClipboardItem({ }, { foo: 'attachment' }).presentationStyle is "unspecified"
+PASS new ClipboardItem({ }, { presentationStyle: 'AttaCHmenT' }).presentationStyle threw exception TypeError: Type error.
+PASS new ClipboardItem({ }, { presentationStyle: 'unspecified' }).presentationStyle is "unspecified"
+PASS new ClipboardItem({ }, { presentationStyle: 'attachment' }).presentationStyle is "attachment"
+PASS new ClipboardItem({ }, { presentationStyle: 'inline' }).presentationStyle is "inline"
+PASS new ClipboardItem({ }, 'inline') threw exception TypeError: Type error.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/editing/async-clipboard/clipboard-interfaces.html (0 => 250824)


--- trunk/LayoutTests/editing/async-clipboard/clipboard-interfaces.html	                        (rev 0)
+++ trunk/LayoutTests/editing/async-clipboard/clipboard-interfaces.html	2019-10-08 14:50:27 UTC (rev 250824)
@@ -0,0 +1,68 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ experimental:asyncClipboardAPIEnabled=true ] -->
+<html>
+    <head>
+        <script src=""
+    </head>
+    <script>
+        jsTestIsAsync = true;
+
+        async function shouldReject(scriptToEvaluate)
+        {
+            try {
+                testFailed(`${scriptToEvaluate} resolved to ${await eval(scriptToEvaluate)}`);
+            } catch (exception) {
+                testPassed(`${scriptToEvaluate} rejected with ${exception}`);
+            }
+        }
+
+        async function runTest()
+        {
+            description("Tests the interfaces of the async clipboard API, which include Clipboard, ClipboardItem, and extensions to Navigator.");
+
+            debug("\nTesting Clipboard:");
+            shouldBeTrue("Clipboard instanceof Function");
+            shouldBeEqualToString("typeof Clipboard", "function");
+            shouldBeTrue("navigator.clipboard instanceof Clipboard");
+            shouldBeTrue("Object.getPrototypeOf(navigator.clipboard) === Clipboard.prototype");
+            shouldBeTrue("Clipboard.prototype.readText instanceof Function");
+            shouldBeTrue("Clipboard.prototype.writeText instanceof Function");
+            shouldBeTrue("Clipboard.prototype.read instanceof Function");
+            shouldBeTrue("Clipboard.prototype.write instanceof Function");
+            shouldThrow("Clipboard()");
+            shouldThrow("new Clipboard()");
+            shouldBeEqualToString("Clipboard.toString()", "function Clipboard() {\n    [native code]\n}");
+            shouldBeEqualToString("navigator.clipboard.toString()", "[object Clipboard]");
+            shouldBeTrue("navigator.clipboard.writeText('foo') instanceof Promise");
+            shouldBeTrue("navigator.clipboard.write([ ]) instanceof Promise");
+            shouldBeTrue("navigator.clipboard.read() instanceof Promise");
+            shouldBeTrue("navigator.clipboard.readText() instanceof Promise");
+            await shouldReject("navigator.clipboard.write()");
+            await shouldReject("navigator.clipboard.writeText()");
+            await shouldReject("navigator.clipboard.write('foo')");
+            await shouldReject("navigator.clipboard.write([1, 2, 3])");
+            await shouldReject("navigator.clipboard.write(new ClipboardItem({ }))");
+
+            debug("\nTesting ClipboardItem:");
+            shouldBeTrue("ClipboardItem instanceof Function");
+            shouldBeEqualToString("typeof ClipboardItem", "function");
+            shouldBeTrue("ClipboardItem.prototype.getType instanceof Function");
+            shouldThrow("ClipboardItem()");
+            shouldThrow("new ClipboardItem()");
+            shouldThrow("new ClipboardItem('foo')");
+            shouldBeTrue("new ClipboardItem({ }) instanceof ClipboardItem");
+            shouldBeTrue("Object.getPrototypeOf(new ClipboardItem({ })) === ClipboardItem.prototype");
+            shouldBeTrue("new ClipboardItem({ }).types instanceof Array");
+            shouldBeEqualToString("ClipboardItem.toString()", "function ClipboardItem() {\n    [native code]\n}");
+            shouldBeEqualToString("new ClipboardItem({ }).toString()", "[object ClipboardItem]");
+            shouldBeEqualToString("new ClipboardItem({ }, { foo: 'attachment' }).presentationStyle", "unspecified");
+            shouldThrow("new ClipboardItem({ }, { presentationStyle: 'AttaCHmenT' }).presentationStyle");
+            shouldBeEqualToString("new ClipboardItem({ }, { presentationStyle: 'unspecified' }).presentationStyle", "unspecified");
+            shouldBeEqualToString("new ClipboardItem({ }, { presentationStyle: 'attachment' }).presentationStyle", "attachment");
+            shouldBeEqualToString("new ClipboardItem({ }, { presentationStyle: 'inline' }).presentationStyle", "inline");
+            shouldThrow("new ClipboardItem({ }, 'inline')");
+
+            finishJSTest();
+        }
+    </script>
+    <body _onload_=runTest()></body>
+</html>

Added: trunk/LayoutTests/editing/async-clipboard/clipboard-wrapper-stays-alive-expected.txt (0 => 250824)


--- trunk/LayoutTests/editing/async-clipboard/clipboard-wrapper-stays-alive-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/editing/async-clipboard/clipboard-wrapper-stays-alive-expected.txt	2019-10-08 14:50:27 UTC (rev 250824)
@@ -0,0 +1,10 @@
+Verifies that the wrapper for Navigator's Clipboard remains consistent across GC passes. This test must be run using WebKitTestRunner.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS subframeNavigator.clipboard.foo is "bar"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/editing/async-clipboard/clipboard-wrapper-stays-alive.html (0 => 250824)


--- trunk/LayoutTests/editing/async-clipboard/clipboard-wrapper-stays-alive.html	                        (rev 0)
+++ trunk/LayoutTests/editing/async-clipboard/clipboard-wrapper-stays-alive.html	2019-10-08 14:50:27 UTC (rev 250824)
@@ -0,0 +1,29 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ experimental:asyncClipboardAPIEnabled=true ] -->
+<html>
+    <head>
+        <script src=""
+    </head>
+    <script>
+        jsTestIsAsync = true;
+
+        addEventListener("load", async function() {
+            description("Verifies that the wrapper for Navigator's Clipboard remains consistent across GC passes. This test must be run using WebKitTestRunner.");
+
+            subframe = document.querySelector("iframe");
+            subframeNavigator = subframe.contentWindow.navigator;
+            subframeNavigator.clipboard.foo = "bar";
+            subframe.remove();
+            subframe = null;
+
+            if (window.GCController)
+                GCController.collect();
+
+            await new Promise(resolve => setTimeout(resolve, 50));
+            shouldBeEqualToString("subframeNavigator.clipboard.foo", "bar");
+            finishJSTest();
+        });
+    </script>
+    <body>
+        <iframe srcdoc="Hello world"></iframe>
+    </body>
+</html>

Modified: trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt (250823 => 250824)


--- trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt	2019-10-08 14:50:27 UTC (rev 250824)
@@ -5,6 +5,7 @@
 navigator.appCodeName is OK
 navigator.appName is OK
 navigator.appVersion is OK
+navigator.clipboard is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
@@ -31,6 +32,7 @@
 navigator.appCodeName is OK
 navigator.appName is OK
 navigator.appVersion is OK
+navigator.clipboard is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK

Modified: trunk/LayoutTests/platform/ios-wk1/TestExpectations (250823 => 250824)


--- trunk/LayoutTests/platform/ios-wk1/TestExpectations	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/LayoutTests/platform/ios-wk1/TestExpectations	2019-10-08 14:50:27 UTC (rev 250824)
@@ -15,6 +15,9 @@
 imported/w3c/web-platform-tests/fetch/api/request/destination [ Skip ]
 imported/w3c/web-platform-tests/fetch/cross-origin-resource-policy [ Skip ]
 
+# Async Clipboard API is not supported in WebKit1 yet.
+webkit.org/b/202654 editing/async-clipboard [ Skip ]
+
 # Skip WebRTC for now in WK1
 imported/w3c/web-platform-tests/webrtc [ Skip ]
 webrtc [ Skip ]

Modified: trunk/LayoutTests/platform/mac/fast/dom/navigator-detached-no-crash-expected.txt (250823 => 250824)


--- trunk/LayoutTests/platform/mac/fast/dom/navigator-detached-no-crash-expected.txt	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/LayoutTests/platform/mac/fast/dom/navigator-detached-no-crash-expected.txt	2019-10-08 14:50:27 UTC (rev 250824)
@@ -4,6 +4,7 @@
 navigator.appCodeName is OK
 navigator.appName is OK
 navigator.appVersion is OK
+navigator.clipboard is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
@@ -27,6 +28,7 @@
 navigator.appCodeName is OK
 navigator.appName is OK
 navigator.appVersion is OK
+navigator.clipboard is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK

Modified: trunk/LayoutTests/platform/mac-highsierra/fast/dom/navigator-detached-no-crash-expected.txt (250823 => 250824)


--- trunk/LayoutTests/platform/mac-highsierra/fast/dom/navigator-detached-no-crash-expected.txt	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/LayoutTests/platform/mac-highsierra/fast/dom/navigator-detached-no-crash-expected.txt	2019-10-08 14:50:27 UTC (rev 250824)
@@ -4,6 +4,7 @@
 navigator.appCodeName is OK
 navigator.appName is OK
 navigator.appVersion is OK
+navigator.clipboard is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
@@ -28,6 +29,7 @@
 navigator.appCodeName is OK
 navigator.appName is OK
 navigator.appVersion is OK
+navigator.clipboard is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (250823 => 250824)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2019-10-08 14:50:27 UTC (rev 250824)
@@ -44,6 +44,9 @@
 css-typedom [ Skip ]
 css-dark-mode [ Skip ]
 
+# Async Clipboard API is not supported in WebKit1 yet.
+webkit.org/b/202654 editing/async-clipboard [ Skip ]
+
 webgpu [ Skip ]
 inspector/canvas/create-context-webgpu.html [ Skip ]
 inspector/canvas/requestClientNodes-webgpu.html [ Skip ]

Modified: trunk/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt (250823 => 250824)


--- trunk/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt	2019-10-08 14:50:27 UTC (rev 250824)
@@ -5,6 +5,7 @@
 navigator.appCodeName is OK
 navigator.appName is OK
 navigator.appVersion is OK
+navigator.clipboard is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
@@ -31,6 +32,7 @@
 navigator.appCodeName is OK
 navigator.appName is OK
 navigator.appVersion is OK
+navigator.clipboard is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK

Modified: trunk/LayoutTests/platform/win/fast/dom/navigator-detached-no-crash-expected.txt (250823 => 250824)


--- trunk/LayoutTests/platform/win/fast/dom/navigator-detached-no-crash-expected.txt	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/LayoutTests/platform/win/fast/dom/navigator-detached-no-crash-expected.txt	2019-10-08 14:50:27 UTC (rev 250824)
@@ -4,6 +4,7 @@
 navigator.appCodeName is OK
 navigator.appName is OK
 navigator.appVersion is OK
+navigator.clipboard is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
@@ -24,6 +25,7 @@
 navigator.appCodeName is OK
 navigator.appName is OK
 navigator.appVersion is OK
+navigator.clipboard is OK
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK

Modified: trunk/LayoutTests/platform/wincairo/fast/dom/navigator-detached-no-crash-expected.txt (250823 => 250824)


--- trunk/LayoutTests/platform/wincairo/fast/dom/navigator-detached-no-crash-expected.txt	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/LayoutTests/platform/wincairo/fast/dom/navigator-detached-no-crash-expected.txt	2019-10-08 14:50:27 UTC (rev 250824)
@@ -3,6 +3,7 @@
 navigator.appCodeName is OK
 navigator.appName is OK
 navigator.appVersion is OK
+navigator.clipboard is OK
 navigator.cookieEnabled is OK
 navigator.getStorageUpdates() is OK
 navigator.javaEnabled() is OK
@@ -21,6 +22,7 @@
 navigator.appCodeName is OK
 navigator.appName is OK
 navigator.appVersion is OK
+navigator.clipboard is OK
 navigator.cookieEnabled is OK
 navigator.getStorageUpdates() is OK
 navigator.javaEnabled() is OK

Modified: trunk/Source/WebCore/CMakeLists.txt (250823 => 250824)


--- trunk/Source/WebCore/CMakeLists.txt	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/CMakeLists.txt	2019-10-08 14:50:27 UTC (rev 250824)
@@ -28,6 +28,7 @@
     "${WEBCORE_DIR}/Modules/applepay"
     "${WEBCORE_DIR}/Modules/applepay/paymentrequest"
     "${WEBCORE_DIR}/Modules/applicationmanifest"
+    "${WEBCORE_DIR}/Modules/async-clipboard"
     "${WEBCORE_DIR}/Modules/beacon"
     "${WEBCORE_DIR}/Modules/cache"
     "${WEBCORE_DIR}/Modules/credentialmanagement"
@@ -223,6 +224,10 @@
 set(WebCore_NON_SVG_IDL_FILES
     Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl
 
+    Modules/async-clipboard/Clipboard.idl
+    Modules/async-clipboard/ClipboardItem.idl
+    Modules/async-clipboard/NavigatorClipboard.idl
+
     Modules/beacon/NavigatorBeacon.idl
 
     Modules/cache/CacheQueryOptions.idl

Modified: trunk/Source/WebCore/ChangeLog (250823 => 250824)


--- trunk/Source/WebCore/ChangeLog	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/ChangeLog	2019-10-08 14:50:27 UTC (rev 250824)
@@ -1,3 +1,77 @@
+2019-10-08  Wenson Hsieh  <[email protected]>
+
+        [Clipboard API] Introduce bindings for the async Clipboard API
+        https://bugs.webkit.org/show_bug.cgi?id=202622
+        <rdar://problem/56038126>
+
+        Reviewed by Ryosuke Niwa.
+
+        Adds IDL for the async clipboard API (with the exception of delayed item generation interfaces, which
+        I'll iterate on and introduce separately). See: https://w3c.github.io/clipboard-apis/#async-clipboard-api for
+        more information.
+
+        Tests: editing/async-clipboard/clipboard-interfaces.html
+               editing/async-clipboard/clipboard-wrapper-stays-alive.html
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * Modules/async-clipboard/Clipboard.cpp:
+        (WebCore::Clipboard::create):
+        (WebCore::Clipboard::Clipboard):
+        (WebCore::Clipboard::navigator):
+        (WebCore::Clipboard::eventTargetInterface const):
+        (WebCore::Clipboard::scriptExecutionContext const):
+        (WebCore::Clipboard::readText):
+        (WebCore::Clipboard::writeText):
+        (WebCore::Clipboard::read):
+        (WebCore::Clipboard::write):
+
+        Stub out these API calls for now by immediately rejecting the given promise.
+
+        * Modules/async-clipboard/Clipboard.h:
+        * Modules/async-clipboard/Clipboard.idl:
+        * Modules/async-clipboard/ClipboardItem.cpp:
+        (WebCore::ClipboardItem::ClipboardItem):
+        (WebCore::ClipboardItem::create):
+        (WebCore::ClipboardItem::types const):
+        (WebCore::ClipboardItem::getType):
+
+        Stub out these API calls for now by immediately rejecting the given promise.
+
+        (WebCore::navigator):
+        * Modules/async-clipboard/ClipboardItem.h:
+        (WebCore::ClipboardItem::presentationStyle const):
+        * Modules/async-clipboard/ClipboardItem.idl:
+        * Modules/async-clipboard/NavigatorClipboard.cpp:
+        (WebCore::NavigatorClipboard::NavigatorClipboard):
+        (WebCore::NavigatorClipboard::clipboard):
+        (WebCore::NavigatorClipboard::from):
+        (WebCore::NavigatorClipboard::supplementName):
+        * Modules/async-clipboard/NavigatorClipboard.h:
+        * Modules/async-clipboard/NavigatorClipboard.idl:
+        * Modules/mediastream/MediaStreamTrack.cpp:
+        * Modules/mediastream/RTCDTMFSender.cpp:
+        * Modules/mediastream/RTCRtpSender.cpp:
+        * Modules/webgpu/WebGPUPipeline.h:
+
+        More unified sources-related build fixes.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/WebCoreBuiltinNames.h:
+        * dom/DeviceOrientationOrMotionEvent.cpp:
+
+        Unified sources-related build fix.
+
+        * dom/EventTargetFactory.in:
+        * features.json:
+
+        Add Async Clipboard API as a feature in development on webkit.org.
+
+        * page/Settings.yaml:
+
 2019-10-08  Rob Buis  <[email protected]>
 
         Fetch: data: URL HEAD request should result in empty response body

Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (250823 => 250824)


--- trunk/Source/WebCore/DerivedSources-input.xcfilelist	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist	2019-10-08 14:50:27 UTC (rev 250824)
@@ -47,6 +47,9 @@
 $(PROJECT_DIR)/Modules/applepay/ApplePayValidateMerchantEvent.idl
 $(PROJECT_DIR)/Modules/applepay/paymentrequest/ApplePayModifier.idl
 $(PROJECT_DIR)/Modules/applepay/paymentrequest/ApplePayRequest.idl
+$(PROJECT_DIR)/Modules/async-clipboard/Clipboard.idl
+$(PROJECT_DIR)/Modules/async-clipboard/ClipboardItem.idl
+$(PROJECT_DIR)/Modules/async-clipboard/NavigatorClipboard.idl
 $(PROJECT_DIR)/Modules/beacon/NavigatorBeacon.idl
 $(PROJECT_DIR)/Modules/cache/CacheQueryOptions.idl
 $(PROJECT_DIR)/Modules/cache/DOMCache.idl

Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (250823 => 250824)


--- trunk/Source/WebCore/DerivedSources-output.xcfilelist	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist	2019-10-08 14:50:27 UTC (rev 250824)
@@ -290,8 +290,12 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCharacterData.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSChildNode.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSChildNode.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSClipboard.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSClipboard.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSClipboardEvent.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSClipboardEvent.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSClipboardItem.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSClipboardItem.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCloseEvent.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCloseEvent.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCommandLineAPIHost.cpp
@@ -1067,6 +1071,8 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigator.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorBeacon.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorBeacon.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorClipboard.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorClipboard.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorCredentials.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorCredentials.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorEME.cpp

Modified: trunk/Source/WebCore/DerivedSources.make (250823 => 250824)


--- trunk/Source/WebCore/DerivedSources.make	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/DerivedSources.make	2019-10-08 14:50:27 UTC (rev 250824)
@@ -31,6 +31,7 @@
     $(WebCore)/Modules/airplay \
     $(WebCore)/Modules/applepay \
     $(WebCore)/Modules/applepay/paymentrequest \
+    $(WebCore)/Modules/async-clipboard \
     $(WebCore)/Modules/beacon \
     $(WebCore)/Modules/cache \
     $(WebCore)/Modules/credentialmanagement \
@@ -122,6 +123,9 @@
     $(WebCore)/Modules/applepay/ApplePayValidateMerchantEvent.idl \
     $(WebCore)/Modules/applepay/paymentrequest/ApplePayModifier.idl \
     $(WebCore)/Modules/applepay/paymentrequest/ApplePayRequest.idl \
+    $(WebCore)/Modules/async-clipboard/Clipboard.idl \
+    $(WebCore)/Modules/async-clipboard/ClipboardItem.idl \
+    $(WebCore)/Modules/async-clipboard/NavigatorClipboard.idl \
     $(WebCore)/Modules/beacon/NavigatorBeacon.idl \
     $(WebCore)/Modules/cache/CacheQueryOptions.idl \
     $(WebCore)/Modules/cache/DOMCache.idl \

Copied: trunk/Source/WebCore/Modules/async-clipboard/Clipboard.cpp (from rev 250823, trunk/Source/WebCore/Modules/webgpu/WebGPUPipeline.h) (0 => 250824)


--- trunk/Source/WebCore/Modules/async-clipboard/Clipboard.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/async-clipboard/Clipboard.cpp	2019-10-08 14:50:27 UTC (rev 250824)
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Clipboard.h"
+
+#include "ClipboardItem.h"
+#include "JSDOMPromise.h"
+#include "JSDOMPromiseDeferred.h"
+#include "Navigator.h"
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(Clipboard);
+
+Ref<Clipboard> Clipboard::create(Navigator& navigator)
+{
+    return adoptRef(*new Clipboard(navigator));
+}
+
+Clipboard::Clipboard(Navigator& navigator)
+    : m_navigator(makeWeakPtr(navigator))
+{
+}
+
+Navigator* Clipboard::navigator()
+{
+    return m_navigator.get();
+}
+
+EventTargetInterface Clipboard::eventTargetInterface() const
+{
+    return ClipboardEventTargetInterfaceType;
+}
+
+ScriptExecutionContext* Clipboard::scriptExecutionContext() const
+{
+    return m_navigator ? m_navigator->scriptExecutionContext() : nullptr;
+}
+
+void Clipboard::readText(Ref<DeferredPromise>&& promise)
+{
+    promise->reject(NotSupportedError);
+}
+
+void Clipboard::writeText(const String& data, Ref<DeferredPromise>&& promise)
+{
+    UNUSED_PARAM(data);
+    promise->reject(NotSupportedError);
+}
+
+void Clipboard::read(Ref<DeferredPromise>&& promise)
+{
+    promise->reject(NotSupportedError);
+}
+
+void Clipboard::write(const Vector<RefPtr<ClipboardItem>>& items, Ref<DeferredPromise>&& promise)
+{
+    UNUSED_PARAM(items);
+    promise->reject(NotSupportedError);
+}
+
+}

Copied: trunk/Source/WebCore/Modules/async-clipboard/Clipboard.h (from rev 250823, trunk/Source/WebCore/Modules/webgpu/WebGPUPipeline.h) (0 => 250824)


--- trunk/Source/WebCore/Modules/async-clipboard/Clipboard.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/async-clipboard/Clipboard.h	2019-10-08 14:50:27 UTC (rev 250824)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "EventTarget.h"
+#include <wtf/IsoMalloc.h>
+#include <wtf/Vector.h>
+#include <wtf/WeakPtr.h>
+
+namespace WebCore {
+
+class ClipboardItem;
+class DeferredPromise;
+class Navigator;
+
+class Clipboard final : public RefCounted<Clipboard>, public EventTargetWithInlineData {
+    WTF_MAKE_ISO_ALLOCATED(Clipboard);
+public:
+    static Ref<Clipboard> create(Navigator&);
+
+    EventTargetInterface eventTargetInterface() const final;
+    ScriptExecutionContext* scriptExecutionContext() const final;
+
+    Navigator* navigator();
+
+    using RefCounted::ref;
+    using RefCounted::deref;
+
+    void readText(Ref<DeferredPromise>&&);
+    void writeText(const String& data, Ref<DeferredPromise>&&);
+
+    void read(Ref<DeferredPromise>&&);
+    void write(const Vector<RefPtr<ClipboardItem>>& data, Ref<DeferredPromise>&&);
+
+private:
+    Clipboard(Navigator&);
+
+    void refEventTarget() final { ref(); }
+    void derefEventTarget() final { deref(); }
+
+    WeakPtr<Navigator> m_navigator;
+};
+
+} // namespace WebCore

Copied: trunk/Source/WebCore/Modules/async-clipboard/Clipboard.idl (from rev 250823, trunk/Source/WebCore/Modules/webgpu/WebGPUPipeline.h) (0 => 250824)


--- trunk/Source/WebCore/Modules/async-clipboard/Clipboard.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/async-clipboard/Clipboard.idl	2019-10-08 14:50:27 UTC (rev 250824)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+typedef sequence<ClipboardItem> ClipboardItems;
+
+[
+    SecureContext,
+    Exposed=Window,
+    EnabledBySetting=AsyncClipboardAPI,
+    GenerateIsReachable=ReachableFromNavigator
+] interface Clipboard : EventTarget {
+    [NewObject] Promise<ClipboardItems> read();
+    [NewObject] Promise<DOMString> readText();
+    [NewObject] Promise<void> write(ClipboardItems data);
+    [NewObject] Promise<void> writeText(DOMString data);
+};

Copied: trunk/Source/WebCore/Modules/async-clipboard/ClipboardItem.cpp (from rev 250823, trunk/Source/WebCore/Modules/webgpu/WebGPUPipeline.h) (0 => 250824)


--- trunk/Source/WebCore/Modules/async-clipboard/ClipboardItem.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/async-clipboard/ClipboardItem.cpp	2019-10-08 14:50:27 UTC (rev 250824)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ClipboardItem.h"
+
+#include "JSDOMPromise.h"
+#include "JSDOMPromiseDeferred.h"
+#include "Navigator.h"
+
+namespace WebCore {
+
+ClipboardItem::~ClipboardItem() = default;
+
+ClipboardItem::ClipboardItem(Vector<KeyValuePair<String, RefPtr<DOMPromise>>>&& items, const Options& options)
+    : m_presentationStyle(options.presentationStyle)
+{
+    UNUSED_PARAM(items);
+}
+
+Ref<ClipboardItem> ClipboardItem::create(Vector<KeyValuePair<String, RefPtr<DOMPromise>>>&& data, const Options& options)
+{
+    return adoptRef(*new ClipboardItem(WTFMove(data), options));
+}
+
+Vector<String> ClipboardItem::types() const
+{
+    return { };
+}
+
+void ClipboardItem::getType(const String& type, Ref<DeferredPromise>&& promise)
+{
+    UNUSED_PARAM(type);
+    promise->reject(NotSupportedError);
+}
+
+Navigator* ClipboardItem::navigator()
+{
+    // FIXME: When support for Clipboard.read() is implemented, this should instead return the associated Clipboard
+    // object's navigator, if it is associated with a Clipboard.
+    return nullptr;
+}
+
+} // namespace WebCore

Copied: trunk/Source/WebCore/Modules/async-clipboard/ClipboardItem.h (from rev 250823, trunk/Source/WebCore/Modules/webgpu/WebGPUPipeline.h) (0 => 250824)


--- trunk/Source/WebCore/Modules/async-clipboard/ClipboardItem.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/async-clipboard/ClipboardItem.h	2019-10-08 14:50:27 UTC (rev 250824)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/KeyValuePair.h>
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class DeferredPromise;
+class DOMPromise;
+class Navigator;
+
+class ClipboardItem : public RefCounted<ClipboardItem> {
+public:
+    ~ClipboardItem();
+
+    enum class PresentationStyle : uint8_t { Unspecified, Inline, Attachment };
+
+    struct Options {
+        PresentationStyle presentationStyle { PresentationStyle::Unspecified };
+    };
+
+    static Ref<ClipboardItem> create(Vector<KeyValuePair<String, RefPtr<DOMPromise>>>&&, const Options&);
+
+    Vector<String> types() const;
+    void getType(const String&, Ref<DeferredPromise>&&);
+
+    PresentationStyle presentationStyle() const { return m_presentationStyle; };
+    Navigator* navigator();
+
+private:
+    ClipboardItem(Vector<KeyValuePair<String, RefPtr<DOMPromise>>>&&, const Options&);
+
+    PresentationStyle m_presentationStyle { PresentationStyle::Unspecified };
+};
+
+} // namespace WebCore

Copied: trunk/Source/WebCore/Modules/async-clipboard/ClipboardItem.idl (from rev 250823, trunk/Source/WebCore/Modules/webgpu/WebGPUPipeline.h) (0 => 250824)


--- trunk/Source/WebCore/Modules/async-clipboard/ClipboardItem.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/async-clipboard/ClipboardItem.idl	2019-10-08 14:50:27 UTC (rev 250824)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+typedef (DOMString or Blob) ClipboardItemDataType;
+typedef Promise<ClipboardItemDataType> ClipboardItemData;
+
+enum PresentationStyle { "unspecified", "inline", "attachment" };
+
+dictionary ClipboardItemOptions {
+    PresentationStyle presentationStyle = "unspecified";
+};
+
+[
+    Constructor(record<DOMString, ClipboardItemData> items, optional ClipboardItemOptions options),
+    Exposed=Window,
+    EnabledBySetting=AsyncClipboardAPI,
+    ImplementationLacksVTable,
+    GenerateIsReachable=ReachableFromNavigator
+] interface ClipboardItem {
+    readonly attribute FrozenArray<DOMString> types;
+    [NewObject] Promise<Blob> getType(DOMString type);
+    readonly attribute PresentationStyle presentationStyle;
+};

Copied: trunk/Source/WebCore/Modules/async-clipboard/NavigatorClipboard.cpp (from rev 250823, trunk/Source/WebCore/Modules/webgpu/WebGPUPipeline.h) (0 => 250824)


--- trunk/Source/WebCore/Modules/async-clipboard/NavigatorClipboard.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/async-clipboard/NavigatorClipboard.cpp	2019-10-08 14:50:27 UTC (rev 250824)
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "NavigatorClipboard.h"
+
+#include "Clipboard.h"
+#include "Navigator.h"
+#include <wtf/StdLibExtras.h>
+
+namespace WebCore {
+
+NavigatorClipboard::NavigatorClipboard(Navigator& navigator)
+    : m_navigator(navigator)
+{
+}
+
+NavigatorClipboard::~NavigatorClipboard() = default;
+
+RefPtr<Clipboard> NavigatorClipboard::clipboard(Navigator& navigator)
+{
+    return NavigatorClipboard::from(navigator)->clipboard();
+}
+
+RefPtr<Clipboard> NavigatorClipboard::clipboard()
+{
+    if (!m_clipboard)
+        m_clipboard = Clipboard::create(m_navigator);
+    return m_clipboard;
+}
+
+NavigatorClipboard* NavigatorClipboard::from(Navigator& navigator)
+{
+    auto* supplement = static_cast<NavigatorClipboard*>(Supplement<Navigator>::from(&navigator, supplementName()));
+    if (!supplement) {
+        auto newSupplement = makeUnique<NavigatorClipboard>(navigator);
+        supplement = newSupplement.get();
+        provideTo(&navigator, supplementName(), WTFMove(newSupplement));
+    }
+    return supplement;
+}
+
+const char* NavigatorClipboard::supplementName()
+{
+    return "NavigatorClipboard";
+}
+
+}

Copied: trunk/Source/WebCore/Modules/async-clipboard/NavigatorClipboard.h (from rev 250823, trunk/Source/WebCore/Modules/webgpu/WebGPUPipeline.h) (0 => 250824)


--- trunk/Source/WebCore/Modules/async-clipboard/NavigatorClipboard.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/async-clipboard/NavigatorClipboard.h	2019-10-08 14:50:27 UTC (rev 250824)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "Supplementable.h"
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+class Clipboard;
+class Navigator;
+
+class NavigatorClipboard final : public Supplement<Navigator> {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    explicit NavigatorClipboard(Navigator&);
+    ~NavigatorClipboard();
+
+    static RefPtr<Clipboard> clipboard(Navigator&);
+    RefPtr<Clipboard> clipboard();
+
+private:
+    static NavigatorClipboard* from(Navigator&);
+    static const char* supplementName();
+
+    RefPtr<Clipboard> m_clipboard;
+    Navigator& m_navigator;
+};
+
+}

Copied: trunk/Source/WebCore/Modules/async-clipboard/NavigatorClipboard.idl (from rev 250823, trunk/Source/WebCore/Modules/webgpu/WebGPUPipeline.h) (0 => 250824)


--- trunk/Source/WebCore/Modules/async-clipboard/NavigatorClipboard.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/async-clipboard/NavigatorClipboard.idl	2019-10-08 14:50:27 UTC (rev 250824)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledBySetting=AsyncClipboardAPI,
+] partial interface Navigator {
+    [SecureContext, SameObject] readonly attribute Clipboard clipboard;
+};

Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp (250823 => 250824)


--- trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp	2019-10-08 14:50:27 UTC (rev 250824)
@@ -35,6 +35,7 @@
 #include "EventNames.h"
 #include "JSDOMPromiseDeferred.h"
 #include "JSOverconstrainedError.h"
+#include "Logging.h"
 #include "MediaConstraints.h"
 #include "MediaStream.h"
 #include "MediaStreamPrivate.h"

Modified: trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp (250823 => 250824)


--- trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp	2019-10-08 14:50:27 UTC (rev 250824)
@@ -30,6 +30,7 @@
 
 #include "RTCDTMFSenderBackend.h"
 #include "RTCDTMFToneChangeEvent.h"
+#include "RTCRtpSender.h"
 #include "ScriptExecutionContext.h"
 #include <wtf/IsoMallocInlines.h>
 

Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp (250823 => 250824)


--- trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp	2019-10-08 14:50:27 UTC (rev 250824)
@@ -33,6 +33,7 @@
 
 #if ENABLE(WEB_RTC)
 
+#include "JSDOMPromiseDeferred.h"
 #include "RTCDTMFSender.h"
 #include "RTCDTMFSenderBackend.h"
 #include "RTCRtpCapabilities.h"

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUPipeline.h (250823 => 250824)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUPipeline.h	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUPipeline.h	2019-10-08 14:50:27 UTC (rev 250824)
@@ -30,6 +30,7 @@
 #include "GPUObjectBase.h"
 #include "WebGPUShaderModule.h"
 #include <wtf/Forward.h>
+#include <wtf/Lock.h>
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/Sources.txt (250823 => 250824)


--- trunk/Source/WebCore/Sources.txt	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/Sources.txt	2019-10-08 14:50:27 UTC (rev 250824)
@@ -33,6 +33,10 @@
 
 #endif
 
+Modules/async-clipboard/Clipboard.cpp
+Modules/async-clipboard/ClipboardItem.cpp
+Modules/async-clipboard/NavigatorClipboard.cpp
+
 Modules/beacon/NavigatorBeacon.cpp
 
 Modules/cache/CacheStorageConnection.cpp
@@ -2690,7 +2694,9 @@
 JSChannelSplitterNode.cpp
 JSCharacterData.cpp
 JSChildNode.cpp
+JSClipboard.cpp
 JSClipboardEvent.cpp
+JSClipboardItem.cpp
 JSCloseEvent.cpp
 JSCommandLineAPIHost.cpp
 JSComment.cpp
@@ -3034,6 +3040,7 @@
 JSNamedNodeMap.cpp
 JSNavigator.cpp
 JSNavigatorBeacon.cpp
+JSNavigatorClipboard.cpp
 JSNavigatorCredentials.cpp
 JSNavigatorGeolocation.cpp
 JSNavigatorGPU.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (250823 => 250824)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-10-08 14:50:27 UTC (rev 250824)
@@ -4875,6 +4875,9 @@
 		F3ABFE0C130E9DA000E7F7D1 /* InstrumentingAgents.h in Headers */ = {isa = PBXBuildFile; fileRef = F3ABFE0B130E9DA000E7F7D1 /* InstrumentingAgents.h */; };
 		F3D461491161D53200CA0D09 /* JSErrorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D461471161D53200CA0D09 /* JSErrorHandler.h */; };
 		F433E9031DBBDBA200EF0D14 /* StaticPasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = F433E9021DBBDBA200EF0D14 /* StaticPasteboard.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		F440E77A233D94D70063F9AB /* NavigatorClipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = F440E76F233D94D30063F9AB /* NavigatorClipboard.h */; };
+		F440E77B233D94D70063F9AB /* ClipboardItem.h in Headers */ = {isa = PBXBuildFile; fileRef = F440E770233D94D40063F9AB /* ClipboardItem.h */; };
+		F440E77D233D94D70063F9AB /* Clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = F440E772233D94D50063F9AB /* Clipboard.h */; };
 		F44A5F591FED38F2007F5944 /* LegacyNSPasteboardTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = F44A5F571FED3830007F5944 /* LegacyNSPasteboardTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		F44EBBD91DB5D21400277334 /* StaticRange.h in Headers */ = {isa = PBXBuildFile; fileRef = F44EBBD81DB5D21400277334 /* StaticRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		F45C231E1995B73B00A6E2E3 /* AxisScrollSnapOffsets.h in Headers */ = {isa = PBXBuildFile; fileRef = F45C231C1995B73B00A6E2E3 /* AxisScrollSnapOffsets.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -10093,7 +10096,11 @@
 		836D032B1DA8A13200FFD96B /* JSEventInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEventInit.cpp; sourceTree = "<group>"; };
 		836D032C1DA8A13200FFD96B /* JSEventInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEventInit.h; sourceTree = "<group>"; };
 		836D032D1DA8A13200FFD96B /* JSClipboardEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSClipboardEvent.cpp; sourceTree = "<group>"; };
+		836D032D1DA8A13200FFD96C /* JSClipboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSClipboard.cpp; sourceTree = "<group>"; };
+		836D032D1DA8A13200FFD96D /* JSClipboardItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSClipboardItem.cpp; sourceTree = "<group>"; };
 		836D032E1DA8A13200FFD96B /* JSClipboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSClipboardEvent.h; sourceTree = "<group>"; };
+		836D032E1DA8A13200FFD96C /* JSClipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSClipboard.h; sourceTree = "<group>"; };
+		836D032E1DA8A13200FFD96D /* JSClipboardItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSClipboardItem.h; sourceTree = "<group>"; };
 		836DAA051CEAB7CD00A2B707 /* RenderDescendantIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderDescendantIterator.h; sourceTree = "<group>"; };
 		837056881F50915000D93425 /* JSFileCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileCallback.cpp; sourceTree = "<group>"; };
 		837056891F50915000D93425 /* JSFileSystemEntryCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileSystemEntryCallback.h; sourceTree = "<group>"; };
@@ -15170,6 +15177,15 @@
 		F42CEB54214031EE002DCA72 /* FontAttributeChangesCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FontAttributeChangesCocoa.mm; sourceTree = "<group>"; };
 		F433E9021DBBDBA200EF0D14 /* StaticPasteboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticPasteboard.h; sourceTree = "<group>"; };
 		F433E9041DBBDBC200EF0D14 /* StaticPasteboard.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = StaticPasteboard.cpp; sourceTree = "<group>"; };
+		F440E76E233D94D30063F9AB /* Clipboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Clipboard.cpp; sourceTree = "<group>"; };
+		F440E76F233D94D30063F9AB /* NavigatorClipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigatorClipboard.h; sourceTree = "<group>"; };
+		F440E770233D94D40063F9AB /* ClipboardItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClipboardItem.h; sourceTree = "<group>"; };
+		F440E771233D94D40063F9AB /* NavigatorClipboard.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorClipboard.idl; sourceTree = "<group>"; };
+		F440E772233D94D50063F9AB /* Clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Clipboard.h; sourceTree = "<group>"; };
+		F440E773233D94D50063F9AB /* NavigatorClipboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NavigatorClipboard.cpp; sourceTree = "<group>"; };
+		F440E774233D94D60063F9AB /* Clipboard.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Clipboard.idl; sourceTree = "<group>"; };
+		F440E775233D94D60063F9AB /* ClipboardItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClipboardItem.cpp; sourceTree = "<group>"; };
+		F440E777233D94D70063F9AB /* ClipboardItem.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ClipboardItem.idl; sourceTree = "<group>"; };
 		F442850B2140412500CCDA22 /* FontAttributeChanges.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FontAttributeChanges.cpp; sourceTree = "<group>"; };
 		F44A5F571FED3830007F5944 /* LegacyNSPasteboardTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LegacyNSPasteboardTypes.h; sourceTree = "<group>"; };
 		F44EBBD61DB5D1B600277334 /* StaticRange.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = StaticRange.idl; sourceTree = "<group>"; };
@@ -16588,6 +16604,7 @@
 				1221E0581C02B409006A1A00 /* Animation */,
 				1AE96A791D1A0A5C00B86768 /* ApplePay */,
 				41FB27881F34461B00795488 /* CacheAPI */,
+				F440E769233D93620063F9AB /* Clipboard */,
 				A83B79100CCB001B000B0825 /* Core */,
 				57C7A68D1E569A8400C67D71 /* CredentialManagement */,
 				E1FF8F61180745C600132674 /* Crypto */,
@@ -21936,6 +21953,7 @@
 				CE26169D187E6554007955F3 /* airplay */,
 				1A58E8611D19D37300C0EA73 /* applepay */,
 				63BD4A5C1F778E8400438722 /* applicationmanifest */,
+				F440E76A233D93C80063F9AB /* async-clipboard */,
 				832150791F27E96B0095B136 /* beacon */,
 				41380C1E1F34366000155FDA /* cache */,
 				57C7A6881E56946D00C67D71 /* credentialmanagement */,
@@ -26793,6 +26811,33 @@
 			path = mac;
 			sourceTree = "<group>";
 		};
+		F440E769233D93620063F9AB /* Clipboard */ = {
+			isa = PBXGroup;
+			children = (
+				836D032D1DA8A13200FFD96C /* JSClipboard.cpp */,
+				836D032E1DA8A13200FFD96C /* JSClipboard.h */,
+				836D032D1DA8A13200FFD96D /* JSClipboardItem.cpp */,
+				836D032E1DA8A13200FFD96D /* JSClipboardItem.h */,
+			);
+			name = Clipboard;
+			sourceTree = "<group>";
+		};
+		F440E76A233D93C80063F9AB /* async-clipboard */ = {
+			isa = PBXGroup;
+			children = (
+				F440E76E233D94D30063F9AB /* Clipboard.cpp */,
+				F440E772233D94D50063F9AB /* Clipboard.h */,
+				F440E774233D94D60063F9AB /* Clipboard.idl */,
+				F440E775233D94D60063F9AB /* ClipboardItem.cpp */,
+				F440E770233D94D40063F9AB /* ClipboardItem.h */,
+				F440E777233D94D70063F9AB /* ClipboardItem.idl */,
+				F440E773233D94D50063F9AB /* NavigatorClipboard.cpp */,
+				F440E76F233D94D30063F9AB /* NavigatorClipboard.h */,
+				F440E771233D94D40063F9AB /* NavigatorClipboard.idl */,
+			);
+			path = "async-clipboard";
+			sourceTree = "<group>";
+		};
 		F48389791E1DD23A0076B7EA /* EditingHistory */ = {
 			isa = PBXGroup;
 			children = (
@@ -28757,8 +28802,10 @@
 				E4A814D41C6DEC4000BF85AC /* ClassChangeInvalidation.h in Headers */,
 				8348BFAC1B85729800912F36 /* ClassCollection.h in Headers */,
 				4107908C1FC3F0330061B27A /* ClientOrigin.h in Headers */,
+				F440E77D233D94D70063F9AB /* Clipboard.h in Headers */,
 				7C3A91E61C963B8800D1A7E3 /* ClipboardAccessPolicy.h in Headers */,
 				85031B400A44EFC700F992E0 /* ClipboardEvent.h in Headers */,
+				F440E77B233D94D70063F9AB /* ClipboardItem.h in Headers */,
 				FB92DF4B15FED08700994433 /* ClipPathOperation.h in Headers */,
 				580371621A66F00A00BAF519 /* ClipRect.h in Headers */,
 				97AABD1314FA09D5007457AE /* CloseEvent.h in Headers */,
@@ -31003,6 +31050,7 @@
 				A9C6E5A60D746458006442E9 /* Navigator.h in Headers */,
 				E12719C70EEEC16800F61213 /* NavigatorBase.h in Headers */,
 				8321507E1F27EA1B0095B136 /* NavigatorBeacon.h in Headers */,
+				F440E77A233D94D70063F9AB /* NavigatorClipboard.h in Headers */,
 				372D3E57216578AE00C5E021 /* NavigatorCredentials.h in Headers */,
 				9711460414EF009A00674FD9 /* NavigatorGeolocation.h in Headers */,
 				5EA725D61ACABD5700EAD17B /* NavigatorMediaDevices.h in Headers */,

Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (250823 => 250824)


--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2019-10-08 14:50:27 UTC (rev 250824)
@@ -55,6 +55,8 @@
     macro(CacheStorage) \
     macro(Client) \
     macro(Clients) \
+    macro(Clipboard) \
+    macro(ClipboardItem) \
     macro(Credential) \
     macro(CredentialsContainer) \
     macro(CSSAnimation) \

Modified: trunk/Source/WebCore/dom/DeviceOrientationOrMotionEvent.cpp (250823 => 250824)


--- trunk/Source/WebCore/dom/DeviceOrientationOrMotionEvent.cpp	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/dom/DeviceOrientationOrMotionEvent.cpp	2019-10-08 14:50:27 UTC (rev 250824)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "DeviceOrientationOrMotionEvent.h"
 
+#include "DOMWindow.h"
+#include "DeviceOrientationAndMotionAccessController.h"
 #include "Document.h"
 #include "JSDOMPromiseDeferred.h"
 

Modified: trunk/Source/WebCore/dom/EventTargetFactory.in (250823 => 250824)


--- trunk/Source/WebCore/dom/EventTargetFactory.in	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/dom/EventTargetFactory.in	2019-10-08 14:50:27 UTC (rev 250824)
@@ -7,6 +7,7 @@
 AudioNode conditional=WEB_AUDIO
 AudioContext conditional=WEB_AUDIO
 AudioTrackList conditional=VIDEO_TRACK
+Clipboard
 DedicatedWorkerGlobalScope
 DOMApplicationCache
 DOMWindow

Modified: trunk/Source/WebCore/features.json (250823 => 250824)


--- trunk/Source/WebCore/features.json	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/features.json	2019-10-08 14:50:27 UTC (rev 250824)
@@ -12,6 +12,21 @@
         "description": "Resources are saved for offline use using a manifest."
     },
     {
+        "name": "Async Clipboard API",
+        "status": {
+            "status": "In Development"
+        },
+        "url": "https://www.w3.org/TR/clipboard-apis/#async-clipboard-api",
+        "specification": "Clipboard API",
+        "category": "webapps",
+        "description": "An API that allows reading from and writing to the system clipboard.",
+        "contact": {
+            "name": "Wenson Hsieh",
+            "email": "[email protected]",
+            "twitter": "@wensonhsieh"
+        }
+    },
+    {
         "name": "Battery Status API",
         "status": {
             "status": "Not Considering"

Modified: trunk/Source/WebCore/page/Settings.yaml (250823 => 250824)


--- trunk/Source/WebCore/page/Settings.yaml	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebCore/page/Settings.yaml	2019-10-08 14:50:27 UTC (rev 250824)
@@ -118,6 +118,8 @@
 clipboardAccessPolicy:
   type: ClipboardAccessPolicy
   initial: ClipboardAccessPolicy::RequiresUserGesture
+asyncClipboardAPIEnabled:
+  initial: false
 
 textAreasAreResizable:
   initial: false

Modified: trunk/Source/WebKit/ChangeLog (250823 => 250824)


--- trunk/Source/WebKit/ChangeLog	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebKit/ChangeLog	2019-10-08 14:50:27 UTC (rev 250824)
@@ -1,3 +1,15 @@
+2019-10-08  Wenson Hsieh  <[email protected]>
+
+        [Clipboard API] Introduce bindings for the async Clipboard API
+        https://bugs.webkit.org/show_bug.cgi?id=202622
+        <rdar://problem/56038126>
+
+        Reviewed by Ryosuke Niwa.
+
+        Adds a new experimental feature flag. See WebCore ChangeLog for more details.
+
+        * Shared/WebPreferences.yaml:
+
 2019-10-08  Alexander Mikhaylenko  <[email protected]>
 
         [GTK] Navigation gesture improvements

Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (250823 => 250824)


--- trunk/Source/WebKit/Shared/WebPreferences.yaml	2019-10-08 13:56:50 UTC (rev 250823)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml	2019-10-08 14:50:27 UTC (rev 250824)
@@ -853,6 +853,13 @@
   humanReadableDescription: "Enable custom clipboard types and better security model for clipboard API."
   webcoreBinding: RuntimeEnabledFeatures
 
+AsyncClipboardAPIEnabled:
+  type: bool
+  defaultValue: false
+  humanReadableName: "Async clipboard API"
+  humanReadableDescription: "Enable the async clipboard API"
+  category: experimental
+
 WebShareEnabled:
   type: bool
   defaultValue: DEFAULT_WEB_SHARE_ENABLED
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to