Changeset 247120 in webkit
- Timestamp:
- Jul 3, 2019 5:42:30 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r247119 r247120 1 2019-07-03 Tim Horton <timothy_horton@apple.com> 2 3 UI process exception when dragging an <attachment> with no content type 4 https://bugs.webkit.org/show_bug.cgi?id=199480 5 <rdar://problem/44351353> 6 7 Reviewed by Wenson Hsieh. 8 9 * UIProcess/API/Cocoa/APIAttachmentCocoa.mm: 10 (API::Attachment::mimeType const): 11 (API::Attachment::utiType const): 12 * UIProcess/Cocoa/WebViewImpl.mm: 13 (WebKit::WebViewImpl::startDrag): 14 Make null or empty contentType fail the drag, instead of crashing. 15 1 16 2019-07-03 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm
r239427 r247120 71 71 { 72 72 NSString *contentType = m_contentType.isEmpty() ? mimeTypeInferredFromFileExtension(*this) : m_contentType; 73 if (!contentType.length) 74 return nullString(); 73 75 if (!isDeclaredOrDynamicTypeIdentifier(contentType)) 74 76 return contentType; … … 80 82 { 81 83 NSString *contentType = m_contentType.isEmpty() ? mimeTypeInferredFromFileExtension(*this) : m_contentType; 84 if (!contentType.length) 85 return nullString(); 82 86 if (isDeclaredOrDynamicTypeIdentifier(contentType)) 83 87 return contentType; -
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
r246938 r247120 4126 4126 } 4127 4127 4128 if (!utiType.length) { 4129 m_page->dragCancelled(); 4130 return; 4131 } 4132 4128 4133 auto provider = adoptNS([[NSFilePromiseProvider alloc] initWithFileType:utiType delegate:(id <NSFilePromiseProviderDelegate>)m_view.getAutoreleased()]); 4129 4134 auto context = adoptNS([[WKPromisedAttachmentContext alloc] initWithIdentifier:info.attachmentIdentifier blobURL:info.blobURL fileName:fileName]); -
trunk/Tools/ChangeLog
r247117 r247120 1 2019-07-03 Tim Horton <timothy_horton@apple.com> 2 3 UI process exception when dragging an <attachment> with no content type 4 https://bugs.webkit.org/show_bug.cgi?id=199480 5 <rdar://problem/44351353> 6 7 Reviewed by Wenson Hsieh. 8 9 * TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm: 10 (TestWebKitAPI::TEST): 11 Add a test; before the change, it crashes. 12 1 13 2019-07-03 Jonathan Bedard <jbedard@apple.com> 2 14 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm
r246739 r247120 1628 1628 } 1629 1629 1630 TEST(WKAttachmentTestsMac, DragAttachmentWithNoTypeShouldNotCrash) 1631 { 1632 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 1633 [configuration _setAttachmentElementEnabled:YES]; 1634 auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebViewFrame:NSMakeRect(0, 0, 400, 400) configuration:configuration.get()]); 1635 TestWKWebView *webView = [simulator webView]; 1636 [webView synchronouslyLoadHTMLString:attachmentEditingTestMarkup]; 1637 1638 [webView stringByEvaluatingJavaScript:@"document.body.appendChild(document.createElement('attachment')); 0"]; 1639 1640 [simulator runFrom:[webView attachmentElementMidPoint] to:CGPointMake(300, 300)]; 1641 1642 NSArray<NSURL *> *urls = [simulator receivePromisedFiles]; 1643 EXPECT_EQ(0U, urls.count); 1644 } 1645 1630 1646 #endif // PLATFORM(MAC) 1631 1647
Note: See TracChangeset
for help on using the changeset viewer.