Launch QtTestBrowser in graphics-based mode with $ run-launcher --qt -graphicsbased http://google.com the google page auto focus on the main textfield after it finishes loading the page. However, with graphicsbased QtTestBrowser it does not work, while works fine with QWidget based (QWebView).
(In reply to comment #0) > Launch QtTestBrowser in graphics-based mode with > > $ run-launcher --qt -graphicsbased http://google.com > > the google page auto focus on the main textfield after it finishes loading the page. However, with graphicsbased QtTestBrowser it does not work, while works fine with QWidget based (QWebView). The problem seems to be that QGraphicsScene only propagates focus events if they are caused by tab or backtab in cases where there is no active focus item. Only way around this that I can see is to install an event filter on the scene to capture the focus events. I'll upload a possible patch shortly.
Created attachment 74498 [details] Patch
Comment on attachment 74498 [details] Patch Is it possible to make an autotest for this somehow?
(In reply to comment #3) > (From update of attachment 74498 [details]) > Is it possible to make an autotest for this somehow? Think so, should be possible to make a subclass of QGraphicsWebView and see if focusInEvent() is received after showing the view. I'll see if I can get a test up and running.
Created attachment 74588 [details] Patch
Comment on attachment 74588 [details] Patch Would be cool if you could do a test with multiple scenes.
It would be really cool if you could make a similar patch for our WebKit2 port.
(In reply to comment #6) > (From update of attachment 74588 [details]) > Would be cool if you could do a test with multiple scenes. A test where you have a view visible and changing the scene you mean? Shouldn't be hard.
(In reply to comment #7) > It would be really cool if you could make a similar patch for our WebKit2 port. I'll see if I can find some information about how to start hacking on that.
Created attachment 74726 [details] Patch
Comment on attachment 74726 [details] Patch What is changed in this new patch? still looks good
Comment on attachment 74726 [details] Patch Clearing flags on attachment: 74726 Committed r72650: <http://trac.webkit.org/changeset/72650>
All reviewed patches have been landed. Closing bug.
Ouch, an event-filter on the scene. That sounds _really_ evil. IMHO we should roll out the patch. I think the bug is actually in QtTestBrowser, in WebViewGraphicsBased::WebViewGraphicsBased, which should make the m_item the focus item.
Rolled out with https://bugs.webkit.org/show_bug.cgi?id=50010
Created attachment 74794 [details] Patch Second attempt at fixing this, using the suggestion in #14
Comment on attachment 74794 [details] Patch that was what I first suggest in bug description :)
(In reply to comment #17) > (From update of attachment 74794 [details]) > that was what I first suggest in bug description :) Indeed. My first solution was too complex for this.
The commit-queue encountered the following flaky tests while processing attachment 74794 [details]: fast/workers/storage/use-same-database-in-page-and-workers.html svg/dom/SVGScriptElement/script-set-href.svg Please file bugs against the tests. These tests were authored by dumi@chromium.org, mitz@webkit.org, and zimmermann@kde.org. The commit-queue is continuing to process your patch.
Comment on attachment 74794 [details] Patch Clearing flags on attachment: 74794 Committed r72712: <http://trac.webkit.org/changeset/72712>