Changeset 89212 in webkit


Ignore:
Timestamp:
Jun 18, 2011 9:13:49 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-18 Yufeng Shen <miletus@chromium.org>

Reviewed by Darin Fisher.

Adding "force" filed to Touch Event
https://bugs.webkit.org/show_bug.cgi?id=62766

  • fast/events/touch/document-create-touch-expected.txt:
  • fast/events/touch/script-tests/document-create-touch.js:

2011-06-18 Yufeng Shen <miletus@chromium.org>

Reviewed by Darin Fisher.

Adding "force" filed to Touch Event
https://bugs.webkit.org/show_bug.cgi?id=62766

  • dom/Document.cpp: (WebCore::Document::createTouch):
  • dom/Document.h:
  • dom/Document.idl:
  • dom/Touch.cpp: (WebCore::Touch::Touch):
  • dom/Touch.h: (WebCore::Touch::create): (WebCore::Touch::webkitForce):
  • dom/Touch.idl:
  • page/EventHandler.cpp: (WebCore::EventHandler::handleTouchEvent):
  • platform/PlatformTouchPoint.h: (WebCore::PlatformTouchPoint::force):

2011-06-18 Yufeng Shen <miletus@chromium.org>

Reviewed by Darin Fisher.

Adding "force" filed to Touch Event
https://bugs.webkit.org/show_bug.cgi?id=62766

  • public/WebTouchPoint.h: (WebKit::WebTouchPoint::WebTouchPoint):
  • src/WebInputEventConversion.cpp: (WebKit::PlatformTouchPointBuilder::PlatformTouchPointBuilder):
Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r89204 r89212  
     12011-06-18  Yufeng Shen  <miletus@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Adding "force" filed to Touch Event
     6        https://bugs.webkit.org/show_bug.cgi?id=62766
     7
     8        * fast/events/touch/document-create-touch-expected.txt:
     9        * fast/events/touch/script-tests/document-create-touch.js:
     10
    1112011-06-18  Alice Boxhall  <aboxhall@chromium.org>
    212
  • trunk/LayoutTests/fast/events/touch/document-create-touch-expected.txt

    r86700 r89212  
    1515PASS touch.webkitRadiusY is 3
    1616PASS touch.webkitRotationAngle is 10
     17PASS touch.webkitForce is 10
    1718PASS emptyTouch is non-null.
    1819PASS emptyTouch.target is null
     
    2526PASS emptyTouch.webkitRadiusY is 0
    2627PASS emptyTouch.webkitRotationAngle is NaN
     28PASS emptyTouch.webkitForce is NaN
    2729PASS badParamsTouch is non-null.
    2830PASS badParamsTouch.target is null
     
    3537PASS badParamsTouch.webkitRadiusY is 0
    3638PASS badParamsTouch.webkitRotationAngle is NaN
     39PASS badParamsTouch.webkitForce is NaN
    3740PASS successfullyParsed is true
    3841
  • trunk/LayoutTests/fast/events/touch/script-tests/document-create-touch.js

    r86700 r89212  
    1010
    1111var target = document.getElementById("box");
    12 var touch = document.createTouch(window, target, 1, 100, 101, 102, 103, 5, 3, 10);
     12var touch = document.createTouch(window, target, 1, 100, 101, 102, 103, 5, 3, 10, 10);
    1313shouldBeNonNull("touch");
    1414shouldBe("touch.target", "box");
     
    2121shouldBe("touch.webkitRadiusY", "3");
    2222shouldBe("touch.webkitRotationAngle", "10");
     23shouldBe("touch.webkitForce", "10");
    2324
    2425var emptyTouch = document.createTouch();
     
    3334shouldBe("emptyTouch.webkitRadiusY", "0");
    3435shouldBeNaN("emptyTouch.webkitRotationAngle");
     36shouldBeNaN("emptyTouch.webkitForce");
    3537
    3638// Try invoking with incorrect parameter types.
    37 var badParamsTouch = document.createTouch(function(x) { return x; }, 12, 'a', 'b', 'c', function(x) { return x; }, 104, 'a', 'b', 'c');
     39var badParamsTouch = document.createTouch(function(x) { return x; }, 12, 'a', 'b', 'c', function(x) { return x; }, 104, 'a', 'b', 'c', 'd');
    3840shouldBeNonNull("badParamsTouch");
    3941shouldBeNull("badParamsTouch.target");
     
    4648shouldBe("badParamsTouch.webkitRadiusY", "0");
    4749shouldBeNaN("badParamsTouch.webkitRotationAngle");
     50shouldBeNaN("badParamsTouch.webkitForce");
    4851
    4952successfullyParsed = true;
  • trunk/Source/WebCore/ChangeLog

    r89205 r89212  
     12011-06-18  Yufeng Shen  <miletus@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Adding "force" filed to Touch Event
     6        https://bugs.webkit.org/show_bug.cgi?id=62766
     7
     8        * dom/Document.cpp:
     9        (WebCore::Document::createTouch):
     10        * dom/Document.h:
     11        * dom/Document.idl:
     12        * dom/Touch.cpp:
     13        (WebCore::Touch::Touch):
     14        * dom/Touch.h:
     15        (WebCore::Touch::create):
     16        (WebCore::Touch::webkitForce):
     17        * dom/Touch.idl:
     18        * page/EventHandler.cpp:
     19        (WebCore::EventHandler::handleTouchEvent):
     20        * platform/PlatformTouchPoint.h:
     21        (WebCore::PlatformTouchPoint::force):
     22
    1232011-06-18  Jer Noble  <jer.noble@apple.com>
    224
  • trunk/Source/WebCore/dom/Document.cpp

    r89205 r89212  
    49874987
    49884988#if ENABLE(TOUCH_EVENTS)
    4989 PassRefPtr<Touch> Document::createTouch(DOMWindow* window, EventTarget* target, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, ExceptionCode&) const
     4989PassRefPtr<Touch> Document::createTouch(DOMWindow* window, EventTarget* target, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, float force, ExceptionCode&) const
    49904990{
    49914991    // FIXME: It's not clear from the documentation at
     
    49954995    // Ditto for the createTouchList method below.
    49964996    Frame* frame = window ? window->frame() : this->frame();
    4997     return Touch::create(frame, target, identifier, screenX, screenY, pageX, pageY, radiusX, radiusY, rotationAngle);
     4997    return Touch::create(frame, target, identifier, screenX, screenY, pageX, pageY, radiusX, radiusY, rotationAngle, force);
    49984998}
    49994999
  • trunk/Source/WebCore/dom/Document.h

    r89205 r89212  
    10651065
    10661066#if ENABLE(TOUCH_EVENTS)
    1067     PassRefPtr<Touch> createTouch(DOMWindow*, EventTarget*, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, ExceptionCode&) const;
     1067    PassRefPtr<Touch> createTouch(DOMWindow*, EventTarget*, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, float force, ExceptionCode&) const;
    10681068    PassRefPtr<TouchList> createTouchList(ExceptionCode&) const;
    10691069#endif
  • trunk/Source/WebCore/dom/Document.idl

    r89148 r89212  
    328328                                                         in long webkitRadiusX,
    329329                                                         in long webkitRadiusY,
    330                                                          in float webkitRotationAngle)
     330                                                         in float webkitRotationAngle,
     331                                                         in float webkitForce)
    331332            raises (DOMException);
    332333        [ReturnsNew, EnabledAtRuntime, Custom] TouchList createTouchList()
  • trunk/Source/WebCore/dom/Touch.cpp

    r86700 r89212  
    5555}
    5656
    57 Touch::Touch(Frame* frame, EventTarget* target, unsigned identifier, int screenX, int screenY, int pageX, int pageY, int radiusX, int radiusY, float rotationAngle)
     57Touch::Touch(Frame* frame, EventTarget* target, unsigned identifier, int screenX, int screenY, int pageX, int pageY, int radiusX, int radiusY, float rotationAngle, float force)
    5858    : m_target(target)
    5959    , m_identifier(identifier)
     
    6767    , m_radiusY(radiusY)
    6868    , m_rotationAngle(rotationAngle)
     69    , m_force(force)
    6970{
    7071}
  • trunk/Source/WebCore/dom/Touch.h

    r86700 r89212  
    4242    static PassRefPtr<Touch> create(Frame* frame, EventTarget* target,
    4343            unsigned identifier, int screenX, int screenY, int pageX, int pageY,
    44             int radiusX, int radiusY, float rotationAngle)
     44            int radiusX, int radiusY, float rotationAngle, float force)
    4545    {
    4646        return adoptRef(new Touch(frame, target, identifier, screenX,
    47                 screenY, pageX, pageY, radiusX, radiusY, rotationAngle));
     47                screenY, pageX, pageY, radiusX, radiusY, rotationAngle, force));
    4848    }
    4949
     
    5959    int webkitRadiusY() const { return m_radiusY; }
    6060    float webkitRotationAngle() const { return m_rotationAngle; }
     61    float webkitForce() const { return m_force; }
    6162
    6263private:
    6364    Touch(Frame* frame, EventTarget* target, unsigned identifier,
    6465            int screenX, int screenY, int pageX, int pageY,
    65             int radiusX, int radiusY, float rotationAngle);
     66            int radiusX, int radiusY, float rotationAngle, float force);
    6667
    6768    RefPtr<EventTarget> m_target;
     
    7677    int m_radiusY;
    7778    float m_rotationAngle;
     79    float m_force;
    7880};
    7981
  • trunk/Source/WebCore/dom/Touch.idl

    r89190 r89212  
    4141        readonly attribute int              webkitRadiusY;
    4242        readonly attribute float            webkitRotationAngle;
     43        readonly attribute float            webkitForce;
    4344    };
    4445}
  • trunk/Source/WebCore/page/EventHandler.cpp

    r88307 r89212  
    32283228                                            point.screenPos().x(), point.screenPos().y(),
    32293229                                            adjustedPageX, adjustedPageY,
    3230                                             point.radiusX(), point.radiusY(), point.rotationAngle());
     3230                                            point.radiusX(), point.radiusY(), point.rotationAngle(), point.force());
    32313231
    32323232        // Ensure this target's touch list exists, even if it ends up empty, so it can always be passed to TouchEvent::Create below.
  • trunk/Source/WebCore/platform/PlatformTouchPoint.h

    r86700 r89212  
    6363    int radiusY() const { return m_radiusY; }
    6464    float rotationAngle() const { return m_rotationAngle; }
     65    float force() const { return m_force; }
    6566
    6667protected:
     
    7273    int m_radiusX;
    7374    float m_rotationAngle;
     75    float m_force;
    7476};
    7577
  • trunk/Source/WebKit/chromium/ChangeLog

    r89188 r89212  
     12011-06-18  Yufeng Shen  <miletus@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Adding "force" filed to Touch Event
     6        https://bugs.webkit.org/show_bug.cgi?id=62766
     7
     8        * public/WebTouchPoint.h:
     9        (WebKit::WebTouchPoint::WebTouchPoint):
     10        * src/WebInputEventConversion.cpp:
     11        (WebKit::PlatformTouchPointBuilder::PlatformTouchPointBuilder):
     12
    1132011-06-17  Chris Rogers  <crogers@google.com>
    214
  • trunk/Source/WebKit/chromium/public/WebTouchPoint.h

    r86700 r89212  
    5151        , radiusY(0)
    5252        , rotationAngle(0)
     53        , force(0)
    5354    {
    5455    }
     
    7172    int radiusY;
    7273    float rotationAngle;
     74    float force;
    7375};
    7476
  • trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp

    r86700 r89212  
    216216    m_radiusX = point.radiusX;
    217217    m_rotationAngle = point.rotationAngle;
     218    m_force = point.force;
    218219}
    219220
Note: See TracChangeset for help on using the changeset viewer.