Bug 165664

Summary: WebView doesn't become first responder in element fullscreen.
Product: WebKit Reporter: Jeremy Jones <jeremyj-wk>
Component: WebKit2Assignee: Jeremy Jones <jeremyj-wk>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jer.noble, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Mac   
OS: Unspecified   
Attachments:
Description Flags
Patch
jer.noble: review+
Patch for landing. none

Description Jeremy Jones 2016-12-09 11:16:34 PST
WebView doesn't become first responder in element fullscreen.
Comment 1 Jeremy Jones 2016-12-09 11:19:04 PST
Created attachment 296663 [details]
Patch
Comment 2 Jeremy Jones 2016-12-09 11:19:48 PST
rdar://problem/28927252
Comment 3 Tim Horton 2016-12-09 11:33:52 PST
Comment on attachment 296663 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=296663&action=review

> Source/WebKit2/ChangeLog:12
> +        This change wait until after the contentView is visible to make the web view the first responder.

"This change wait until"

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:619
> +    [window makeFirstResponder:_webView];

Does makeResponderFirstResponderIfDescendantOfView do something important? Should you still use that? It seems like it had to be there for a reason.
Comment 4 Jeremy Jones 2016-12-09 11:48:58 PST
(In reply to comment #3)
> Comment on attachment 296663 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=296663&action=review
> 
> > Source/WebKit2/ChangeLog:12
> > +        This change wait until after the contentView is visible to make the web view the first responder.
> 
> "This change wait until"

"waits"

Done.

> 
> > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:619
> > +    [window makeFirstResponder:_webView];
> 
> Does makeResponderFirstResponderIfDescendantOfView do something important?
> Should you still use that? It seems like it had to be there for a reason.

It only makes the webView the first responder if if was already first responder while inline. However, it doesn't make sense to prevent web view from becoming first responder just because some search field in the app was first responder when entering fullscreen.
Comment 5 Jeremy Jones 2016-12-09 11:53:44 PST
(In reply to comment #4)
> (In reply to comment #3)
> > Comment on attachment 296663 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=296663&action=review
> > 
> > > Source/WebKit2/ChangeLog:12
> > > +        This change wait until after the contentView is visible to make the web view the first responder.
> > 
> > "This change wait until"
> 
> "waits"
> 
> Done.
> 
> > 
> > > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:619
> > > +    [window makeFirstResponder:_webView];
> > 
> > Does makeResponderFirstResponderIfDescendantOfView do something important?
> > Should you still use that? It seems like it had to be there for a reason.
> 
> It only makes the webView the first responder if if was already first
> responder while inline. However, it doesn't make sense to prevent web view
> from becoming first responder just because some search field in the app was
> first responder when entering fullscreen.

It is useful when exiting fullscreen to prevent the web view from stealing first responder from the app when exiting fullscreen.
Comment 6 Tim Horton 2016-12-09 11:57:53 PST
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > Comment on attachment 296663 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=296663&action=review
> > > 
> > > > Source/WebKit2/ChangeLog:12
> > > > +        This change wait until after the contentView is visible to make the web view the first responder.
> > > 
> > > "This change wait until"
> > 
> > "waits"
> > 
> > Done.
> > 
> > > 
> > > > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:619
> > > > +    [window makeFirstResponder:_webView];
> > > 
> > > Does makeResponderFirstResponderIfDescendantOfView do something important?
> > > Should you still use that? It seems like it had to be there for a reason.
> > 
> > It only makes the webView the first responder if if was already first
> > responder while inline. However, it doesn't make sense to prevent web view
> > from becoming first responder just because some search field in the app was
> > first responder when entering fullscreen.
> 
> It is useful when exiting fullscreen to prevent the web view from stealing
> first responder from the app when exiting fullscreen.

Ah, makes sense. WK2r=me
Comment 7 Jeremy Jones 2016-12-09 12:12:11 PST
Created attachment 296670 [details]
Patch for landing.
Comment 8 WebKit Commit Bot 2016-12-09 12:54:46 PST
Comment on attachment 296670 [details]
Patch for landing.

Clearing flags on attachment: 296670

Committed r209624: <http://trac.webkit.org/changeset/209624>