Diff
Modified: trunk/LayoutTests/ChangeLog (242316 => 242317)
--- trunk/LayoutTests/ChangeLog 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/LayoutTests/ChangeLog 2019-03-02 21:50:43 UTC (rev 242317)
@@ -1,3 +1,27 @@
+2019-03-02 Wenson Hsieh <[email protected]>
+
+ [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
+ https://bugs.webkit.org/show_bug.cgi?id=195053
+ <rdar://problem/48134710>
+
+ Reviewed by Ryosuke Niwa.
+
+ Adjust several existing DOM paste tests to copy text from a child frame that has a different origin as the main
+ frame, such that we'll trigger the paste callout menu when performing a programmatic paste. Also add a new
+ layout test that copies and programmatically pastes within the same document, to verify that no paste callout is
+ displayed and the paste is allowed.
+
+ * editing/pasteboard/ios/dom-paste-confirmation-expected.txt:
+ * editing/pasteboard/ios/dom-paste-confirmation.html:
+ * editing/pasteboard/ios/dom-paste-consecutive-confirmations-expected.txt:
+ * editing/pasteboard/ios/dom-paste-consecutive-confirmations.html:
+ * editing/pasteboard/ios/dom-paste-rejection-expected.txt:
+ * editing/pasteboard/ios/dom-paste-rejection.html:
+ * editing/pasteboard/ios/dom-paste-requires-user-gesture-expected.txt:
+ * editing/pasteboard/ios/dom-paste-requires-user-gesture.html:
+ * editing/pasteboard/ios/dom-paste-same-origin-expected.txt: Copied from LayoutTests/editing/pasteboard/ios/dom-paste-confirmation-expected.txt.
+ * editing/pasteboard/ios/dom-paste-same-origin.html: Copied from LayoutTests/editing/pasteboard/ios/dom-paste-confirmation.html.
+
2019-03-02 Simon Fraser <[email protected]>
REGRESSION (r242132): Incorrect positioning with multiple position:fixed elements
Modified: trunk/LayoutTests/editing/pasteboard/ios/dom-paste-confirmation-expected.txt (242316 => 242317)
--- trunk/LayoutTests/editing/pasteboard/ios/dom-paste-confirmation-expected.txt 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/LayoutTests/editing/pasteboard/ios/dom-paste-confirmation-expected.txt 2019-03-02 21:50:43 UTC (rev 242317)
@@ -1,6 +1,6 @@
Click here to copy
Click here to copy
-Click here to copy
+
Verifies that a callout is shown when the page programmatically triggers paste, and that tapping the callout allows the paste to happen. To manually test, tap the text on the bottom, tap the editable area above, and then select 'Paste' in the resulting callout menu. The text 'Click here to copy' should be pasted twice in the editable area.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Modified: trunk/LayoutTests/editing/pasteboard/ios/dom-paste-confirmation.html (242316 => 242317)
--- trunk/LayoutTests/editing/pasteboard/ios/dom-paste-confirmation.html 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/LayoutTests/editing/pasteboard/ios/dom-paste-confirmation.html 2019-03-02 21:50:43 UTC (rev 242317)
@@ -10,12 +10,7 @@
margin: 0;
}
-#copy, #editor {
- text-align: center;
-}
-
#copy {
- font-size: 40px;
width: 100%;
height: 50px;
border: 1px dashed black;
@@ -25,28 +20,29 @@
width: 100%;
height: 100px;
border: 1px dashed silver;
+ text-align: center;
}
</style>
</head>
<body>
<div id="editor" contenteditable></div>
-<div id="copy">Click here to copy</div>
+<iframe id="copy" src="" id='copy' style='font-size: 40px; text-align: center;'>Click here to copy</div>
+ <script>
+ copy.addEventListener('click', () => {
+ getSelection().selectAllChildren(copy);
+ document.execCommand('Copy');
+ getSelection().removeAllRanges();
+ });
+ </script>"></iframe>
<div id="description"></div>
<div id="console"></div>
<script>
jsTestIsAsync = true;
-const copy = document.getElementById("copy");
const editor = document.getElementById("editor");
description("Verifies that a callout is shown when the page programmatically triggers paste, and that tapping the callout allows the paste to happen. To manually test, tap the text on the bottom, tap the editable area above, and then select 'Paste' in the resulting callout menu. The text 'Click here to copy' should be pasted <strong><em>twice</em></strong> in the editable area.");
-copy.addEventListener("click", () => {
- getSelection().selectAllChildren(copy);
- document.execCommand("Copy");
- getSelection().removeAllRanges();
-});
-
editor.addEventListener("paste", event => shouldBeEqualToString("event.clipboardData.getData('text/plain')", "Click here to copy"));
editor.addEventListener("click", event => {
getSelection().setPosition(editor);
@@ -60,7 +56,7 @@
editor.blur();
});
-(async () => {
+addEventListener("load", async () => {
if (!window.testRunner)
return;
@@ -67,7 +63,7 @@
await UIHelper.activateAt(160, 125);
await triggerPasteMenuAfterTapAt(160, 50);
finishJSTest();
-})();
+});
</script>
</body>
</html>
Modified: trunk/LayoutTests/editing/pasteboard/ios/dom-paste-consecutive-confirmations-expected.txt (242316 => 242317)
--- trunk/LayoutTests/editing/pasteboard/ios/dom-paste-consecutive-confirmations-expected.txt 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/LayoutTests/editing/pasteboard/ios/dom-paste-consecutive-confirmations-expected.txt 2019-03-02 21:50:43 UTC (rev 242317)
@@ -1,4 +1,4 @@
-Click here to copy
+
Verifies that no callout is shown when the page programmatically triggers paste on a timer after user interaction. To test manually, click the text on the bottom to copy, and then click the editable area above to trigger two programmatic pastes with the callout bar. Check that permissions for the first programmatic paste do not affect the second programmatic paste, since it is performed on a zero-delay timer.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Modified: trunk/LayoutTests/editing/pasteboard/ios/dom-paste-consecutive-confirmations.html (242316 => 242317)
--- trunk/LayoutTests/editing/pasteboard/ios/dom-paste-consecutive-confirmations.html 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/LayoutTests/editing/pasteboard/ios/dom-paste-consecutive-confirmations.html 2019-03-02 21:50:43 UTC (rev 242317)
@@ -10,12 +10,7 @@
margin: 0;
}
-#copy, #editor {
- text-align: center;
-}
-
#copy {
- font-size: 40px;
width: 100%;
height: 50px;
border: 1px dashed black;
@@ -25,18 +20,25 @@
width: 100%;
height: 100px;
border: 1px dashed silver;
+ text-align: center;
}
</style>
</head>
<body>
<div id="editor" contenteditable></div>
-<div id="copy">Click here to copy</div>
+<iframe id="copy" src="" id='copy' style='font-size: 40px; text-align: center;'>Click here to copy</div>
+ <script>
+ copy.addEventListener('click', () => {
+ getSelection().selectAllChildren(copy);
+ document.execCommand('Copy');
+ getSelection().removeAllRanges();
+ });
+ </script>"></iframe>
<div id="description"></div>
<div id="console"></div>
<script>
jsTestIsAsync = true;
-const copy = document.getElementById("copy");
const editor = document.getElementById("editor");
description("Verifies that no callout is shown when the page programmatically triggers paste on a timer after user interaction. To test manually, click the text on the bottom to copy, and then click the editable area above to trigger two programmatic pastes with the callout bar. Check that permissions for the first programmatic paste do not affect the second programmatic paste, since it is performed on a zero-delay timer.");
@@ -60,12 +62,6 @@
});
}
-copy.addEventListener("click", () => {
- getSelection().selectAllChildren(copy);
- document.execCommand("Copy");
- getSelection().removeAllRanges();
-});
-
function paste() {
getSelection().setPosition(editor);
shouldBe("document.execCommand('Paste')", "true");
@@ -80,7 +76,7 @@
setTimeout(paste, 0);
});
-(async () => {
+addEventListener("load", async () => {
if (!window.testRunner || !window.internals)
return;
@@ -87,7 +83,7 @@
waitForAndTapPasteMenuTwice().then(finishJSTest);
await UIHelper.activateAt(160, 125);
await UIHelper.activateAt(160, 50);
-})();
+});
</script>
</body>
</html>
Modified: trunk/LayoutTests/editing/pasteboard/ios/dom-paste-rejection-expected.txt (242316 => 242317)
--- trunk/LayoutTests/editing/pasteboard/ios/dom-paste-rejection-expected.txt 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/LayoutTests/editing/pasteboard/ios/dom-paste-rejection-expected.txt 2019-03-02 21:50:43 UTC (rev 242317)
@@ -1,4 +1,4 @@
-Click here to copy
+
Verifies that a callout is shown when the page programmatically triggers paste, and that dismissing the callout prevents the paste from happening. To manually test, tap the text on the bottom, tap the editable area above, and then dismiss the resulting callout menu by scrolling or tapping elsewhere. The text 'Click here to copy' should not be pasted, and the callout bar should disappear.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Modified: trunk/LayoutTests/editing/pasteboard/ios/dom-paste-rejection.html (242316 => 242317)
--- trunk/LayoutTests/editing/pasteboard/ios/dom-paste-rejection.html 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/LayoutTests/editing/pasteboard/ios/dom-paste-rejection.html 2019-03-02 21:50:43 UTC (rev 242317)
@@ -10,12 +10,7 @@
margin: 0;
}
-#copy, #editor {
- text-align: center;
-}
-
#copy {
- font-size: 40px;
width: 100%;
height: 50px;
border: 1px dashed black;
@@ -25,28 +20,29 @@
width: 100%;
height: 100px;
border: 1px dashed silver;
+ text-align: center;
}
</style>
</head>
<body>
<div id="editor" contenteditable></div>
-<div id="copy">Click here to copy</div>
+<iframe id="copy" src="" id='copy' style='font-size: 40px; text-align: center;'>Click here to copy</div>
+ <script>
+ copy.addEventListener('click', () => {
+ getSelection().selectAllChildren(copy);
+ document.execCommand('Copy');
+ getSelection().removeAllRanges();
+ });
+ </script>"></iframe>
<div id="description"></div>
<div id="console"></div>
<script>
jsTestIsAsync = true;
-const copy = document.getElementById("copy");
const editor = document.getElementById("editor");
description("Verifies that a callout is shown when the page programmatically triggers paste, and that dismissing the callout prevents the paste from happening. To manually test, tap the text on the bottom, tap the editable area above, and then dismiss the resulting callout menu by scrolling or tapping elsewhere. The text 'Click here to copy' should <strong>not</strong> be pasted, and the callout bar should disappear.");
-copy.addEventListener("click", () => {
- getSelection().selectAllChildren(copy);
- document.execCommand("Copy");
- getSelection().removeAllRanges();
-});
-
editor.addEventListener("paste", event => shouldBeEqualToString("event.clipboardData.getData('text/plain')", "Click here to copy"));
editor.addEventListener("click", event => {
getSelection().setPosition(editor);
@@ -59,7 +55,7 @@
editor.blur();
});
-(async () => {
+addEventListener("load", async () => {
if (!window.testRunner)
return;
@@ -66,7 +62,7 @@
await UIHelper.activateAt(160, 125);
await triggerPasteMenuAfterTapAt(160, 50, false);
finishJSTest();
-})();
+});
</script>
</body>
</html>
Modified: trunk/LayoutTests/editing/pasteboard/ios/dom-paste-requires-user-gesture-expected.txt (242316 => 242317)
--- trunk/LayoutTests/editing/pasteboard/ios/dom-paste-requires-user-gesture-expected.txt 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/LayoutTests/editing/pasteboard/ios/dom-paste-requires-user-gesture-expected.txt 2019-03-02 21:50:43 UTC (rev 242317)
@@ -1,5 +1,5 @@
Click here to copy
-Click here to copy
+
Verifies that no callout is shown when the page programmatically triggers paste outside the scope of user interaction. This test requires WebKitTestRunner.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Modified: trunk/LayoutTests/editing/pasteboard/ios/dom-paste-requires-user-gesture.html (242316 => 242317)
--- trunk/LayoutTests/editing/pasteboard/ios/dom-paste-requires-user-gesture.html 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/LayoutTests/editing/pasteboard/ios/dom-paste-requires-user-gesture.html 2019-03-02 21:50:43 UTC (rev 242317)
@@ -10,12 +10,7 @@
margin: 0;
}
-#copy, #editor {
- text-align: center;
-}
-
#copy {
- font-size: 40px;
width: 100%;
height: 50px;
border: 1px dashed black;
@@ -25,36 +20,39 @@
width: 100%;
height: 100px;
border: 1px dashed silver;
+ text-align: center;
}
</style>
</head>
<body>
<div id="editor" contenteditable></div>
-<div id="copy">Click here to copy</div>
+<iframe id="copy" src="" id='copy' style='font-size: 40px; text-align: center;'>Click here to copy</div>
+ <script>
+ copy.addEventListener('click', () => {
+ getSelection().selectAllChildren(copy);
+ document.execCommand('Copy');
+ getSelection().removeAllRanges();
+ });
+ </script>"></iframe>
<div id="description"></div>
<div id="console"></div>
<script>
jsTestIsAsync = true;
-const copy = document.getElementById("copy");
const editor = document.getElementById("editor");
description("Verifies that no callout is shown when the page programmatically triggers paste outside the scope of user interaction. This test requires WebKitTestRunner.");
-copy.addEventListener("click", () => {
- getSelection().selectAllChildren(copy);
- document.execCommand("Copy");
- getSelection().removeAllRanges();
-});
+addEventListener("load", async () => {
+ UIHelper.activateAt(160, 125).then(() => {
+ editor.focus();
+ waitForPasteMenu().then(finishJSTest);
-UIHelper.activateAt(160, 125).then(() => {
- editor.focus();
- waitForPasteMenu().then(finishJSTest);
-
- UIHelper.ensurePresentationUpdate().then(() => {
- internals.withUserGesture(() => shouldBe("document.execCommand('Paste')", "true"));
- shouldBe("document.execCommand('Paste')", "false");
- shouldBeEqualToString("editor.textContent", "Click here to copy");
+ UIHelper.ensurePresentationUpdate().then(() => {
+ internals.withUserGesture(() => shouldBe("document.execCommand('Paste')", "true"));
+ shouldBe("document.execCommand('Paste')", "false");
+ shouldBeEqualToString("editor.textContent", "Click here to copy");
+ });
});
});
</script>
Copied: trunk/LayoutTests/editing/pasteboard/ios/dom-paste-same-origin-expected.txt (from rev 242316, trunk/LayoutTests/editing/pasteboard/ios/dom-paste-confirmation-expected.txt) (0 => 242317)
--- trunk/LayoutTests/editing/pasteboard/ios/dom-paste-same-origin-expected.txt (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/ios/dom-paste-same-origin-expected.txt 2019-03-02 21:50:43 UTC (rev 242317)
@@ -0,0 +1,18 @@
+Click here to copy
+Click here to copy
+Click here to copy
+Verifies that programmatic paste is allowed when copied data is from the same origin. To manually test, tap the text on the bottom to programmatically copy, and then tap the editable area and check that the text is pasted twice.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS document.queryCommandSupported('Paste') is true
+PASS document.queryCommandEnabled('Paste') is true
+PASS event.clipboardData.getData('text/plain') is "Click here to copy"
+PASS document.execCommand('Paste') is true
+PASS event.clipboardData.getData('text/plain') is "Click here to copy"
+PASS document.execCommand('Paste') is true
+PASS editor.textContent is "Click here to copyClick here to copy"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Copied: trunk/LayoutTests/editing/pasteboard/ios/dom-paste-same-origin.html (from rev 242316, trunk/LayoutTests/editing/pasteboard/ios/dom-paste-confirmation.html) (0 => 242317)
--- trunk/LayoutTests/editing/pasteboard/ios/dom-paste-same-origin.html (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/ios/dom-paste-same-origin.html 2019-03-02 21:50:43 UTC (rev 242317)
@@ -0,0 +1,71 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ domPasteAllowed=false useFlexibleViewport=true ] -->
+<html>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<head>
+<script src=""
+<script src=""
+<style>
+body {
+ margin: 0;
+}
+
+#copy, #editor {
+ width: 100%;
+ text-align: center;
+}
+
+#copy {
+ height: 50px;
+ border: 1px dashed black;
+ font-size: 40px;
+}
+
+#editor {
+ height: 100px;
+ border: 1px dashed silver;
+}
+</style>
+</head>
+<body>
+<div id="editor" contenteditable></div>
+<div id='copy' style=''>Click here to copy</div>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+jsTestIsAsync = true;
+
+const copy = document.getElementById("copy");
+const editor = document.getElementById("editor");
+
+description("Verifies that programmatic paste is allowed when copied data is from the same origin. To manually test, tap the text on the bottom to programmatically copy, and then tap the editable area and check that the text is pasted <em>twice</em>.");
+
+copy.addEventListener('click', () => {
+ getSelection().selectAllChildren(copy);
+ document.execCommand('Copy');
+ getSelection().removeAllRanges();
+});
+
+editor.addEventListener("paste", event => shouldBeEqualToString("event.clipboardData.getData('text/plain')", "Click here to copy"));
+editor.addEventListener("click", event => {
+ getSelection().setPosition(editor);
+ shouldBe("document.queryCommandSupported('Paste')", "true");
+ shouldBe("document.queryCommandEnabled('Paste')", "true");
+ shouldBe("document.execCommand('Paste')", "true");
+ document.execCommand('InsertParagraph');
+ shouldBe("document.execCommand('Paste')", "true");
+ shouldBeEqualToString("editor.textContent", "Click here to copyClick here to copy");
+ event.preventDefault();
+ editor.blur();
+ finishJSTest();
+});
+
+addEventListener("load", async () => {
+ if (!window.testRunner)
+ return;
+
+ await UIHelper.activateAt(160, 125);
+ await UIHelper.activateAt(160, 50);
+});
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (242316 => 242317)
--- trunk/Source/WebCore/ChangeLog 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebCore/ChangeLog 2019-03-02 21:50:43 UTC (rev 242317)
@@ -1,3 +1,30 @@
+2019-03-02 Wenson Hsieh <[email protected]>
+
+ [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
+ https://bugs.webkit.org/show_bug.cgi?id=195053
+ <rdar://problem/48134710>
+
+ Reviewed by Ryosuke Niwa.
+
+ Plumb the document pasteboard identifier through the client when making a DOM paste access request. See WebKit
+ ChangeLog for more details.
+
+ Test: editing/pasteboard/ios/dom-paste-same-origin.html
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/DOMPasteAccess.h: Renamed from Source/WebCore/dom/DOMPasteAccessPolicy.h.
+
+ Introduce DOMPasteAccessResponse, which is either DeniedForGesture, GrantedForCommand, or GrantedForGesture. In
+ particular, when pasteboard identifiers match, we only grant access for the current paste command, rather than
+ throughout the user gesture.
+
+ * dom/UserGestureIndicator.h:
+ (WebCore::UserGestureToken::didRequestDOMPasteAccess):
+ * loader/EmptyClients.cpp:
+ * page/EditorClient.h:
+ * page/Frame.cpp:
+ (WebCore::Frame::requestDOMPasteAccess):
+
2019-02-27 Darin Adler <[email protected]>
Fixed makeString(float) to do shortest-form serialization without first converting to double
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (242316 => 242317)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-03-02 21:50:43 UTC (rev 242317)
@@ -4950,7 +4950,7 @@
F48D2A7E2157182600C6752B /* FontAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = F48D2A712156DC0A00C6752B /* FontAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; };
F48D2AA52159740D00C6752B /* ColorCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = F48D2AA32159740D00C6752B /* ColorCocoa.h */; };
F49786881FF45FA500E060AB /* PasteboardItemInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = F49786871FF45FA500E060AB /* PasteboardItemInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
- F4B422C4220C0568009E1E7D /* DOMPasteAccessPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = F4B422C2220C0000009E1E7D /* DOMPasteAccessPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ F4B422C4220C0568009E1E7D /* DOMPasteAccess.h in Headers */ = {isa = PBXBuildFile; fileRef = F4B422C2220C0000009E1E7D /* DOMPasteAccess.h */; settings = {ATTRIBUTES = (Private, ); }; };
F4BFB9851E1DDF9B00862C24 /* DumpEditingHistory.js in Copy Scripts */ = {isa = PBXBuildFile; fileRef = F48389831E1DDF2B0076B7EA /* DumpEditingHistory.js */; };
F4BFB9861E1DDF9B00862C24 /* EditingHistoryUtil.js in Copy Scripts */ = {isa = PBXBuildFile; fileRef = F48389841E1DDF2B0076B7EA /* EditingHistoryUtil.js */; };
F4D43D662188038B00ECECAC /* SerializedAttachmentData.h in Headers */ = {isa = PBXBuildFile; fileRef = F4D43D64218802E600ECECAC /* SerializedAttachmentData.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -15183,7 +15183,7 @@
F48D2AA42159740D00C6752B /* ColorCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ColorCocoa.mm; sourceTree = "<group>"; };
F49786871FF45FA500E060AB /* PasteboardItemInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PasteboardItemInfo.h; sourceTree = "<group>"; };
F49E98E421DEE6C1009AE55E /* EditAction.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = EditAction.cpp; sourceTree = "<group>"; };
- F4B422C2220C0000009E1E7D /* DOMPasteAccessPolicy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOMPasteAccessPolicy.h; sourceTree = "<group>"; };
+ F4B422C2220C0000009E1E7D /* DOMPasteAccess.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOMPasteAccess.h; sourceTree = "<group>"; };
F4D43D64218802E600ECECAC /* SerializedAttachmentData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SerializedAttachmentData.h; sourceTree = "<group>"; };
F4D9817D2195FBF6008230FC /* ChangeListTypeCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ChangeListTypeCommand.h; sourceTree = "<group>"; };
F4D9817E2195FBF6008230FC /* ChangeListTypeCommand.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ChangeListTypeCommand.cpp; sourceTree = "<group>"; };
@@ -27503,7 +27503,7 @@
A8185F3609765765005826D9 /* DOMImplementation.cpp */,
A8185F3309765765005826D9 /* DOMImplementation.h */,
93EEC1E909C2877700C515D1 /* DOMImplementation.idl */,
- F4B422C2220C0000009E1E7D /* DOMPasteAccessPolicy.h */,
+ F4B422C2220C0000009E1E7D /* DOMPasteAccess.h */,
0F4966991DB408C100A274BB /* DOMPoint.h */,
0F49669A1DB408C100A274BB /* DOMPoint.idl */,
0F4966A21DB4091000A274BB /* DOMPointInit.h */,
@@ -29079,7 +29079,7 @@
A9C6E4E40D745E05006442E9 /* DOMMimeType.h in Headers */,
A9C6E4E80D745E18006442E9 /* DOMMimeTypeArray.h in Headers */,
1ACE53E80A8D18E70022947D /* DOMParser.h in Headers */,
- F4B422C4220C0568009E1E7D /* DOMPasteAccessPolicy.h in Headers */,
+ F4B422C4220C0568009E1E7D /* DOMPasteAccess.h in Headers */,
7A54881714E432A1006AE05A /* DOMPatchSupport.h in Headers */,
A9C6E4EC0D745E2B006442E9 /* DOMPlugin.h in Headers */,
A9C6E4F00D745E38006442E9 /* DOMPluginArray.h in Headers */,
Copied: trunk/Source/WebCore/dom/DOMPasteAccess.h (from rev 242316, trunk/Source/WebCore/dom/DOMPasteAccessPolicy.h) (0 => 242317)
--- trunk/Source/WebCore/dom/DOMPasteAccess.h (rev 0)
+++ trunk/Source/WebCore/dom/DOMPasteAccess.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -0,0 +1,57 @@
+/*
+ * 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/Forward.h>
+
+namespace WebCore {
+
+enum class DOMPasteAccessPolicy : uint8_t {
+ NotRequestedYet,
+ Denied,
+ Granted
+};
+
+enum class DOMPasteAccessResponse : uint8_t {
+ DeniedForGesture,
+ GrantedForCommand,
+ GrantedForGesture
+};
+
+} // namespace WebCore
+
+namespace WTF {
+
+template<> struct EnumTraits<WebCore::DOMPasteAccessResponse> {
+ using values = EnumValues<
+ WebCore::DOMPasteAccessResponse,
+ WebCore::DOMPasteAccessResponse::DeniedForGesture,
+ WebCore::DOMPasteAccessResponse::GrantedForCommand,
+ WebCore::DOMPasteAccessResponse::GrantedForGesture
+ >;
+};
+
+} // namespace WTF
Deleted: trunk/Source/WebCore/dom/DOMPasteAccessPolicy.h (242316 => 242317)
--- trunk/Source/WebCore/dom/DOMPasteAccessPolicy.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebCore/dom/DOMPasteAccessPolicy.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -1,36 +0,0 @@
-/*
- * 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
-
-namespace WebCore {
-
-enum class DOMPasteAccessPolicy : uint8_t {
- NotRequestedYet,
- Denied,
- Granted
-};
-
-}
Modified: trunk/Source/WebCore/dom/UserGestureIndicator.h (242316 => 242317)
--- trunk/Source/WebCore/dom/UserGestureIndicator.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebCore/dom/UserGestureIndicator.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -25,7 +25,7 @@
#pragma once
-#include "DOMPasteAccessPolicy.h"
+#include "DOMPasteAccess.h"
#include <wtf/Function.h>
#include <wtf/Noncopyable.h>
#include <wtf/Optional.h>
@@ -65,7 +65,19 @@
}
DOMPasteAccessPolicy domPasteAccessPolicy() const { return m_domPasteAccessPolicy; }
- void didRequestDOMPasteAccess(bool granted) { m_domPasteAccessPolicy = granted ? DOMPasteAccessPolicy::Granted : DOMPasteAccessPolicy::Denied; }
+ void didRequestDOMPasteAccess(DOMPasteAccessResponse response)
+ {
+ switch (response) {
+ case DOMPasteAccessResponse::DeniedForGesture:
+ m_domPasteAccessPolicy = DOMPasteAccessPolicy::Denied;
+ break;
+ case DOMPasteAccessResponse::GrantedForCommand:
+ break;
+ case DOMPasteAccessResponse::GrantedForGesture:
+ m_domPasteAccessPolicy = DOMPasteAccessPolicy::Granted;
+ break;
+ }
+ }
void resetDOMPasteAccess() { m_domPasteAccessPolicy = DOMPasteAccessPolicy::NotRequestedYet; }
private:
Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (242316 => 242317)
--- trunk/Source/WebCore/loader/EmptyClients.cpp 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp 2019-03-02 21:50:43 UTC (rev 242317)
@@ -34,6 +34,7 @@
#include "ColorChooser.h"
#include "ContextMenuClient.h"
#include "CookieJar.h"
+#include "DOMPasteAccess.h"
#include "DataListSuggestionPicker.h"
#include "DatabaseProvider.h"
#include "DiagnosticLoggingClient.h"
@@ -189,7 +190,7 @@
void registerRedoStep(UndoStep&) final;
void clearUndoRedoOperations() final { }
- bool requestDOMPasteAccess() final { return false; }
+ DOMPasteAccessResponse requestDOMPasteAccess(const String&) final { return DOMPasteAccessResponse::DeniedForGesture; }
bool canCopyCut(Frame*, bool defaultValue) const final { return defaultValue; }
bool canPaste(Frame*, bool defaultValue) const final { return defaultValue; }
Modified: trunk/Source/WebCore/page/EditorClient.h (242316 => 242317)
--- trunk/Source/WebCore/page/EditorClient.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebCore/page/EditorClient.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -36,6 +36,8 @@
namespace WebCore {
+enum class DOMPasteAccessResponse : uint8_t;
+
class DocumentFragment;
class Element;
class Frame;
@@ -97,7 +99,7 @@
virtual void requestCandidatesForSelection(const VisibleSelection&) { }
virtual void handleAcceptedCandidateWithSoftSpaces(TextCheckingResult) { }
- virtual bool requestDOMPasteAccess() = 0;
+ virtual DOMPasteAccessResponse requestDOMPasteAccess(const String& originIdentifier) = 0;
// Notify an input method that a composition was voluntarily discarded by WebCore, so that it could clean up too.
// This function is not called when a composition is closed per a request from an input method.
Modified: trunk/Source/WebCore/page/Frame.cpp (242316 => 242317)
--- trunk/Source/WebCore/page/Frame.cpp 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebCore/page/Frame.cpp 2019-03-02 21:50:43 UTC (rev 242317)
@@ -681,9 +681,15 @@
if (!client)
return false;
- bool granted = client->requestDOMPasteAccess();
- gestureToken->didRequestDOMPasteAccess(granted);
- return granted;
+ auto response = client->requestDOMPasteAccess(m_doc->originIdentifierForPasteboard());
+ gestureToken->didRequestDOMPasteAccess(response);
+ switch (response) {
+ case DOMPasteAccessResponse::GrantedForCommand:
+ case DOMPasteAccessResponse::GrantedForGesture:
+ return true;
+ case DOMPasteAccessResponse::DeniedForGesture:
+ return false;
+ }
}
}
Modified: trunk/Source/WebKit/ChangeLog (242316 => 242317)
--- trunk/Source/WebKit/ChangeLog 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/ChangeLog 2019-03-02 21:50:43 UTC (rev 242317)
@@ -1,3 +1,67 @@
+2019-03-02 Wenson Hsieh <[email protected]>
+
+ [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
+ https://bugs.webkit.org/show_bug.cgi?id=195053
+ <rdar://problem/48134710>
+
+ Reviewed by Ryosuke Niwa.
+
+ Add support for automatically granting programmatic pasteboard access when the pasteboard identifier of the
+ document requesting programmatic paste matches the identifier in the custom pasteboard data blob in the
+ UIPasteboard. To do this, we send the pasteboard identifier of the document requesting the DOM paste to the UI
+ process, and check this against the pasteboard identifiers for each item on the platform pasteboard. If all
+ items in the platform pasteboard match the given pasteboard identifier (since we don't support writing multiple
+ pasteboard items via bindings, this should only be a single item), we skip showing the paste callout and
+ immediately invoke the programmatic paste handler.
+
+ * Scripts/webkit/messages.py:
+ * UIProcess/API/gtk/PageClientImpl.cpp:
+ (WebKit::PageClientImpl::requestDOMPasteAccess):
+ * UIProcess/API/gtk/PageClientImpl.h:
+ * UIProcess/API/wpe/PageClientImpl.cpp:
+ (WebKit::PageClientImpl::requestDOMPasteAccess):
+ * UIProcess/API/wpe/PageClientImpl.h:
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::requestDOMPasteAccess):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+
+ Add plumbing to deliver the pasteboard identifier to the client when requesting DOM paste.
+
+ * UIProcess/ios/PageClientImplIOS.h:
+ * UIProcess/ios/PageClientImplIOS.mm:
+ (WebKit::PageClientImpl::requestDOMPasteAccess):
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView cleanupInteraction]):
+ (-[WKContentView resignFirstResponderForWebView]):
+ (-[WKContentView _webTouchEventsRecognized:]):
+ (-[WKContentView _willHideMenu:]):
+ (-[WKContentView pasteForWebView:]):
+ (-[WKContentView _handleDOMPasteRequestWithResult:]):
+ (-[WKContentView _willPerformAction:sender:]):
+ (-[WKContentView _didPerformAction:sender:]):
+ (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
+ (allPasteboardItemOriginsMatchOrigin):
+ (-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]):
+ (-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]): Deleted.
+
+ Bail early in the case where all items' pasteboard identifiers (read via custom pasteboard data) match. When
+ this happens, we only grant access for the current paste command, rather than granting access for the user
+ gesture token.
+
+ * UIProcess/mac/PageClientImplMac.h:
+ * UIProcess/win/PageClientImpl.cpp:
+ (WebKit::PageClientImpl::requestDOMPasteAccess):
+ * UIProcess/win/PageClientImpl.h:
+ * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+ (WebKit::WebEditorClient::requestDOMPasteAccess):
+ * WebProcess/WebCoreSupport/WebEditorClient.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::requestDOMPasteAccess):
+ * WebProcess/WebPage/WebPage.h:
+
2019-02-27 Darin Adler <[email protected]>
Fixed makeString(float) to do shortest-form serialization without first converting to double
Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (242316 => 242317)
--- trunk/Source/WebKit/Scripts/webkit/messages.py 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py 2019-03-02 21:50:43 UTC (rev 242317)
@@ -398,6 +398,7 @@
'String': ['<wtf/text/WTFString.h>'],
'PAL::SessionID': ['<pal/SessionID.h>'],
'WebCore::AutoplayEventFlags': ['<WebCore/AutoplayEvent.h>'],
+ 'WebCore::DOMPasteAccessResponse': ['<WebCore/DOMPasteAccess.h>'],
'WebCore::DragHandlingMethod': ['<WebCore/DragActions.h>'],
'WebCore::ExceptionDetails': ['<WebCore/JSDOMExceptionHandling.h>'],
'WebCore::FileChooserSettings': ['<WebCore/FileChooser.h>'],
Modified: trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp 2019-03-02 21:50:43 UTC (rev 242317)
@@ -44,6 +44,7 @@
#include "WebProcessPool.h"
#include <WebCore/CairoUtilities.h>
#include <WebCore/Cursor.h>
+#include <WebCore/DOMPasteAccess.h>
#include <WebCore/EventNames.h>
#include <WebCore/GtkUtilities.h>
#include <WebCore/NotImplemented.h>
@@ -524,9 +525,9 @@
}
#endif
-void PageClientImpl::requestDOMPasteAccess(const IntRect&, CompletionHandler<void(bool)>&& completionHandler)
+void PageClientImpl::requestDOMPasteAccess(const IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
{
- completionHandler(false);
+ completionHandler(WebCore::DOMPasteAccessResponse::DeniedForGesture);
}
} // namespace WebKit
Modified: trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -36,6 +36,10 @@
#include <gtk/gtk.h>
#include <memory>
+namespace WebCore {
+enum class DOMPasteAccessPolicy : uint8_t;
+}
+
namespace WebKit {
class DrawingAreaProxy;
@@ -150,7 +154,7 @@
void didFinishProcessingAllPendingMouseEvents() final { }
- void requestDOMPasteAccess(const WebCore::IntRect&, CompletionHandler<void(bool)>&&) final;
+ void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
#if ENABLE(VIDEO) && USE(GSTREAMER)
bool decidePolicyForInstallMissingMediaPluginsPermissionRequest(InstallMissingMediaPluginsPermissionRequest&) override;
Modified: trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp 2019-03-02 21:50:43 UTC (rev 242317)
@@ -34,6 +34,7 @@
#include "WebContextMenuProxy.h"
#include "WebContextMenuProxyWPE.h"
#include <WebCore/ActivityState.h>
+#include <WebCore/DOMPasteAccess.h>
#include <WebCore/NotImplemented.h>
namespace WebKit {
@@ -399,9 +400,9 @@
#endif // ENABLE(FULLSCREEN_API)
-void PageClientImpl::requestDOMPasteAccess(const WebCore::IntRect&, CompletionHandler<void(bool)>&& completionHandler)
+void PageClientImpl::requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
{
- completionHandler(false);
+ completionHandler(WebCore::DOMPasteAccessResponse::DeniedForGesture);
}
} // namespace WebKit
Modified: trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -34,6 +34,10 @@
class View;
}
+namespace WebCore {
+enum class DOMPasteAccessResponse : uint8_t;
+}
+
namespace WebKit {
class ScrollGestureController;
@@ -146,7 +150,7 @@
void didFinishProcessingAllPendingMouseEvents() final { }
IPC::Attachment hostFileDescriptor() final;
- void requestDOMPasteAccess(const WebCore::IntRect&, CompletionHandler<void(bool)>&&) final;
+ void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override;
Modified: trunk/Source/WebKit/UIProcess/PageClient.h (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/PageClient.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/PageClient.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -86,6 +86,7 @@
enum class ScrollbarStyle : uint8_t;
enum class TextIndicatorWindowLifetime : uint8_t;
enum class TextIndicatorWindowDismissalAnimation : uint8_t;
+enum class DOMPasteAccessResponse : uint8_t;
struct DictionaryPopupInfo;
struct Highlight;
@@ -95,13 +96,11 @@
template <typename> class RectEdges;
using FloatBoxExtent = RectEdges<float>;
-}
#if ENABLE(DRAG_SUPPORT)
-namespace WebCore {
struct DragItem;
+#endif
}
-#endif
namespace WebKit {
@@ -465,7 +464,7 @@
virtual void didChangeDragCaretRect(const WebCore::IntRect& previousCaretRect, const WebCore::IntRect& caretRect) = 0;
#endif
- virtual void requestDOMPasteAccess(const WebCore::IntRect& elementRect, CompletionHandler<void(bool)>&&) = 0;
+ virtual void requestDOMPasteAccess(const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) = 0;
#if ENABLE(ATTACHMENT_ELEMENT)
virtual void didInsertAttachment(API::Attachment&, const String& source) { }
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-03-02 21:50:43 UTC (rev 242317)
@@ -131,6 +131,7 @@
#include "WebsiteDataStore.h"
#include <WebCore/AdClickAttribution.h>
#include <WebCore/BitmapImage.h>
+#include <WebCore/DOMPasteAccess.h>
#include <WebCore/DeprecatedGlobalSettings.h>
#include <WebCore/DiagnosticLoggingClient.h>
#include <WebCore/DiagnosticLoggingKeys.h>
@@ -5528,9 +5529,9 @@
m_needsPlainTextQuirk = needsPlainTextQuirk;
}
-void WebPageProxy::requestDOMPasteAccess(const WebCore::IntRect& elementRect, CompletionHandler<void(bool)>&& completionHandler)
+void WebPageProxy::requestDOMPasteAccess(const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
{
- m_pageClient->requestDOMPasteAccess(elementRect, WTFMove(completionHandler));
+ m_pageClient->requestDOMPasteAccess(elementRect, originIdentifier, WTFMove(completionHandler));
}
// BackForwardList
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -182,6 +182,7 @@
enum SelectionDirection : uint8_t;
enum class AutoplayEvent : uint8_t;
+enum class DOMPasteAccessResponse : uint8_t;
enum class LockBackForwardList : bool;
enum class HasInsecureContent : bool;
enum class NotificationDirection : uint8_t;
@@ -1669,7 +1670,7 @@
void setNeedsHiddenContentEditableQuirk(bool);
void setNeedsPlainTextQuirk(bool);
- void requestDOMPasteAccess(const WebCore::IntRect&, CompletionHandler<void(bool)>&&);
+ void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&);
// Back/Forward list management
void backForwardAddItem(BackForwardListItemState&&);
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2019-03-02 21:50:43 UTC (rev 242317)
@@ -251,7 +251,7 @@
SetHasHadSelectionChangesFromUserInteraction(bool hasHadUserSelectionChanges)
SetNeedsHiddenContentEditableQuirk(bool needsHiddenContentEditableQuirk)
SetNeedsPlainTextQuirk(bool needsPlainTextQuirk)
- RequestDOMPasteAccess(WebCore::IntRect elementRect) -> (bool granted) Delayed
+ RequestDOMPasteAccess(WebCore::IntRect elementRect, String originIdentifier) -> (enum:uint8_t WebCore::DOMPasteAccessResponse response) Delayed
# Find messages
DidCountStringMatches(String string, uint32_t matchCount)
Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -35,6 +35,7 @@
OBJC_CLASS WKEditorUndoTarget;
namespace WebCore {
+enum class DOMPasteAccessResponse : uint8_t;
struct PromisedAttachmentInfo;
}
@@ -224,7 +225,7 @@
void requestPasswordForQuickLookDocument(const String& fileName, WTF::Function<void(const String&)>&&) override;
#endif
- void requestDOMPasteAccess(const WebCore::IntRect& elementRect, CompletionHandler<void(bool)>&&) final;
+ void requestDOMPasteAccess(const WebCore::IntRect& elementRect, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
#if ENABLE(DATA_INTERACTION)
void didPerformDragOperation(bool handled) override;
Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm 2019-03-02 21:50:43 UTC (rev 242317)
@@ -54,6 +54,7 @@
#import "WebEditCommandProxy.h"
#import "WebProcessProxy.h"
#import "_WKDownloadInternal.h"
+#import <WebCore/DOMPasteAccess.h>
#import <WebCore/DictionaryLookup.h>
#import <WebCore/NotImplemented.h>
#import <WebCore/PlatformScreen.h>
@@ -837,9 +838,9 @@
}
#endif
-void PageClientImpl::requestDOMPasteAccess(const WebCore::IntRect& elementRect, CompletionHandler<void(bool)>&& completionHandler)
+void PageClientImpl::requestDOMPasteAccess(const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
{
- [m_contentView _requestDOMPasteAccessWithElementRect:elementRect completionHandler:WTFMove(completionHandler)];
+ [m_contentView _requestDOMPasteAccessWithElementRect:elementRect originIdentifier:originIdentifier completionHandler:WTFMove(completionHandler)];
}
#if HAVE(PENCILKIT)
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -71,14 +71,13 @@
class SelectionRect;
struct PromisedAttachmentInfo;
struct ShareDataWithParsedURL;
+enum class DOMPasteAccessResponse : uint8_t;
enum class RouteSharingPolicy : uint8_t;
-}
#if ENABLE(DRAG_SUPPORT)
-namespace WebCore {
struct DragItem;
+#endif
}
-#endif
namespace WebKit {
class InputViewUpdateDeferrer;
@@ -318,7 +317,7 @@
BOOL _focusRequiresStrongPasswordAssistance;
BOOL _hasSetUpInteractions;
- CompletionHandler<void(bool)> _domPasteRequestHandler;
+ CompletionHandler<void(WebCore::DOMPasteAccessResponse)> _domPasteRequestHandler;
#if ENABLE(DATA_INTERACTION)
WebKit::DragDropInteractionState _dragDropInteractionState;
@@ -440,7 +439,7 @@
- (void)_accessibilityClearSelection;
- (WKFormInputSession *)_formInputSession;
-- (void)_requestDOMPasteAccessWithElementRect:(const WebCore::IntRect&)elementRect completionHandler:(CompletionHandler<void(bool)>&&)completionHandler;
+- (void)_requestDOMPasteAccessWithElementRect:(const WebCore::IntRect&)elementRect originIdentifier:(const String&)originIdentifier completionHandler:(CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&)completionHandler;
@property (nonatomic, readonly) WebKit::InteractionInformationAtPosition currentPositionInformation;
- (void)doAfterPositionInformationUpdate:(void (^)(WebKit::InteractionInformationAtPosition))action forRequest:(WebKit::InteractionInformationRequest)request;
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-03-02 21:50:43 UTC (rev 242317)
@@ -77,6 +77,7 @@
#import <CoreText/CTFontDescriptor.h>
#import <MobileCoreServices/UTCoreTypes.h>
#import <WebCore/Color.h>
+#import <WebCore/DOMPasteAccess.h>
#import <WebCore/DataDetection.h>
#import <WebCore/FloatQuad.h>
#import <WebCore/FontAttributeChanges.h>
@@ -890,7 +891,7 @@
#if ENABLE(POINTER_EVENTS)
[self _resetPanningPreventionFlags];
#endif
- [self _handleDOMPasteRequestWithResult:NO];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
}
- (void)_removeDefaultGestureRecognizers
@@ -1178,7 +1179,7 @@
bool superDidResign = [super resignFirstResponder];
if (superDidResign) {
- [self _handleDOMPasteRequestWithResult:NO];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
_page->activityStateDidChange(WebCore::ActivityState::IsFocused);
}
@@ -1214,7 +1215,7 @@
_lastInteractionLocation = lastTouchEvent->locationInDocumentCoordinates;
if (lastTouchEvent->type == UIWebTouchEventTouchBegin) {
- [self _handleDOMPasteRequestWithResult:NO];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
_layerTreeTransactionIdAtLastTouchStart = downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*_page->drawingArea()).lastCommittedLayerTreeTransactionID();
}
@@ -2898,7 +2899,7 @@
- (void)_willHideMenu:(NSNotification *)notification
{
- [self _handleDOMPasteRequestWithResult:NO];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
}
- (void)_didHideMenu:(NSNotification *)notification
@@ -2926,7 +2927,7 @@
- (void)pasteForWebView:(id)sender
{
- if (sender == UIMenuController.sharedMenuController && [self _handleDOMPasteRequestWithResult:YES])
+ if (sender == UIMenuController.sharedMenuController && [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::GrantedForGesture])
return;
_page->executeEditCommand("paste"_s);
@@ -3058,11 +3059,11 @@
_page->storeSelectionForAccessibility(false);
}
-- (BOOL)_handleDOMPasteRequestWithResult:(BOOL)allowPaste
+- (BOOL)_handleDOMPasteRequestWithResult:(WebCore::DOMPasteAccessResponse)response
{
if (auto pasteHandler = WTFMove(_domPasteRequestHandler)) {
[self hideGlobalMenuController];
- pasteHandler(allowPaste);
+ pasteHandler(response);
return YES;
}
return NO;
@@ -3071,13 +3072,13 @@
- (void)_willPerformAction:(SEL)action sender:(id)sender
{
if (action != @selector(paste:))
- [self _handleDOMPasteRequestWithResult:NO];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
}
- (void)_didPerformAction:(SEL)action sender:(id)sender
{
if (action == @selector(paste:))
- [self _handleDOMPasteRequestWithResult:NO];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
}
// UIWKInteractionViewProtocol
@@ -4295,7 +4296,7 @@
- (void)handleKeyWebEvent:(::WebEvent *)theEvent withCompletionHandler:(void (^)(::WebEvent *theEvent, BOOL wasHandled))completionHandler
{
- [self _handleDOMPasteRequestWithResult:NO];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
_keyWebEventHandler = makeBlockPtr(completionHandler);
_page->handleKeyboardEvent(WebKit::NativeWebKeyboardEvent(theEvent));
@@ -5035,13 +5036,43 @@
#endif
}
-- (void)_requestDOMPasteAccessWithElementRect:(const WebCore::IntRect&)elementRect completionHandler:(CompletionHandler<void(bool)>&&)completionHandler
+static BOOL allPasteboardItemOriginsMatchOrigin(UIPasteboard *pasteboard, const String& originIdentifier)
{
+ if (originIdentifier.isEmpty())
+ return NO;
+
+ auto *indices = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [pasteboard numberOfItems])];
+ auto *allCustomData = [pasteboard dataForPasteboardType:@(WebCore::PasteboardCustomData::cocoaType()) inItemSet:indices];
+ if (!allCustomData.count)
+ return NO;
+
+ BOOL foundAtLeastOneMatchingIdentifier = NO;
+ for (NSData *data in allCustomData) {
+ if (!data.length)
+ continue;
+
+ auto buffer = WebCore::SharedBuffer::create(data);
+ if (WebCore::PasteboardCustomData::fromSharedBuffer(buffer.get()).origin != originIdentifier)
+ return NO;
+
+ foundAtLeastOneMatchingIdentifier = YES;
+ }
+
+ return foundAtLeastOneMatchingIdentifier;
+}
+
+- (void)_requestDOMPasteAccessWithElementRect:(const WebCore::IntRect&)elementRect originIdentifier:(const String&)originIdentifier completionHandler:(CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&)completionHandler
+{
if (auto existingCompletionHandler = std::exchange(_domPasteRequestHandler, WTFMove(completionHandler))) {
ASSERT_NOT_REACHED();
- existingCompletionHandler(false);
+ existingCompletionHandler(WebCore::DOMPasteAccessResponse::DeniedForGesture);
}
+ if (allPasteboardItemOriginsMatchOrigin(UIPasteboard.generalPasteboard, originIdentifier)) {
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::GrantedForCommand];
+ return;
+ }
+
WebCore::IntRect menuControllerRect = elementRect;
const CGFloat maximumElementWidth = 300;
Modified: trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -30,6 +30,7 @@
#include "CorrectionPanel.h"
#include "PageClientImplCocoa.h"
#include "WebFullScreenManagerProxy.h"
+#include <WebCore/DOMPasteAccess.h>
#include <wtf/CompletionHandler.h>
#include <wtf/RetainPtr.h>
@@ -214,7 +215,7 @@
void willRecordNavigationSnapshot(WebBackForwardListItem&) override;
void didRemoveNavigationGestureSnapshot() override;
- void requestDOMPasteAccess(const WebCore::IntRect&, CompletionHandler<void(bool)>&& completion) final { completion(false); }
+ void requestDOMPasteAccess(const WebCore::IntRect&, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completion) final { completion(WebCore::DOMPasteAccessResponse::DeniedForGesture); }
NSView *activeView() const;
NSWindow *activeWindow() const;
Modified: trunk/Source/WebKit/UIProcess/win/PageClientImpl.cpp (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/win/PageClientImpl.cpp 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/win/PageClientImpl.cpp 2019-03-02 21:50:43 UTC (rev 242317)
@@ -33,6 +33,7 @@
#include "WebPageProxy.h"
#include "WebPopupMenuProxyWin.h"
#include "WebView.h"
+#include <WebCore/DOMPasteAccess.h>
namespace WebKit {
using namespace WebCore;
@@ -367,9 +368,9 @@
return m_view.window();
}
-void PageClientImpl::requestDOMPasteAccess(const IntRect&, CompletionHandler<void(bool)>&& completionHandler)
+void PageClientImpl::requestDOMPasteAccess(const IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
{
- completionHandler(false);
+ completionHandler(WebCore::DOMPasteAccessResponse::DeniedForGesture);
}
} // namespace WebKit
Modified: trunk/Source/WebKit/UIProcess/win/PageClientImpl.h (242316 => 242317)
--- trunk/Source/WebKit/UIProcess/win/PageClientImpl.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/UIProcess/win/PageClientImpl.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -34,6 +34,10 @@
#include "WebPageProxy.h"
#include <WebCore/IntSize.h>
+namespace WebCore {
+enum class DOMPasteAccessResponse : uint8_t;
+}
+
namespace WebKit {
class DrawingAreaProxy;
@@ -144,7 +148,7 @@
void didFinishProcessingAllPendingMouseEvents() final { }
- void requestDOMPasteAccess(const WebCore::IntRect&, CompletionHandler<void(bool)>&&) final;
+ void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
// Members of PageClientImpl class
DefaultUndoController m_undoController;
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp (242316 => 242317)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp 2019-03-02 21:50:43 UTC (rev 242317)
@@ -38,6 +38,7 @@
#include "WebProcess.h"
#include "WebUndoStep.h"
#include <WebCore/ArchiveResource.h>
+#include <WebCore/DOMPasteAccess.h>
#include <WebCore/DocumentFragment.h>
#include <WebCore/FocusController.h>
#include <WebCore/Frame.h>
@@ -354,9 +355,9 @@
m_page->sendSync(Messages::WebPageProxy::ExecuteUndoRedo(UndoOrRedo::Redo), Messages::WebPageProxy::ExecuteUndoRedo::Reply());
}
-bool WebEditorClient::requestDOMPasteAccess()
+WebCore::DOMPasteAccessResponse WebEditorClient::requestDOMPasteAccess(const String& originIdentifier)
{
- return m_page->requestDOMPasteAccess();
+ return m_page->requestDOMPasteAccess(originIdentifier);
}
#if PLATFORM(WIN)
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h (242316 => 242317)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -28,6 +28,10 @@
#include <WebCore/EditorClient.h>
#include <WebCore/TextCheckerClient.h>
+namespace WebCore {
+enum class DOMPasteAccessResponse : uint8_t;
+}
+
namespace WebKit {
class WebPage;
@@ -88,7 +92,7 @@
void registerRedoStep(WebCore::UndoStep&) final;
void clearUndoRedoOperations() final;
- bool requestDOMPasteAccess() final;
+ WebCore::DOMPasteAccessResponse requestDOMPasteAccess(const String& originIdentifier) final;
bool canCopyCut(WebCore::Frame*, bool defaultValue) const final;
bool canPaste(WebCore::Frame*, bool defaultValue) const final;
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (242316 => 242317)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-03-02 21:50:43 UTC (rev 242317)
@@ -139,6 +139,7 @@
#include <WebCore/Chrome.h>
#include <WebCore/CommonVM.h>
#include <WebCore/ContextMenuController.h>
+#include <WebCore/DOMPasteAccess.h>
#include <WebCore/DataTransfer.h>
#include <WebCore/DatabaseManager.h>
#include <WebCore/DeprecatedGlobalSettings.h>
@@ -6440,13 +6441,11 @@
callback(wasGranted);
}
-bool WebPage::requestDOMPasteAccess()
+WebCore::DOMPasteAccessResponse WebPage::requestDOMPasteAccess(const String& originIdentifier)
{
- bool granted = false;
- if (!sendSyncWithDelayedReply(Messages::WebPageProxy::RequestDOMPasteAccess(rectForElementAtInteractionLocation()), Messages::WebPageProxy::RequestDOMPasteAccess::Reply(granted)))
- return false;
-
- return granted;
+ auto response = WebCore::DOMPasteAccessResponse::DeniedForGesture;
+ sendSyncWithDelayedReply(Messages::WebPageProxy::RequestDOMPasteAccess(rectForElementAtInteractionLocation(), originIdentifier), Messages::WebPageProxy::RequestDOMPasteAccess::Reply(response));
+ return response;
}
void WebPage::simulateDeviceOrientationChange(double alpha, double beta, double gamma)
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (242316 => 242317)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -171,6 +171,7 @@
class VisiblePosition;
enum SyntheticClickType : int8_t;
+enum class DOMPasteAccessResponse : uint8_t;
enum class DragHandlingMethod : uint8_t;
enum class ShouldTreatAsContinuingLoad : bool;
enum class TextIndicatorPresentationTransition : uint8_t;
@@ -1144,7 +1145,7 @@
return sendSync(WTFMove(message), WTFMove(reply), m_pageID, Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
}
- bool requestDOMPasteAccess();
+ WebCore::DOMPasteAccessResponse requestDOMPasteAccess(const String& originIdentifier);
WebCore::IntRect rectForElementAtInteractionLocation() const;
const Optional<WebCore::Color>& backgroundColor() const { return m_backgroundColor; }
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (242316 => 242317)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2019-03-02 21:50:43 UTC (rev 242317)
@@ -1,3 +1,13 @@
+2019-03-02 Wenson Hsieh <[email protected]>
+
+ [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
+ https://bugs.webkit.org/show_bug.cgi?id=195053
+ <rdar://problem/48134710>
+
+ Reviewed by Ryosuke Niwa.
+
+ * WebCoreSupport/WebEditorClient.h:
+
2019-03-01 Tim Horton <[email protected]>
Remove unused code in WebKitLegacy
Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h (242316 => 242317)
--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -27,6 +27,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import <WebCore/DOMPasteAccess.h>
#import <WebCore/EditorClient.h>
#import <WebCore/TextCheckerClient.h>
#import <WebCore/VisibleSelection.h>
@@ -80,7 +81,7 @@
void getClientPasteboardDataForRange(WebCore::Range*, Vector<String>& pasteboardTypes, Vector<RefPtr<WebCore::SharedBuffer>>& pasteboardData) final;
void setInsertionPasteboard(const String&) final;
- bool requestDOMPasteAccess() final { return false; }
+ WebCore::DOMPasteAccessResponse requestDOMPasteAccess(const String&) final { return WebCore::DOMPasteAccessResponse::DeniedForGesture; }
#if USE(APPKIT)
void uppercaseWord() final;
Modified: trunk/Source/WebKitLegacy/win/ChangeLog (242316 => 242317)
--- trunk/Source/WebKitLegacy/win/ChangeLog 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKitLegacy/win/ChangeLog 2019-03-02 21:50:43 UTC (rev 242317)
@@ -1,3 +1,13 @@
+2019-03-02 Wenson Hsieh <[email protected]>
+
+ [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
+ https://bugs.webkit.org/show_bug.cgi?id=195053
+ <rdar://problem/48134710>
+
+ Reviewed by Ryosuke Niwa.
+
+ * WebCoreSupport/WebEditorClient.h:
+
2019-02-20 Darin Adler <[email protected]>
Finish removing String::format
Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.h (242316 => 242317)
--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.h 2019-03-02 20:54:59 UTC (rev 242316)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.h 2019-03-02 21:50:43 UTC (rev 242317)
@@ -26,6 +26,7 @@
#pragma once
#include "WebKit.h"
+#include <WebCore/DOMPasteAccess.h>
#include <WebCore/EditorClient.h>
#include <WebCore/TextCheckerClient.h>
@@ -114,7 +115,7 @@
void requestCheckingOfString(WebCore::TextCheckingRequest&, const WebCore::VisibleSelection&) final { }
bool performTwoStepDrop(WebCore::DocumentFragment&, WebCore::Range&, bool) final { return false; }
- bool requestDOMPasteAccess() final { return false; }
+ WebCore::DOMPasteAccessResponse requestDOMPasteAccess(const String&) final { return WebCore::DOMPasteAccessResponse::DeniedForGesture; }
WebCore::TextCheckerClient* textChecker() final { return this; }