<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#c25">Comment # 25</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:darin@apple.com" title="Darin Adler <darin@apple.com>"> <span class="fn">Darin Adler</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=303130&action=diff" name="attach_303130" title="Patch">attachment 303130</a> <a href="attachment.cgi?id=303130&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=303130&action=review">https://bugs.webkit.org/attachment.cgi?id=303130&action=review</a>
<span class="quote">> Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm:391
> + // dismiss any viewController that is being presented. This is works all VC, popovers, etc.</span >
Normally we would want to use a capital D in this kind of sentence-style comment.
VC is not normally an abbreviation we use for view controller in WebKit code.
"This is works all", is not grammatically correct.
<span class="quote">> Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm:394
> + UIViewController *presentedViewController = [UIViewController _viewControllerForFullScreenPresentationFromView:_view];
> + if (presentedViewController)
> + [presentedViewController dismissViewControllerAnimated:NO completion:nil];</span >
Would be nice to define the variable inside the "if" since this is C++ code. In fact, I personally would use auto instead of writing out UIViewController * for the type of the variable.
<span class="quote">> Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm:508
> + // Clear out any previous view controller reference, to prevent calling dismiss on a view controller that
> + // was no longer being presented. Don't save a reference to the UIDocumentMenuViewController as it is self dismissing.
> + _presentationViewController = nil;</span >
I don’t understand this comment and therefore don’t understand the code.
On iPhone, the method called just before this will call _presentFullscreenViewController. Then this line of code will clear out the reference to that just-presented view controller. Given that, why does this comment talk about clearing out a "previous view controller reference"?</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>