Changeset 267680 in webkit
- Timestamp:
- Sep 27, 2020, 1:00:32 PM (6 years ago)
- Location:
- branches/safari-610-branch
- Files:
-
- 4 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/mac/WebPageProxyMac.mm (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-610-branch/Source/WebKit/ChangeLog
r267677 r267680 1 2020-09-27 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r267305. rdar://problem/69594350 4 5 [macOS] REGRESSION (r265702): System Services receive 0 bytes when extracting selected content as rich text data 6 https://bugs.webkit.org/show_bug.cgi?id=216718 7 <rdar://problem/69150358> 8 9 Reviewed by Tim Horton. 10 11 Source/WebKit: 12 13 Test: CopyHTML.WriteRichTextSelectionToPasteboard 14 15 * UIProcess/mac/WebPageProxyMac.mm: 16 (WebKit::WebPageProxy::dataSelectionForPasteboard): 17 18 After r265702, the `IPCHandle` received in the UI process was always being converted into a buffer of size 0, 19 due to using the `size` local variable (which is no longer set as an outparam of the sync IPC message). Instead, 20 use `ipcHandle.dataSize`. 21 22 Tools: 23 24 Add a new API test to verify that we get non-empty web archive data when using 25 `-writeSelectionToPasteboard:types:` to grab selected content as rich text data. 26 27 * TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm: 28 29 30 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267305 268f45cc-cd09-0410-ab3c-d52691b4dbfc 31 32 2020-09-18 Wenson Hsieh <wenson_hsieh@apple.com> 33 34 [macOS] REGRESSION (r265702): System Services receive 0 bytes when extracting selected content as rich text data 35 https://bugs.webkit.org/show_bug.cgi?id=216718 36 <rdar://problem/69150358> 37 38 Reviewed by Tim Horton. 39 40 Test: CopyHTML.WriteRichTextSelectionToPasteboard 41 42 * UIProcess/mac/WebPageProxyMac.mm: 43 (WebKit::WebPageProxy::dataSelectionForPasteboard): 44 45 After r265702, the `IPCHandle` received in the UI process was always being converted into a buffer of size 0, 46 due to using the `size` local variable (which is no longer set as an outparam of the sync IPC message). Instead, 47 use `ipcHandle.dataSize`. 48 1 49 2020-09-27 Alan Coon <alancoon@apple.com> 2 50 -
branches/safari-610-branch/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
r265702 r267680 252 252 253 253 SharedMemory::IPCHandle ipcHandle; 254 uint64_t size = 0;255 254 const Seconds messageTimeout(20); 256 255 sendSync(Messages::WebPage::GetDataSelectionForPasteboard(pasteboardType), Messages::WebPage::GetDataSelectionForPasteboard::Reply(ipcHandle), messageTimeout); … … 260 259 if (!sharedMemoryBuffer) 261 260 return nullptr; 262 return SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), static_cast<size_t>(size));261 return SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), ipcHandle.dataSize); 263 262 } 264 263 -
branches/safari-610-branch/Tools/ChangeLog
r267627 r267680 1 2020-09-27 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r267305. rdar://problem/69594350 4 5 [macOS] REGRESSION (r265702): System Services receive 0 bytes when extracting selected content as rich text data 6 https://bugs.webkit.org/show_bug.cgi?id=216718 7 <rdar://problem/69150358> 8 9 Reviewed by Tim Horton. 10 11 Source/WebKit: 12 13 Test: CopyHTML.WriteRichTextSelectionToPasteboard 14 15 * UIProcess/mac/WebPageProxyMac.mm: 16 (WebKit::WebPageProxy::dataSelectionForPasteboard): 17 18 After r265702, the `IPCHandle` received in the UI process was always being converted into a buffer of size 0, 19 due to using the `size` local variable (which is no longer set as an outparam of the sync IPC message). Instead, 20 use `ipcHandle.dataSize`. 21 22 Tools: 23 24 Add a new API test to verify that we get non-empty web archive data when using 25 `-writeSelectionToPasteboard:types:` to grab selected content as rich text data. 26 27 * TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm: 28 29 30 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267305 268f45cc-cd09-0410-ab3c-d52691b4dbfc 31 32 2020-09-18 Wenson Hsieh <wenson_hsieh@apple.com> 33 34 [macOS] REGRESSION (r265702): System Services receive 0 bytes when extracting selected content as rich text data 35 https://bugs.webkit.org/show_bug.cgi?id=216718 36 <rdar://problem/69150358> 37 38 Reviewed by Tim Horton. 39 40 Add a new API test to verify that we get non-empty web archive data when using 41 `-writeSelectionToPasteboard:types:` to grab selected content as rich text data. 42 43 * TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm: 44 1 45 2020-09-25 Alan Coon <alancoon@apple.com> 2 46 -
branches/safari-610-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm
r261395 r267680 47 47 #if PLATFORM(MAC) 48 48 49 @interface WKWebView () <NSServicesMenuRequestor> 50 @end 51 49 52 NSData *readHTMLDataFromPasteboard() 50 53 { … … 194 197 } 195 198 199 TEST(CopyHTML, WriteRichTextSelectionToPasteboard) 200 { 201 auto webView = createWebViewWithCustomPasteboardDataEnabled(); 202 [webView synchronouslyLoadHTMLString:@"<strong style='color: rgb(255, 0, 0);'>This is some text to copy.</strong>"]; 203 [webView stringByEvaluatingJavaScript:@"getSelection().selectAllChildren(document.body)"]; 204 205 auto pasteboard = [NSPasteboard pasteboardWithUniqueName]; 206 [webView writeSelectionToPasteboard:pasteboard types:@[ (__bridge NSString *)kUTTypeWebArchive ]]; 207 208 EXPECT_GT([pasteboard dataForType:(__bridge NSString *)kUTTypeWebArchive].length, 0U); 209 } 210 196 211 #endif // PLATFORM(MAC) 197 212
Note:
See TracChangeset
for help on using the changeset viewer.