Bug 60487

Summary: [Qt] DRT eventSender.addTouchPoint method is not setting the start position
Product: WebKit Reporter: Igor Trindade Oliveira <igor.oliveira>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ademar, commit-queue
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 32484    
Attachments:
Description Flags
patch
kling: review-
patch none

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>