Bug 60016

Summary: [GTK] WidgetGtk setFocus can not access directly the widget in WK2
Product: WebKit Reporter: Alejandro G. Castro <alex>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Description Flags
Proposed patch mrobinson: review+

Description Alejandro G. Castro 2011-05-03 02:34:35 PDT
We are grabbing directly the focus using the widget and this only works for Webkit1.
Comment 1 Alejandro G. Castro 2011-05-03 02:42:26 PDT
Created attachment 92056 [details]
Proposed patch
Comment 2 Martin Robinson 2011-05-03 10:29:09 PDT
Comment on attachment 92056 [details]
Proposed patch

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

Great stuff.

> Source/WebCore/platform/gtk/WidgetGtk.cpp:69
> +    Frame* frame = Frame::frameForWidget(this);
> +    if (frame) {

This can just be:
if (Frame* frame = Frame::frameForWidget(this)) {

or an  early return.

> Source/WebCore/platform/gtk/WidgetGtk.cpp:71
> +        Page* page = frame->page();
> +        page->chrome()->focus();

Also should just be frame->page()->chrome()->focus();
Comment 3 Alejandro G. Castro 2011-05-09 08:39:38 PDT
Thanks for the comments, landed: