<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#c7">Comment # 7</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:bwright2&#64;apple.com" title="Brad Wright &lt;bwright2&#64;apple.com&gt;"> <span class="fn">Brad Wright</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=165225#c6">comment #6</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=165225#c5">comment #5</a>)
&gt; &gt; Comment on <span class=""><a href="attachment.cgi?id=295877&amp;action=diff" name="attach_295877" title="Patch">attachment 295877</a> <a href="attachment.cgi?id=295877&amp;action=edit" title="Patch">[details]</a></span>
&gt; &gt; Patch
&gt; &gt; 
&gt; &gt; View in context:
&gt; &gt; <a href="https://bugs.webkit.org/attachment.cgi?id=295877&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=295877&amp;action=review</a>
&gt; &gt; 
&gt; &gt; &gt; Source/WebKit2/ChangeLog:3
&gt; &gt; &gt; +        UIViewController with WkWebView presented modally causes the presented UIViewController to be dismissed.
&gt; &gt; 
&gt; &gt; This title seems insufficient. It seems the issues is specific to File
&gt; &gt; Upload so that should be mentioned.
&gt; &gt; 
&gt; &gt; Perhaps a better title would be:
&gt; &gt; 
&gt; &gt;     WKWebView file upload dialog may incorrectly dismiss unrelated modal
&gt; &gt; view controller
&gt; &gt; 
&gt; &gt; Does that sound accurate to you?
&gt; &gt; 
&gt; &gt; &gt; Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm:557
&gt; &gt; &gt; -    if (UICurrentUserInterfaceIdiomIsPad())
&gt; &gt; &gt; +    if (UICurrentUserInterfaceIdiomIsPad()) {
&gt; &gt; &gt;          [self _presentPopoverWithContentViewController:viewController animated:YES];
&gt; &gt; &gt; -    else
&gt; &gt; &gt; -        [self _presentFullscreenViewController:viewController animated:YES];
&gt; &gt; &gt; +    } else {
&gt; &gt; 
&gt; &gt; Style: WebKit's Style guideline is to not use braces for single statement
&gt; &gt; conditional blocks. So these braces for the if should not be added. The
&gt; &gt; else, which is multiline should have braces.
&gt; &gt; <a href="https://webkit.org/code-style-guidelines/#braces-one-line">https://webkit.org/code-style-guidelines/#braces-one-line</a>
&gt; &gt; 
&gt; &gt; &gt; Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm:560
&gt; &gt; &gt; +        _presentationViewController = nil;
&gt; &gt; 
&gt; &gt; Hmm, this doesn't seem right.
&gt; &gt; 
&gt; &gt;   - The previous code attempts to dismiss the old view controller it
&gt; &gt; presented and is then presenting the new view controller.
&gt; &gt;   - The new code ignores the old view controller and presents the new view
&gt; &gt; controller.
&gt; 
&gt; You don't need to dismiss this view controller because it dismisses itself.
&gt; By explicitly calling another dismiss, the code is a duplicate dismiss which
&gt; then removes the modal view controller.
&gt; 
&gt; This problem will never appear in Safari, because there are no modally
&gt; presented views.  If you run the same sample project that I uploaded on the iPad, you
&gt; will see that the modal view controller is not dismissed.  This is because
&gt; the popup VC code path does not call dismissViewControllerAnimated.  The
&gt; problem only happens on a modal VC with a WkWebView and on the iPhone.
&gt; 
&gt; &gt; 
&gt; &gt; Shouldn't we continue to dismiss the old view controller? if
&gt; &gt; _presentationViewController was the incorrect view controller to be
&gt; &gt; dismissing (an ancestor), then perhaps _presentationViewController's
&gt; &gt; presentedViewController would be the correct view controller to dismiss
&gt; &gt; instead of dismissing nothing.
&gt; &gt; 
&gt; &gt; What do you think?</span ></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>