[Webkit-unassigned] [Bug 187926] New: WKWebView in a modal presentation dismisses its presenting view controller.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 23 14:39:11 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=187926

            Bug ID: 187926
           Summary: WKWebView in a modal presentation dismisses its
                    presenting view controller.
           Product: WebKit
           Version: Safari 11
          Hardware: iPhone / iPad
                OS: iOS 11
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: tph at atomicbird.com

Created attachment 345609

  --> https://bugs.webkit.org/attachment.cgi?id=345609&action=review

Demo project reproducing this issue.

This is similar to:

- https://bugs.webkit.org/show_bug.cgi?id=165225
- https://bugs.webkit.org/show_bug.cgi?id=185257

However it's still present as of iOS 11.4.1. A minimal sample project is attached.

The behavior is:

1. Present a view controller modally which contains a WKWebView.
2. Load a page in the WKWebView that includes an image.
3. Tap and hold on the image until the save/copy/cancel alert appears.
4. Tap "cancel" in the alert.

Expected behavior: The alert would disappear.

Actual behavior: Both the alert and the view controller presented in step 1 are dismissed.

This appears to happen because dismissViewControllerAnimated:completion: is called twice even though only one alert has been displayed.

The backtrace for the first dismiss call is:

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
  * frame #0: 0x000000018f006130 UIKit`-[UIViewController dismissViewControllerAnimated:completion:]
    frame #1: 0x000000018f41e1a4 UIKit`__103-[UIAlertController _dismissAnimated:triggeringAction:triggeredByPopoverDimmingView:dismissCompletion:]_block_invoke.465 + 248
    frame #2: 0x000000018f005fb4 UIKit`-[UIAlertController _performAction:invokeActionBlock:dismissAndPerformActionIfNotAlreadyPerformed:] + 124
    frame #3: 0x000000018f005b94 UIKit`-[UIAlertController _dismissAnimated:triggeringAction:triggeredByPopoverDimmingView:dismissCompletion:] + 824
    frame #4: 0x000000018f005848 UIKit`-[UIAlertController _dismissWithAction:dismissCompletion:] + 68
    frame #5: 0x000000018f0056ec UIKit`-[_UIAlertControllerView interfaceAction:invokeActionHandler:completion:] + 256
    frame #6: 0x000000018f005588 UIKit`-[UIInterfaceActionGroupView interfaceAction:invokeActionHandler:completion:] + 120
    frame #7: 0x000000018f005490 UIKit`-[UIInterfaceAction _invokeHandlerWithCompletionBlock:] + 168
    frame #8: 0x000000018efff2d8 UIKit`-[UIInterfaceActionSelectionTrackingController _handleActionSelectionGestureRecognizer:] + 864
    frame #9: 0x000000018effa6e8 UIKit`-[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 64
    frame #10: 0x000000018f5673b4 UIKit`_UIGestureRecognizerSendTargetActions + 124
    frame #11: 0x000000018f15ce38 UIKit`_UIGestureRecognizerSendActions + 320
    frame #12: 0x000000018eff9740 UIKit`-[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 764
    frame #13: 0x000000018f558bd4 UIKit`_UIGestureEnvironmentUpdate + 1096
    frame #14: 0x000000018eff34d8 UIKit`-[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 404
    frame #15: 0x000000018eff3010 UIKit`-[UIGestureEnvironment _updateGesturesForEvent:window:] + 276
    frame #16: 0x000000018eff2874 UIKit`-[UIWindow sendEvent:] + 3132
    frame #17: 0x000000018eff11d0 UIKit`-[UIApplication sendEvent:] + 340
    frame #18: 0x000000018f7d2d1c UIKit`__dispatchPreprocessedEventFromEventQueue + 2340
    frame #19: 0x000000018f7d52c8 UIKit`__handleEventQueueInternal + 4744
    frame #20: 0x000000018f7ce368 UIKit`__handleHIDEventFetcherDrain + 152
    frame #21: 0x00000001851b7404 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    frame #22: 0x00000001851b6c2c CoreFoundation`__CFRunLoopDoSources0 + 276
    frame #23: 0x00000001851b479c CoreFoundation`__CFRunLoopRun + 1204
    frame #24: 0x00000001850d4da8 CoreFoundation`CFRunLoopRunSpecific + 552
    frame #25: 0x00000001870b9020 GraphicsServices`GSEventRunModal + 100
    frame #26: 0x000000018f0f1758 UIKit`UIApplicationMain + 236

The backtrace for the second one is:

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
  * frame #0: 0x000000018f006130 UIKit`-[UIViewController dismissViewControllerAnimated:completion:]
    frame #1: 0x000000018f41e1a4 UIKit`__103-[UIAlertController _dismissAnimated:triggeringAction:triggeredByPopoverDimmingView:dismissCompletion:]_block_invoke.465 + 248
    frame #2: 0x000000018f005fb4 UIKit`-[UIAlertController _performAction:invokeActionBlock:dismissAndPerformActionIfNotAlreadyPerformed:] + 124
    frame #3: 0x000000018f005b94 UIKit`-[UIAlertController _dismissAnimated:triggeringAction:triggeredByPopoverDimmingView:dismissCompletion:] + 824
    frame #4: 0x000000018f005848 UIKit`-[UIAlertController _dismissWithAction:dismissCompletion:] + 68
    frame #5: 0x000000018f0056ec UIKit`-[_UIAlertControllerView interfaceAction:invokeActionHandler:completion:] + 256
    frame #6: 0x000000018f005588 UIKit`-[UIInterfaceActionGroupView interfaceAction:invokeActionHandler:completion:] + 120
    frame #7: 0x000000018f005490 UIKit`-[UIInterfaceAction _invokeHandlerWithCompletionBlock:] + 168
    frame #8: 0x000000018efff2d8 UIKit`-[UIInterfaceActionSelectionTrackingController _handleActionSelectionGestureRecognizer:] + 864
    frame #9: 0x000000018effa6e8 UIKit`-[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 64
    frame #10: 0x000000018f5673b4 UIKit`_UIGestureRecognizerSendTargetActions + 124
    frame #11: 0x000000018f15ce38 UIKit`_UIGestureRecognizerSendActions + 320
    frame #12: 0x000000018eff9740 UIKit`-[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 764
    frame #13: 0x000000018f558bd4 UIKit`_UIGestureEnvironmentUpdate + 1096
    frame #14: 0x000000018eff34d8 UIKit`-[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 404
    frame #15: 0x000000018eff3010 UIKit`-[UIGestureEnvironment _updateGesturesForEvent:window:] + 276
    frame #16: 0x000000018eff2874 UIKit`-[UIWindow sendEvent:] + 3132
    frame #17: 0x000000018eff11d0 UIKit`-[UIApplication sendEvent:] + 340
    frame #18: 0x000000018f7d2d1c UIKit`__dispatchPreprocessedEventFromEventQueue + 2340
    frame #19: 0x000000018f7d52c8 UIKit`__handleEventQueueInternal + 4744
    frame #20: 0x000000018f7ce368 UIKit`__handleHIDEventFetcherDrain + 152
    frame #21: 0x00000001851b7404 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    frame #22: 0x00000001851b6c2c CoreFoundation`__CFRunLoopDoSources0 + 276
    frame #23: 0x00000001851b479c CoreFoundation`__CFRunLoopRun + 1204
    frame #24: 0x00000001850d4da8 CoreFoundation`CFRunLoopRunSpecific + 552
    frame #25: 0x00000001870b9020 GraphicsServices`GSEventRunModal + 100
    frame #26: 0x000000018f0f1758 UIKit`UIApplicationMain + 236

When the attached demo app launches, there's a single button labeled "present". Tap this button and then follow the steps described above to reproduce. After tapping "cancel", the initial view controller with the "present" button reappears.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180723/1752351e/attachment-0001.html>


More information about the webkit-unassigned mailing list