Bug 35834 - [Qt] QGraphicsWebView: Arrow keys scroll the graphics-view instead of the web-page
Summary: [Qt] QGraphicsWebView: Arrow keys scroll the graphics-view instead of the web...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P1 Minor
Assignee: QtWebKit Unassigned
URL: http://www.youtube.com/xl
Keywords: Qt
Depends on:
Blocks:
 
Reported: 2010-03-06 14:44 PST by Noam Rosenthal
Modified: 2010-04-27 14:37 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.17 KB, patch)
2010-04-27 06:15 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Noam Rosenthal 2010-03-06 14:44:05 PST
To reproduce:
open the above website:
- QtLauncher -graphicsbased -url http://www.youtube.com/xl
- Resize the QtLauncher window to be a little smaller
- Press the down key several times

While the keys should affect the list selection, they actually move around the whole QGraphicsWebView.
This does not happen with QWebView (no -graphicsbased), hence the assumption that the bug is in the "Webkit Qt" module

I tested on Ubuntu 9.04, but I believe the problem exists on all Qt platforms.
Comment 1 Jocelyn Turcotte 2010-03-23 06:15:27 PDT
Reproduced on Windows as well (though its a bit harder than on linux).

I could also notice that it happens more often if you play with the tab switching.

QtLauncher only have the address bar and the web view that takes the focus, however, sometimes, the focus gets taken by another widget between the two (so it sometimes takes 2 tabs to switch the focus from the address to the web view). The bug happens when you press the arrow keys while focused on this intermediate widget.

If you don't resize the window a bit, you still get the focus steal problem, but you won't see the "move around the whole QGraphicsWebView" problem.

According to Noam this bug is an annoyance for many embedded developers.
Setting to P1-minor since I think that this is worth fixing it for the next release.
Comment 2 Benjamin Poulain 2010-04-27 06:15:50 PDT
Created attachment 54412 [details]
Patch

QGraphicsView do not do anything wrong. It does not use the event so it ends up in the scroll area code.

We just have a make sure the scene has the correct size when we resize the graphicswebview.
Comment 3 Kenneth Rohde Christiansen 2010-04-27 06:47:26 PDT
Comment on attachment 54412 [details]
Patch

I managed to trick a similar bug using wheel and opening a combobox and it scrolled the graphics view instead of the page and left behind garbage.
Comment 4 WebKit Commit Bot 2010-04-27 12:34:09 PDT
Comment on attachment 54412 [details]
Patch

Clearing flags on attachment: 54412

Committed r58321: <http://trac.webkit.org/changeset/58321>
Comment 5 WebKit Commit Bot 2010-04-27 12:34:14 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Noam Rosenthal 2010-04-27 14:37:32 PDT
So a developer implementing an application with QGraphicsWebView and keypad navigation would have to do this sceneRect step each time?