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