Changeset 270072 in webkit
- Timestamp:
- Nov 19, 2020 11:33:31 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r270071 r270072 1 2020-11-19 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 REGRESSION (r259151): The "Convert Text to Traditional Chinese" services menu action is broken 4 https://bugs.webkit.org/show_bug.cgi?id=219190 5 <rdar://problem/71438389> 6 7 Reviewed by Tim Horton. 8 9 Some system services, such as "Convert Text to (Traditional|Simplified) Chinese", use `-[NSServicesMenuRequestor 10 readSelectionFromPasteboard:]` to insert the contents of the given pasteboard into the current selection. After 11 the changes in r259151, this requires the UI process to explicitly grant access to the contents of the given 12 pasteboard, on behalf of the web content process. 13 14 Fix the bug by adding the missing call to `grantAccessToCurrentPasteboardData`. This is only called from API in 15 the UI process, so it cannot be abused by a compromised web content process to grab the contents of 16 `NSPasteboard`. 17 18 Test: PasteHTML.ReadSelectionFromPasteboard 19 20 * UIProcess/mac/WebPageProxyMac.mm: 21 (WebKit::WebPageProxy::readSelectionFromPasteboard): 22 1 23 2020-11-19 Fujii Hironori <Hironori.Fujii@sony.com> 2 24 -
trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
r269805 r270072 272 272 return false; 273 273 274 grantAccessToCurrentPasteboardData(pasteboardName); 275 274 276 bool result = false; 275 277 const Seconds messageTimeout(20); -
trunk/Tools/ChangeLog
r270069 r270072 1 2020-11-19 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 REGRESSION (r259151): The "Convert Text to Traditional Chinese" services menu action is broken 4 https://bugs.webkit.org/show_bug.cgi?id=219190 5 <rdar://problem/71438389> 6 7 Reviewed by Tim Horton. 8 9 Add an API test to exercise `-readSelectionFromPasteboard:`. 10 11 * TestWebKitAPI/Tests/WebKitCocoa/PasteHTML.mm: 12 (TEST): 13 1 14 2020-11-19 Hoa Dinh <dvh@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PasteHTML.mm
r260366 r270072 46 46 47 47 #if PLATFORM(MAC) 48 @interface WKWebView () <NSServicesMenuRequestor> 49 @end 50 48 51 void writeHTMLToPasteboard(NSString *html) 49 52 { … … 388 391 } 389 392 393 #if PLATFORM(MAC) 394 395 TEST(PasteHTML, ReadSelectionFromPasteboard) 396 { 397 auto generalPasteboard = NSPasteboard.generalPasteboard; 398 [generalPasteboard clearContents]; 399 [generalPasteboard setString:@"Hello world" forType:NSPasteboardTypeString]; 400 401 auto webView = createWebViewWithCustomPasteboardDataSetting(true); 402 [webView synchronouslyLoadHTMLString:@"<input autofocus>"]; 403 [webView readSelectionFromPasteboard:generalPasteboard]; 404 405 NSString *inputValue = [webView stringByEvaluatingJavaScript:@"document.querySelector('input').value"]; 406 EXPECT_WK_STREQ(inputValue, "Hello world"); 407 } 408 409 #endif // PLATFORM(MAC) 410 390 411 #if ENABLE(DARK_MODE_CSS) && HAVE(OS_DARK_MODE_SUPPORT) 391 412
Note: See TracChangeset
for help on using the changeset viewer.