CLOSED FIXED 35402
[GTK] Make webkit_web_view_grab_focus to active focus controller.
https://bugs.webkit.org/show_bug.cgi?id=35402
Summary [GTK] Make webkit_web_view_grab_focus to active focus controller.
Antonio Gomes
Reported 2010-02-25 13:21:48 PST
When programatically setting focus to an element in an inner document, calling "hasFocus()" from this document returns FALSE, because document's FocusController is not activated. ps: It does not happen if |document| is the main document. Making webkit_web_view_grab_focus to actually activate the FocusController, fixes the issue. patch coming, including API unit test. * sample failing pseudo html/JS code: <html> <script> function _focus_() { var innerDoc = document.defaultView.frames[0].document; innerDoc.getElementById("link").focus(); if (innerDoc.hasFocus()) dump("has focus"); } </script> <body onload="_focus_()"> <iframe src=iframe.html/> </body> </html> ********* iframe.html ********* <html> <body> <a id="link" href="http://abc.def">test</a> </body> </html>
Attachments
proposed patch (7.00 KB, patch)
2010-02-25 13:40 PST, Antonio Gomes
no flags
Antonio Gomes
Comment 1 2010-02-25 13:40:27 PST
Created attachment 49529 [details] proposed patch
Xan Lopez
Comment 2 2010-02-26 07:28:36 PST
Comment on attachment 49529 [details] proposed patch >+ The code below is an wordaround: if the node has focus, a scroll typo in 'wordaround' >+ action is performed and afterward it is checked if the adjustment >+ has to be different from 0. >+ */ It would be nicer to not duplicate so much code between the tests by using common setup/teardown methods like in other testfiles, but you can do it in a follow-up if you feel like it.
Xan Lopez
Comment 3 2010-02-26 07:29:21 PST
Comment on attachment 49529 [details] proposed patch >+ g_object_connect(G_OBJECT(view), >+ "signal::notify::progress", idle_quit_loop_cb, NULL, >+ NULL); Bah, this was cut in the previous comment. You can just use g_signal_connect here.
Antonio Gomes
Comment 4 2010-02-26 13:27:10 PST
fixed: r55300 and r55305 thx xan and kov
Antonio Gomes
Comment 5 2010-04-11 19:58:46 PDT
Comment on attachment 49529 [details] proposed patch Clearing flags on attachment: 49529 Committed r55300: <http://trac.webkit.org/changeset/55300>
Note You need to log in before you can comment on or make changes to this bug.