RESOLVED FIXED 87236
[Qt][WK2] Fix failing qmltests::FitToView::test_basic()
https://bugs.webkit.org/show_bug.cgi?id=87236
Summary [Qt][WK2] Fix failing qmltests::FitToView::test_basic()
Csaba Osztrogonác
Reported 2012-05-23 02:20:15 PDT
This test introduced in http://trac.webkit.org/changeset/117942 and fails from the beginning: FAIL! : qmltests::FitToView::test_basic() Compared values are not the same Actual (): 0.5 Expected (): 1 Loc: [/home/webkitbuildbot/slaves/release64bitWebKit2_EC2/buildslave/qt-linux-64-release-webkit2/build/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_fitToView.qml(96)]
Attachments
Patch (9.55 KB, patch)
2012-05-24 05:16 PDT, zalan
no flags
Patch (8.42 KB, patch)
2012-05-24 05:42 PDT, zalan
no flags
Patch (9.22 KB, patch)
2012-05-24 12:26 PDT, zalan
no flags
Patch (9.59 KB, patch)
2012-05-25 00:13 PDT, zalan
no flags
Patch (14.09 KB, patch)
2012-05-29 02:33 PDT, Kenneth Rohde Christiansen
no flags
Patch (14.72 KB, patch)
2012-05-29 03:44 PDT, Kenneth Rohde Christiansen
hausmann: review+
Kenneth Rohde Christiansen
Comment 1 2012-05-23 03:47:18 PDT
I'm already looking into this.
Kenneth Rohde Christiansen
Comment 2 2012-05-23 03:47:39 PDT
I'm already looking into this.
Kenneth Rohde Christiansen
Comment 3 2012-05-24 03:46:32 PDT
https://gist.github.com/2780751 fixes this but contains many separate changes. Work is ongoing to upstream this ASAP with help of Zalan and Alex.
zalan
Comment 4 2012-05-24 05:16:20 PDT
Kenneth Rohde Christiansen
Comment 5 2012-05-24 05:18:06 PDT
Comment on attachment 143792 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143792&action=review r=me with the changes > Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp:127 > - emit d->viewportItem->experimental()->test()->contentsScaleCommitted(); > + emit d->viewportItem->experimental()->test()->contentsScaleChanged(); unrelated, should be part of another patch > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:930 > - // Emits contentsScaleCommitted(); > + // Emits contentsScaleChanged(); Other patch?
Caio Marcelo de Oliveira Filho
Comment 6 2012-05-24 05:33:15 PDT
Comment on attachment 143792 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143792&action=review > Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp:297 > + m_hadUserInteraction = true; Question: do we still need to set it to true in the gesture specific functions: panGestureStarted(), pinchGestureStarted()? Suggestion: this seems to be the important fix in the patch, maybe deserve some mention in the ChangeLog why had user interaction was missing here. > Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp:360 > + ASSERT(m_hadUserInteraction); 8 lines after the code sets m_hadUserInteraction to true again, maybe that's not needed anymore.
Caio Marcelo de Oliveira Filho
Comment 7 2012-05-24 05:33:38 PDT
Comment on attachment 143792 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143792&action=review > Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp:297 > + m_hadUserInteraction = true; Question: do we still need to set it to true in the gesture specific functions: panGestureStarted(), pinchGestureStarted()? Suggestion: this seems to be the important fix in the patch, maybe deserve some mention in the ChangeLog why had user interaction was missing here. > Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp:360 > + ASSERT(m_hadUserInteraction); 8 lines after the code sets m_hadUserInteraction to true again, maybe that's not needed anymore.
Caio Marcelo de Oliveira Filho
Comment 8 2012-05-24 05:33:38 PDT
Comment on attachment 143792 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143792&action=review > Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp:297 > + m_hadUserInteraction = true; Question: do we still need to set it to true in the gesture specific functions: panGestureStarted(), pinchGestureStarted()? Suggestion: this seems to be the important fix in the patch, maybe deserve some mention in the ChangeLog why had user interaction was missing here. > Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp:360 > + ASSERT(m_hadUserInteraction); 8 lines after the code sets m_hadUserInteraction to true again, maybe that's not needed anymore.
Caio Marcelo de Oliveira Filho
Comment 9 2012-05-24 05:34:55 PDT
Sorry for the repeated messages.
Kenneth Rohde Christiansen
Comment 10 2012-05-24 05:36:25 PDT
(In reply to comment #8) > (From update of attachment 143792 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=143792&action=review > > > Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp:297 > > + m_hadUserInteraction = true; > > Question: do we still need to set it to true in the gesture specific functions: panGestureStarted(), pinchGestureStarted()? They should not be needed anymore, but I am not sure how correct our current code is, so we could replace them with asserts. > Suggestion: this seems to be the important fix in the patch, maybe deserve some mention in the ChangeLog why had user interaction was missing here. the touchBegin was added by Jocelyn to fix a bug, but he forgot to add the = true, which breaks one of our tests.
zalan
Comment 11 2012-05-24 05:42:37 PDT
Caio Marcelo de Oliveira Filho
Comment 12 2012-05-24 06:00:43 PDT
Comment on attachment 143799 [details] Patch Sorry. I think at least assigning true after the ASSERT true should be fixed, otherwise people reading this code in the future will get confused.
Caio Marcelo de Oliveira Filho
Comment 13 2012-05-24 06:05:36 PDT
(In reply to comment #10) > (In reply to comment #8) > > (From update of attachment 143792 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=143792&action=review > > > > > Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp:297 > > > + m_hadUserInteraction = true; > > > > Question: do we still need to set it to true in the gesture specific functions: panGestureStarted(), pinchGestureStarted()? > > They should not be needed anymore, but I am not sure how correct our current code is, so we could replace them with asserts. If the assignments are redundant I think they should be removed before landing the patch with assertions.
Caio Marcelo de Oliveira Filho
Comment 14 2012-05-24 06:09:02 PDT
(In reply to comment #13) > If the assignments are redundant I think they should be removed before landing the patch with assertions. the patch, with assertions added in their places.
Kenneth Rohde Christiansen
Comment 15 2012-05-24 07:42:57 PDT
(In reply to comment #14) > (In reply to comment #13) > > If the assignments are redundant I think they should be removed before landing the patch with assertions. > > the patch, with assertions added in their places. He means from pinch and panGesture...
zalan
Comment 16 2012-05-24 12:26:15 PDT
Kenneth Rohde Christiansen
Comment 17 2012-05-24 14:37:10 PDT
Comment on attachment 143870 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143870&action=review r=me with that change > Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp:-503 > - m_hadUserInteraction = true; Please make these asserts instead. The idea is that touchBegin gets called before panGestureStarted, so lets make sure that never change by making this into an assert ASSERT(m_hadUserInteraction); // Set by perceding touchBegin call. > Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp:-567 > - m_hadUserInteraction = true; Same here.
zalan
Comment 18 2012-05-25 00:13:32 PDT
WebKit Review Bot
Comment 19 2012-05-25 01:29:48 PDT
Comment on attachment 143989 [details] Patch Clearing flags on attachment: 143989 Committed r118493: <http://trac.webkit.org/changeset/118493>
WebKit Review Bot
Comment 20 2012-05-25 01:29:54 PDT
All reviewed patches have been landed. Closing bug.
Kenneth Rohde Christiansen
Comment 21 2012-05-26 01:47:09 PDT
Reopen as the test doesn't pass yet and I have local code to make it do so. Unfortunately this will first be fixed tuesday.
Kenneth Rohde Christiansen
Comment 22 2012-05-29 02:33:20 PDT
WebKit Review Bot
Comment 23 2012-05-29 02:38:47 PDT
Attachment 144490 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit..." exit_code: 1 Source/WebKit2/UIProcess/API/qt/qwebkittest_p.h:26: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Caio Marcelo de Oliveira Filho
Comment 24 2012-05-29 03:01:49 PDT
Comment on attachment 144490 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=144490&action=review > Source/WebKit2/ChangeLog:7 > + I'm missing a big picture comment about the fix you are making here. What was wrong to make the test fail? > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:887 > + static float lastCommittedScale = -1; If we have two WebViews in the application, won't this static cause trouble?
Simon Hausmann
Comment 25 2012-05-29 03:01:59 PDT
Comment on attachment 144490 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=144490&action=review > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:890 > + static float lastCommittedScale = -1; > + if (scale != lastCommittedScale) > + emit q->experimental()->test()->contentsScaleCommitted(); > + lastCommittedScale = scale; Urgh, any chance of making this a member variable instead? ;( Maybe it belongs as a member into the test object? > Source/WebKit2/UIProcess/API/qt/qwebkittest.cpp:57 > +bool QWebKitTest::sendTouchEvent(QQuickWebView* window, QEvent::Type type, QList<QTouchEvent::TouchPoint>& points, ulong timestamp) I don't like APIs that have mutable parameters where you can't see them on the caller side. I would prefer if points was a _pointer_ to a QList, so that it's easier to imagine on the caller side that the list will be modified in this function. Although it doesn't look like that this functionality (removing released touch points) is used anywhere?
Kenneth Rohde Christiansen
Comment 26 2012-05-29 03:44:17 PDT
WebKit Review Bot
Comment 27 2012-05-29 03:48:11 PDT
Attachment 144504 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit..." exit_code: 1 Source/WebKit2/UIProcess/API/qt/qwebkittest_p.h:25: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Kenneth Rohde Christiansen
Comment 28 2012-05-29 05:10:31 PDT
Committed in 118758
Note You need to log in before you can comment on or make changes to this bug.