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>
Created attachment 49529 [details] proposed patch
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.
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.
fixed: r55300 and r55305 thx xan and kov
Comment on attachment 49529 [details] proposed patch Clearing flags on attachment: 49529 Committed r55300: <http://trac.webkit.org/changeset/55300>