RESOLVED FIXED 108337
[Qt][WK2] Changing WebView.contentY and WebView.contentX does not redraw content
https://bugs.webkit.org/show_bug.cgi?id=108337
Summary [Qt][WK2] Changing WebView.contentY and WebView.contentX does not redraw content
Cornelius Hald
Reported 2013-01-30 06:13:44 PST
In QtQuick 2.0 WebView is derived from Flickable. Therefore I expect the Flickable API to work with WebView. However, if I change the contentY or contentX properties the content scrolls correctly out of view, but the now visible content is not painted. If I flick the content a couple of pixels the content suddenly gets painted correctly. Also, if changing contentY or contentX and then using the mouse wheel or they cursor keys for scrolling, the content jumps back to the original position before contentY or contentX was changed. Because of this behavior it is not possible to implement scroll bars in QML. Tested with Qt 5.0.0 official binaries and Qt 5.0.1 pre-release binaries from Jan. 18th on Linux (64 bit) and Windows 8 (32 bit). Attached is a screenshot showing what happens after scrolling down by using the contentY property. Also here is an example to reproduce the problem: import QtQuick 2.0 import QtWebKit 3.0 Rectangle { width: 900 height: 600 color: "white" WebView { id: web url: "http://heise.de" anchors.fill: parent anchors.rightMargin: 20 } Rectangle { color: "lightgray" width: 20 anchors.right: parent.right anchors.top: parent.top anchors.bottom: parent.bottom Rectangle { id: handle color: (mouse.pressed || mouse.containsMouse) ? "lightblue" : "darkgray" width: parent.width height: web.visibleArea.heightRatio * web.height y: web.visibleArea.yPosition * web.height MouseArea { id: mouse hoverEnabled: true drag.target: parent drag.axis: Drag.YAxis drag.minimumY: 0 drag.maximumY: web.height - handle.height anchors.fill: parent onPositionChanged: { if (pressedButtons == Qt.LeftButton) { web.contentY = handle.y * web.contentHeight / web.height } } } } } }
Attachments
Screenshot shows what happens after changing the contentY property. (71.02 KB, image/png)
2013-01-30 06:14 PST, Cornelius Hald
no flags
Patch (3.69 KB, patch)
2013-02-12 09:55 PST, Andras Becsi
no flags
Patch (4.26 KB, patch)
2013-02-13 04:38 PST, Andras Becsi
no flags
Cornelius Hald
Comment 1 2013-01-30 06:14:51 PST
Created attachment 185483 [details] Screenshot shows what happens after changing the contentY property.
Andras Becsi
Comment 2 2013-02-12 09:55:02 PST
Jocelyn Turcotte
Comment 3 2013-02-12 10:13:24 PST
Comment on attachment 187888 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=187888&action=review > Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp:-135 > void PageViewportControllerClientQt::flickMoveEnded() > { > // This method is called on the end of the pan or pan kinetic animation. > > - m_ignoreViewportChanges = true; How does this react now if the page gets scrolled by PageViewportController::pageDidRequestScroll, wouldn't that trigger an unnecessary update to the web process?
Andras Becsi
Comment 4 2013-02-13 04:38:56 PST
Andras Becsi
Comment 5 2013-02-13 04:41:29 PST
(In reply to comment #3) > (From update of attachment 187888 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=187888&action=review > > > Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp:-135 > > void PageViewportControllerClientQt::flickMoveEnded() > > { > > // This method is called on the end of the pan or pan kinetic animation. > > > > - m_ignoreViewportChanges = true; > > How does this react now if the page gets scrolled by PageViewportController::pageDidRequestScroll, wouldn't that trigger an unnecessary update to the web process? Indeed, the previous patch missed the removal of the update in setViewportPosition.
Jocelyn Turcotte
Comment 6 2013-02-13 05:02:34 PST
Comment on attachment 188057 [details] Patch Looks good, that's not what I meant, but good if that made you catch something :) You just need Owners to sign this off.
Andras Becsi
Comment 7 2013-02-13 08:19:25 PST
(In reply to comment #6) > (From update of attachment 188057 [details]) Benjamin, can you sign off on this? :)
Andras Becsi
Comment 8 2013-02-18 04:55:43 PST
Comment on attachment 188057 [details] Patch Clearing flags on attachment: 188057 Committed r143195: <http://trac.webkit.org/changeset/143195>
Andras Becsi
Comment 9 2013-02-18 04:55:48 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.