Bug 27171

Summary: [Gtk] REGRESSION (r45440): fails at fast/events/frame-programmatic-focus.html
Product: WebKit Reporter: Jan Alonzo <jmalonzo>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal Keywords: Gtk
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
implement grab-focus gustavo: review+

Description Jan Alonzo 2009-07-10 19:56:31 PDT
Changeset: http://trac.webkit.org/changeset/45440

Test: fast/events/frame-programmatic-focus.html

Test diff:
 <input> focused
 <input> blurred
 main frame blurred
-iframe focused
 <input> in iframe focused
 <input> in frame blurred
 iframe blurred
-main frame focused
 <input> focused

The fix in http://trac.webkit.org/changeset/45470 is incomplete. focus-in and focus-out events seem to only happen when there's user interaction.

The fix is to implement grab_focus in the WebView as well so it will work when focus is set programmatically.

Patch coming...
Comment 1 Jan Alonzo 2009-07-10 20:04:39 PDT
Created attachment 32605 [details]
implement grab-focus
Comment 2 Gustavo Noronha (kov) 2009-07-12 04:40:57 PDT
Comment on attachment 32605 [details]
implement grab-focus

> -        core(webView)->focusController()->setActive(frame);
> -        core(webView)->focusController()->setFocused(true);
> +        focusController->setActive(true);
> +        focusController->setFocused(true);

The only change that makes me a bit nervous is going from frame to true here. I believe there might have been a reason to not set it unconditionally? r=me, but please either revert this specific change, or add a comment here on the bug so that we have a way of tracking this down.
Comment 3 Jan Alonzo 2009-07-13 03:12:21 PDT
(In reply to comment #2)
> (From update of attachment 32605 [details])
> > -        core(webView)->focusController()->setActive(frame);
> > -        core(webView)->focusController()->setFocused(true);
> > +        focusController->setActive(true);
> > +        focusController->setFocused(true);
> 
> The only change that makes me a bit nervous is going from frame to true here. I
> believe there might have been a reason to not set it unconditionally? r=me, but
> please either revert this specific change, or add a comment here on the bug so
> that we have a way of tracking this down.

Thanks. I reverted the change and landed it in http://trac.webkit.org/changeset/45802.