Changeset 267305 in webkit
- Timestamp:
- Sep 18, 2020, 6:34:43 PM (6 years ago)
- Location:
- trunk
- 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
-
trunk/Source/WebKit/ChangeLog
r267298 r267305 1 2020-09-18 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [macOS] REGRESSION (r265702): System Services receive 0 bytes when extracting selected content as rich text data 4 https://bugs.webkit.org/show_bug.cgi?id=216718 5 <rdar://problem/69150358> 6 7 Reviewed by Tim Horton. 8 9 Test: CopyHTML.WriteRichTextSelectionToPasteboard 10 11 * UIProcess/mac/WebPageProxyMac.mm: 12 (WebKit::WebPageProxy::dataSelectionForPasteboard): 13 14 After r265702, the `IPCHandle` received in the UI process was always being converted into a buffer of size 0, 15 due to using the `size` local variable (which is no longer set as an outparam of the sync IPC message). Instead, 16 use `ipcHandle.dataSize`. 17 1 18 2020-09-18 Megan Gardner <megan_gardner@apple.com> 2 19 -
trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
r266654 r267305 257 257 258 258 SharedMemory::IPCHandle ipcHandle; 259 uint64_t size = 0;260 259 const Seconds messageTimeout(20); 261 260 sendSync(Messages::WebPage::GetDataSelectionForPasteboard(pasteboardType), Messages::WebPage::GetDataSelectionForPasteboard::Reply(ipcHandle), messageTimeout); … … 265 264 if (!sharedMemoryBuffer) 266 265 return nullptr; 267 return SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), static_cast<size_t>(size));266 return SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), ipcHandle.dataSize); 268 267 } 269 268 -
trunk/Tools/ChangeLog
r267284 r267305 1 2020-09-18 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [macOS] REGRESSION (r265702): System Services receive 0 bytes when extracting selected content as rich text data 4 https://bugs.webkit.org/show_bug.cgi?id=216718 5 <rdar://problem/69150358> 6 7 Reviewed by Tim Horton. 8 9 Add a new API test to verify that we get non-empty web archive data when using 10 `-writeSelectionToPasteboard:types:` to grab selected content as rich text data. 11 12 * TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm: 13 1 14 2020-09-18 Sihui Liu <sihui_liu@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm
r261395 r267305 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.