Changeset 55146 in webkit


Ignore:
Timestamp:
Feb 23, 2010 5:12:15 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-02-23 Ben Murdoch <benm@google.com>

Reviewed by Eric Seidel.

pageX/Y co-ordinates of TouchEvent should be 0,0
https://bugs.webkit.org/show_bug.cgi?id=35239

Update layout tests to reflect the WebCore changes in this bug.

  • fast/events/touch/basic-multi-touch-events-expected.txt: Updated.
  • fast/events/touch/basic-single-touch-events-expected.txt: Updated.
  • fast/events/touch/script-tests/basic-multi-touch-events.js: (verifyTouchEvent): Add checking of TouchEvent.pageX/Y
  • fast/events/touch/script-tests/basic-single-touch-events.js: (verifyTouchEvent): ditto.

2010-02-23 Ben Murdoch <benm@google.com>

Reviewed by Eric Seidel.

pageX/Y co-ordinates of TouchEvent should be 0,0
https://bugs.webkit.org/show_bug.cgi?id=35239

The co-ordinates attached to a touch event are not used for tracking touch motion, rather the co-ordinates attached to Touches within the touch event should be used. Set the co-ordinates on the event itself to 0 to avoid confusion and match observed iPhone behavior.

  • page/EventHandler.cpp: (WebCore::EventHandler::handleTouchEvent): Set the pageX/Y and screenX/Y co-ordinates attached to the touch event to 0,0 to match observed behavior on the iPhone.
  • page/EventHandler.h: Remove now unused members m_firstTouchScreenPos and m_firstTouchPagePos.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r55144 r55146  
     12010-02-23  Ben Murdoch  <benm@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        pageX/Y co-ordinates of TouchEvent should be 0,0
     6        https://bugs.webkit.org/show_bug.cgi?id=35239
     7
     8        Update layout tests to reflect the WebCore changes in this bug.
     9
     10        * fast/events/touch/basic-multi-touch-events-expected.txt: Updated.
     11        * fast/events/touch/basic-single-touch-events-expected.txt: Updated.
     12        * fast/events/touch/script-tests/basic-multi-touch-events.js:
     13        (verifyTouchEvent): Add checking of TouchEvent.pageX/Y
     14        * fast/events/touch/script-tests/basic-single-touch-events.js:
     15        (verifyTouchEvent): ditto.
     16
    1172010-02-23  Shinichiro Hamaji  <hamaji@chromium.org>
    218
  • trunk/LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt

    r54817 r55146  
    1010PASS lastEvent.changedTouches.length is 2
    1111PASS lastEvent.targetTouches.length is 2
     12PASS lastEvent.pageX is 0
     13PASS lastEvent.pageY is 0
    1214PASS lastEvent.touches[0].pageX is 10
    1315PASS lastEvent.touches[0].pageY is 10
     
    4547PASS lastEvent.changedTouches.length is 1
    4648PASS lastEvent.targetTouches.length is 2
     49PASS lastEvent.pageX is 0
     50PASS lastEvent.pageY is 0
    4751PASS lastEvent.touches[0].pageX is 15
    4852PASS lastEvent.touches[0].pageY is 15
     
    6569PASS lastEvent.changedTouches.length is 1
    6670PASS lastEvent.targetTouches.length is 1
     71PASS lastEvent.pageX is 0
     72PASS lastEvent.pageY is 0
    6773PASS lastEvent.touches[0].pageX is 20
    6874PASS lastEvent.touches[0].pageY is 30
     
    8591PASS lastEvent.changedTouches.length is 1
    8692PASS lastEvent.targetTouches.length is 0
     93PASS lastEvent.pageX is 0
     94PASS lastEvent.pageY is 0
    8795PASS lastEvent.changedTouches[0].pageX is 20
    8896PASS lastEvent.changedTouches[0].pageY is 30
  • trunk/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt

    r54817 r55146  
    88PASS lastEvent.changedTouches.length is 1
    99PASS lastEvent.targetTouches.length is 1
     10PASS lastEvent.pageX is 0
     11PASS lastEvent.pageY is 0
    1012PASS lastEvent.shiftKey is false
    1113PASS lastEvent.touches[0].target.id is "touchtarget"
     
    2931PASS lastEvent.changedTouches.length is 1
    3032PASS lastEvent.targetTouches.length is 1
     33PASS lastEvent.pageX is 0
     34PASS lastEvent.pageY is 0
    3135PASS lastEvent.touches[0].pageX is 20
    3236PASS lastEvent.touches[0].pageY is 15
     
    4246PASS lastEvent.changedTouches.length is 1
    4347PASS lastEvent.targetTouches.length is 0
     48PASS lastEvent.pageX is 0
     49PASS lastEvent.pageY is 0
    4450PASS lastEvent.changedTouches[0].pageX is 20
    4551PASS lastEvent.changedTouches[0].pageY is 15
     
    5359PASS lastEvent.changedTouches.length is 1
    5460PASS lastEvent.targetTouches.length is 1
     61PASS lastEvent.pageX is 0
     62PASS lastEvent.pageY is 0
    5563PASS lastEvent.targetTouches[0].target.tagName is "DIV"
    5664PASS lastEvent.type is "touchmove"
     
    5866PASS lastEvent.changedTouches.length is 1
    5967PASS lastEvent.targetTouches.length is 0
     68PASS lastEvent.pageX is 0
     69PASS lastEvent.pageY is 0
    6070PASS lastEvent.touches[0].target.tagName is "HTML"
    6171PASS successfullyParsed is true
  • trunk/LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events.js

    r54817 r55146  
    3838    shouldBe("lastEvent.changedTouches.length", changedTouchCount.toString());
    3939    shouldBe("lastEvent.targetTouches.length", targetTouchCount.toString());
     40    shouldBe("lastEvent.pageX", "0");
     41    shouldBe("lastEvent.pageY", "0");
    4042}
    4143
  • trunk/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js

    r54817 r55146  
    3838    shouldBe("lastEvent.changedTouches.length", changedTouchCount.toString());
    3939    shouldBe("lastEvent.targetTouches.length", targetTouchCount.toString());
     40    shouldBe("lastEvent.pageX", "0");
     41    shouldBe("lastEvent.pageY", "0");
    4042}
    4143
  • trunk/WebCore/ChangeLog

    r55145 r55146  
     12010-02-23  Ben Murdoch  <benm@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        pageX/Y co-ordinates of TouchEvent should be 0,0
     6        https://bugs.webkit.org/show_bug.cgi?id=35239
     7
     8        The co-ordinates attached to a touch event are not used for tracking touch motion, rather the co-ordinates attached to Touches within the touch event should be used. Set the co-ordinates on the event itself to 0 to avoid confusion and match observed iPhone behavior.
     9
     10        * page/EventHandler.cpp:
     11        (WebCore::EventHandler::handleTouchEvent): Set the pageX/Y and screenX/Y co-ordinates attached to the touch event to 0,0 to match observed behavior on the iPhone.
     12        * page/EventHandler.h: Remove now unused members m_firstTouchScreenPos and m_firstTouchPagePos.
     13
    1142010-02-23  Stephan Aßmus  <superstippi@gmx.de>
    215
  • trunk/WebCore/page/EventHandler.cpp

    r55090 r55146  
    25902590        if (event.type() == TouchStart && !i) {
    25912591            m_touchEventTarget = target;
    2592             m_firstTouchScreenPos = point.screenPos();
    2593             m_firstTouchPagePos = pagePoint;
    25942592        }
    25952593
     
    26212619            TouchEvent::create(TouchList::create().get(), TouchList::create().get(), cancelTouches.get(),
    26222620                                                   *eventName, m_touchEventTarget->document()->defaultView(),
    2623                                                    m_firstTouchScreenPos.x(), m_firstTouchScreenPos.y(),
    2624                                                    m_firstTouchPagePos.x(), m_firstTouchPagePos.y(),
    2625                                                    event.ctrlKey(), event.altKey(), event.shiftKey(),
     2621                                                   0, 0, 0, 0, event.ctrlKey(), event.altKey(), event.shiftKey(),
    26262622                                                   event.metaKey());
    26272623
     
    26362632            TouchEvent::create(touches.get(), targetTouches.get(), releasedTouches.get(),
    26372633                                                   *eventName, m_touchEventTarget->document()->defaultView(),
    2638                                                    m_firstTouchScreenPos.x(), m_firstTouchScreenPos.y(),
    2639                                                    m_firstTouchPagePos.x(), m_firstTouchPagePos.y(),
    2640                                                    event.ctrlKey(), event.altKey(), event.shiftKey(),
     2634                                                   0, 0, 0, 0, event.ctrlKey(), event.altKey(), event.shiftKey(),
    26412635                                                   event.metaKey());
    26422636        ExceptionCode ec = 0;
     
    26562650            TouchEvent::create(touches.get(), targetTouches.get(), pressedTouches.get(),
    26572651                                                   *eventName, m_touchEventTarget->document()->defaultView(),
    2658                                                    m_firstTouchScreenPos.x(), m_firstTouchScreenPos.y(),
    2659                                                    m_firstTouchPagePos.x(), m_firstTouchPagePos.y(),
    2660                                                    event.ctrlKey(), event.altKey(), event.shiftKey(),
     2652                                                   0, 0, 0, 0, event.ctrlKey(), event.altKey(), event.shiftKey(),
    26612653                                                   event.metaKey());
    26622654        ExceptionCode ec = 0;
     
    26692661            TouchEvent::create(touches.get(), targetTouches.get(), movedTouches.get(),
    26702662                                                   *eventName, m_touchEventTarget->document()->defaultView(),
    2671                                                    m_firstTouchScreenPos.x(), m_firstTouchScreenPos.y(),
    2672                                                    m_firstTouchPagePos.x(), m_firstTouchPagePos.y(),
    2673                                                    event.ctrlKey(), event.altKey(), event.shiftKey(),
     2663                                                   0, 0, 0, 0, event.ctrlKey(), event.altKey(), event.shiftKey(),
    26742664                                                   event.metaKey());
    26752665        ExceptionCode ec = 0;
  • trunk/WebCore/page/EventHandler.h

    r54156 r55146  
    410410#if ENABLE(TOUCH_EVENTS)
    411411    RefPtr<Node> m_touchEventTarget;
    412     IntPoint m_firstTouchScreenPos;
    413     IntPoint m_firstTouchPagePos;
    414412#endif
    415413};
Note: See TracChangeset for help on using the changeset viewer.