<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - UIViewController with WKWebView presented modally causes the presented UIViewController to be dismissed."
   href="https://bugs.webkit.org/show_bug.cgi?id=165225#c32">Comment # 32</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - UIViewController with WKWebView presented modally causes the presented UIViewController to be dismissed."
   href="https://bugs.webkit.org/show_bug.cgi?id=165225">bug 165225</a>
              from <span class="vcard"><a class="email" href="mailto:wenson_hsieh&#64;apple.com" title="Wenson Hsieh &lt;wenson_hsieh&#64;apple.com&gt;"> <span class="fn">Wenson Hsieh</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=303134&amp;action=diff" name="attach_303134" title="Patch">attachment 303134</a> <a href="attachment.cgi?id=303134&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=303134&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=303134&amp;action=review</a>

<span class="quote">&gt; Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm:391
&gt; +    // dismiss any viewController that is being presented. This is works for all types of viewcontrollers , popovers, etc.</span >

Please capitalize &quot;dismiss&quot;

<span class="quote">&gt; Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm:392
&gt; +    UIViewController *presentedViewController = [UIViewController _viewControllerForFullScreenPresentationFromView:_view];</span >

So if I understand correctly, [UIViewController _viewControllerForFullScreenPresentationFromView:_view] will fetch the _presentationPopover, if it exists, as well? If that is really the case, then this is OK, but we should at least tear down _presentationPopover properly (i.e. nil out _presentationPopover and set its delegate to nil).

<span class="quote">&gt; Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm:506
&gt; +    // Clear out any previous view controller reference, to prevent calling dismiss on a view controller that</span >

Per Darin's advice a few comments above, this should really say &quot;Clear out the view controller we just presented&quot; rather than refer to the view controller we're clearing out as the &quot;previous&quot; one.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>