Bug 60487 - [Qt] DRT eventSender.addTouchPoint method is not setting the start position
Summary: [Qt] DRT eventSender.addTouchPoint method is not setting the start position
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 32484
  Show dependency treegraph
 
Reported: 2011-05-09 11:40 PDT by Igor Trindade Oliveira
Modified: 2011-05-16 14:04 PDT (History)
2 users (show)

See Also:


Attachments
patch (1.57 KB, patch)
2011-05-09 11:44 PDT, Igor Trindade Oliveira
akling: review-
Details | Formatted Diff | Diff
patch (2.13 KB, patch)
2011-05-09 12:57 PDT, Igor Trindade Oliveira
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Trindade Oliveira 2011-05-09 11:40:46 PDT
when adding a new touch point(eventSender.addTouchPoint(x,y)). The startPos is not being set. it is necessary to create tests for bug: https://bugs.webkit.org/show_bug.cgi?id=32484
Comment 1 Igor Trindade Oliveira 2011-05-09 11:44:23 PDT
Created attachment 92814 [details]
patch

Proposed Patch
Comment 2 Andreas Kling 2011-05-09 12:36:31 PDT
Comment on attachment 92814 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=92814&action=review

Nice catch. r- because the code is ugly. Not your fault, but let's fix it. :)

> Tools/DumpRenderTree/qt/EventSenderQt.cpp:406
>      QTouchEvent::TouchPoint point(id);
>      m_touchPoints.append(point);
>      updateTouchPoint(index, x, y);
> +    m_touchPoints[index].setStartPos(QPointF(x, y));
>      m_touchPoints[index].setState(Qt::TouchPointPressed);

This code is unnecessarily confusing, we should fix it while we're visiting. Something like:

QTouchEvent::TouchPoint point(id);
point.setPos(QPointF(x, y));
point.setStartPos(QPointF(x, y));
point.setState(Qt::TouchPointPressed);
m_touchPoints.append(point);

And of course the 'index' variable won't be needed after this cleanup.
Comment 3 Igor Trindade Oliveira 2011-05-09 12:57:44 PDT
Created attachment 92835 [details]
patch

proposed patch.
Comment 4 Andreas Kling 2011-05-09 13:23:25 PDT
Comment on attachment 92835 [details]
patch

r=me
Comment 5 WebKit Commit Bot 2011-05-09 14:56:24 PDT
Comment on attachment 92835 [details]
patch

Clearing flags on attachment: 92835

Committed r86090: <http://trac.webkit.org/changeset/86090>
Comment 6 WebKit Commit Bot 2011-05-09 14:56:27 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Ademar Reis 2011-05-16 14:04:30 PDT
Revision r86090 cherry-picked into qtwebkit-2.2 with commit 1064adb <http://gitorious.org/webkit/qtwebkit/commit/1064adb>