Bug 60016 - [GTK] WidgetGtk setFocus can not access directly the widget in WK2
Summary: [GTK] WidgetGtk setFocus can not access directly the widget in WK2
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2011-05-03 02:34 PDT by Alejandro G. Castro
Modified: 2011-05-09 08:39 PDT (History)
0 users

See Also:

Proposed patch (1.79 KB, patch)
2011-05-03 02:42 PDT, Alejandro G. Castro
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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: