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...
Created attachment 32605 [details] implement grab-focus
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.
(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.