Changeset 79534 in webkit


Ignore:
Timestamp:
Feb 24, 2011 2:57:28 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-02-24 Robert Kroeger <rjkroege@chromium.org>

Reviewed by Darin Fisher.

Added timestamps to PlatformTouchEvent etc.

PlatformTouchEvent doesn't have a timestamp and so
eventSender.leapForward cannot be used for touchevent based tests.
This change adds a timestamp to PlatformTouchEvent and initializes
it in a reasonable manner on Android and Qt platforms.

[chromium] [WebCore] [android] Touch events are missing time stamps
https://bugs.webkit.org/show_bug.cgi?id=53510

  • platform/PlatformTouchEvent.h: (WebCore::PlatformTouchEvent::PlatformTouchEvent): (WebCore::PlatformTouchEvent::timestamp):
  • platform/android/PlatformTouchEventAndroid.cpp: (WebCore::PlatformTouchEvent::PlatformTouchEvent):
  • platform/qt/PlatformTouchEventQt.cpp: (WebCore::PlatformTouchEvent::PlatformTouchEvent):

2011-02-24 Robert Kroeger <rjkroege@chromium.org>

Reviewed by Darin Fisher.

Added timestamps to PlatformTouchEvent etc.

PlatformTouchEvent doesn't have a timestamp and so
eventSender.leapForward cannot be used for touchevent based tests.
This change constructs PlatformTouchEvents with timestamps
provided from a WebTouchEvent on chromium. It also adds an enum
to make code referring to specific WebTouchPoints easier to read.

[chromium] [WebCore] [android] Touch events are missing time stamps
https://bugs.webkit.org/show_bug.cgi?id=53510

  • public/WebTouchPoint.h: (WebKit::WebTouchPoint::WebTouchPoint):
  • src/WebInputEventConversion.cpp: (WebKit::PlatformTouchEventBuilder::PlatformTouchEventBuilder):
Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r79530 r79534  
     12011-02-24  Robert Kroeger  <rjkroege@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Added timestamps to PlatformTouchEvent etc.
     6
     7        PlatformTouchEvent doesn't have a timestamp and so
     8        eventSender.leapForward cannot be used for touchevent based tests.
     9        This change adds a timestamp to PlatformTouchEvent and initializes
     10        it in a reasonable manner on Android and Qt platforms.
     11
     12        [chromium] [WebCore] [android] Touch events are missing time stamps
     13        https://bugs.webkit.org/show_bug.cgi?id=53510
     14
     15        * platform/PlatformTouchEvent.h:
     16        (WebCore::PlatformTouchEvent::PlatformTouchEvent):
     17        (WebCore::PlatformTouchEvent::timestamp):
     18        * platform/android/PlatformTouchEventAndroid.cpp:
     19        (WebCore::PlatformTouchEvent::PlatformTouchEvent):
     20        * platform/qt/PlatformTouchEventQt.cpp:
     21        (WebCore::PlatformTouchEvent::PlatformTouchEvent):
     22
    1232011-02-24  Renata Hodovan  <reni@webkit.org>
    224
  • trunk/Source/WebCore/platform/PlatformTouchEvent.h

    r74626 r79534  
    6363        , m_shiftKey(false)
    6464        , m_metaKey(false)
     65        , m_timestamp(0)
    6566    {}
    6667#if PLATFORM(QT)
     
    8283    bool metaKey() const { return m_metaKey; }
    8384
     85    // Time in seconds.
     86    double timestamp() const { return m_timestamp; }
     87
    8488protected:
    8589    TouchEventType m_type;
     
    8993    bool m_shiftKey;
    9094    bool m_metaKey;
     95    double m_timestamp;
    9196};
    9297
  • trunk/Source/WebCore/platform/android/PlatformTouchEventAndroid.cpp

    r69034 r79534  
    2626#include "config.h"
    2727#include "PlatformTouchEvent.h"
     28#include <wtf/CurrentTime.h>
    2829
    2930#if ENABLE(TOUCH_EVENTS)
     
    4142    : m_type(type)
    4243    , m_metaKey(false)
     44    , m_timestamp(WTF::currentTime())
    4345{
    4446    m_touchPoints.reserveCapacity(windowPoints.size());
  • trunk/Source/WebCore/platform/qt/PlatformTouchEventQt.cpp

    r52113 r79534  
    2323#include "config.h"
    2424#include "PlatformTouchEvent.h"
     25#include <wtf/CurrentTime.h>
    2526
    2627#if ENABLE(TOUCH_EVENTS)
     
    4344    m_shiftKey = (event->modifiers() & Qt::ShiftModifier);
    4445    m_metaKey = (event->modifiers() & Qt::MetaModifier);
     46    m_timestamp = WTF::currentTime();
    4547}
    4648
  • trunk/Source/WebKit/chromium/ChangeLog

    r79503 r79534  
     12011-02-24  Robert Kroeger <rjkroege@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Added timestamps to PlatformTouchEvent etc.
     6
     7        PlatformTouchEvent doesn't have a timestamp and so
     8        eventSender.leapForward cannot be used for touchevent based tests.
     9        This change constructs PlatformTouchEvents with timestamps
     10        provided from a WebTouchEvent on chromium. It also adds an enum
     11        to make code referring to specific WebTouchPoints easier to read.
     12
     13        [chromium] [WebCore] [android] Touch events are missing time stamps
     14        https://bugs.webkit.org/show_bug.cgi?id=53510
     15
     16        * public/WebTouchPoint.h:
     17        (WebKit::WebTouchPoint::WebTouchPoint):
     18        * src/WebInputEventConversion.cpp:
     19        (WebKit::PlatformTouchEventBuilder::PlatformTouchEventBuilder):
     20
    1212011-02-23  Adam Barth  <abarth@webkit.org>
    222
  • trunk/Source/WebKit/chromium/public/WebTouchPoint.h

    r55507 r79534  
    3939class WebTouchPoint {
    4040public:
     41    enum Finger {
     42        FingerFirst,
     43        FingerSecond,
     44        FingerThird
     45    };
     46
    4147    WebTouchPoint()
    42         : id(0)
     48        : id(FingerFirst)
    4349        , state(StateUndefined) { }
    4450
  • trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp

    r65747 r79534  
    222222    m_shiftKey = event.modifiers & WebInputEvent::ShiftKey;
    223223    m_metaKey = event.modifiers & WebInputEvent::MetaKey;
     224    m_timestamp = event.timeStampSeconds;
    224225
    225226    for (int i = 0; i < event.touchPointsLength; ++i)
Note: See TracChangeset for help on using the changeset viewer.