Changeset 233502 in webkit


Ignore:
Timestamp:
Jul 4, 2018 2:43:07 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

A WKWebView in a UIViewController that is presented modally and uses a file picker will be incorrectly dismissed by the system
https://bugs.webkit.org/show_bug.cgi?id=185257
<rdar://problem/40819252>

Patch by Olivia Barnett <obarnett@apple.com> on 2018-07-04
Reviewed by Tim Horton.

Call to dismiss the presented modal was being called on the parent and not the child, which caused the file picker to be incorrectly dismissed along with the modal. A test for this bug-fix could not be completed without additional tools as TestWebKitAPI is not a UI application.

  • UIProcess/ios/forms/WKFileUploadPanel.mm:

(-[WKFileUploadPanel _dismissDisplayAnimated:]):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r233501 r233502  
     12018-07-04  Olivia Barnett  <obarnett@apple.com>
     2
     3        A WKWebView in a UIViewController that is presented modally and uses a file picker will be incorrectly dismissed by the system
     4        https://bugs.webkit.org/show_bug.cgi?id=185257
     5        <rdar://problem/40819252>
     6
     7        Reviewed by Tim Horton.
     8
     9        Call to dismiss the presented modal was being called on the parent and not the child, which caused the file picker to be incorrectly dismissed along with the modal. A test for this bug-fix could not be completed without additional tools as TestWebKitAPI is not a UI application.
     10
     11        * UIProcess/ios/forms/WKFileUploadPanel.mm:
     12        (-[WKFileUploadPanel _dismissDisplayAnimated:]):
     13
    1142018-07-04  Tim Horton  <timothy_horton@apple.com>
    215
  • trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm

    r233079 r233502  
    284284
    285285    if (_presentationViewController) {
    286         [_presentationViewController dismissViewControllerAnimated:animated completion:^{
    287             _presentationViewController = nil;
    288         }];
     286        UIViewController *currentPresentedViewController = [_presentationViewController presentedViewController];
     287        if (currentPresentedViewController == self) {
     288            [currentPresentedViewController dismissViewControllerAnimated:YES completion:^{
     289                _presentationViewController = nil;
     290            }];
     291        }
    289292    }
    290293}
Note: See TracChangeset for help on using the changeset viewer.