UIViewController with WKWebView presented modally causes the presented UIViewControll...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Mar 2017 09:15:10 +0000 (09:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Mar 2017 09:15:10 +0000 (09:15 +0000)
commit7945dd7e569de008b1b8284fdb35321b26f5fbfc
treeefae0a47e665e954a6b5b0e36b2963d6356aefbe
parent8e1d0a5d6c1a3791cecf7c6f4ec00749a560c197
UIViewController with WKWebView presented modally causes the presented UIViewController to be dismissed.
https://bugs.webkit.org/show_bug.cgi?id=165225

Patch by Brad Wright <bwright2@apple.com> on 2017-03-08
Reviewed by Wenson Hsieh.

The problem happens on an iPhone with a WKWebView inside a view controller presented modally. If the user selects an HTML file input
tag button, a UIDocumentMenuViewController will appear. Anything the user does next causes the entire modal view controller to get dismissed.

To fix this problem, I prevent the UIDocumentMenuViewController from being dismissed by not saving a pointer to it. The UIDocumentMenuViewController
always goes away by itself on any user interaction. Trying to dismiss the UIDocumentMenuViewController when it is already dismissed causes the modal view controller
to be dismissed.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _cancel]):
(-[WKFileUploadPanel dismiss]):
(-[WKFileUploadPanel _showDocumentPickerMenu]):
(-[WKFileUploadPanel _presentMenuOptionForCurrentInterfaceIdiom:]):
(-[WKFileUploadPanel _presentForCurrentInterfaceIdiom:]): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@213570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm