Diff
Modified: trunk/LayoutTests/ChangeLog (86699 => 86700)
--- trunk/LayoutTests/ChangeLog 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/LayoutTests/ChangeLog 2011-05-17 20:04:41 UTC (rev 86700)
@@ -1,3 +1,13 @@
+2011-05-17 Yufeng Shen <[email protected]>
+
+ Reviewed by Darin Fisher.
+
+ Make WebKit expose extra touch information
+ https://bugs.webkit.org/show_bug.cgi?id=59030
+
+ * fast/events/touch/document-create-touch-expected.txt:
+ * fast/events/touch/script-tests/document-create-touch.js:
+
2011-05-17 Andreas Kling <[email protected]>
Reviewed by Kenneth Rohde Christiansen.
Modified: trunk/LayoutTests/fast/events/touch/document-create-touch-expected.txt (86699 => 86700)
--- trunk/LayoutTests/fast/events/touch/document-create-touch-expected.txt 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/LayoutTests/fast/events/touch/document-create-touch-expected.txt 2011-05-17 20:04:41 UTC (rev 86700)
@@ -11,6 +11,9 @@
PASS touch.pageY is 101
PASS touch.screenX is 102
PASS touch.screenY is 103
+PASS touch.webkitRadiusX is 5
+PASS touch.webkitRadiusY is 3
+PASS touch.webkitRotationAngle is 10
PASS emptyTouch is non-null.
PASS emptyTouch.target is null
PASS emptyTouch.identifier is 0
@@ -18,6 +21,9 @@
PASS emptyTouch.pageY is 0
PASS emptyTouch.screenX is 0
PASS emptyTouch.screenY is 0
+PASS emptyTouch.webkitRadiusX is 0
+PASS emptyTouch.webkitRadiusY is 0
+PASS emptyTouch.webkitRotationAngle is NaN
PASS badParamsTouch is non-null.
PASS badParamsTouch.target is null
PASS badParamsTouch.identifier is 0
@@ -25,6 +31,9 @@
PASS badParamsTouch.pageY is 0
PASS badParamsTouch.screenX is 0
PASS badParamsTouch.screenY is 104
+PASS badParamsTouch.webkitRadiusX is 0
+PASS badParamsTouch.webkitRadiusY is 0
+PASS badParamsTouch.webkitRotationAngle is NaN
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/fast/events/touch/script-tests/document-create-touch.js (86699 => 86700)
--- trunk/LayoutTests/fast/events/touch/script-tests/document-create-touch.js 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/LayoutTests/fast/events/touch/script-tests/document-create-touch.js 2011-05-17 20:04:41 UTC (rev 86700)
@@ -9,7 +9,7 @@
document.body.appendChild(box);
var target = document.getElementById("box");
-var touch = document.createTouch(window, target, 1, 100, 101, 102, 103);
+var touch = document.createTouch(window, target, 1, 100, 101, 102, 103, 5, 3, 10);
shouldBeNonNull("touch");
shouldBe("touch.target", "box");
shouldBe("touch.identifier", "1");
@@ -17,6 +17,9 @@
shouldBe("touch.pageY", "101");
shouldBe("touch.screenX", "102");
shouldBe("touch.screenY", "103");
+shouldBe("touch.webkitRadiusX", "5");
+shouldBe("touch.webkitRadiusY", "3");
+shouldBe("touch.webkitRotationAngle", "10");
var emptyTouch = document.createTouch();
shouldBeNonNull("emptyTouch");
@@ -26,9 +29,12 @@
shouldBe("emptyTouch.pageY", "0");
shouldBe("emptyTouch.screenX", "0");
shouldBe("emptyTouch.screenY", "0");
+shouldBe("emptyTouch.webkitRadiusX", "0");
+shouldBe("emptyTouch.webkitRadiusY", "0");
+shouldBeNaN("emptyTouch.webkitRotationAngle");
// Try invoking with incorrect parameter types.
-var badParamsTouch = document.createTouch(function(x) { return x; }, 12, 'a', 'b', 'c', function(x) { return x; }, 104);
+var badParamsTouch = document.createTouch(function(x) { return x; }, 12, 'a', 'b', 'c', function(x) { return x; }, 104, 'a', 'b', 'c');
shouldBeNonNull("badParamsTouch");
shouldBeNull("badParamsTouch.target");
shouldBe("badParamsTouch.identifier", "0");
@@ -36,6 +42,9 @@
shouldBe("badParamsTouch.pageY", "0");
shouldBe("badParamsTouch.screenX", "0");
shouldBe("badParamsTouch.screenY", "104");
+shouldBe("badParamsTouch.webkitRadiusX", "0");
+shouldBe("badParamsTouch.webkitRadiusY", "0");
+shouldBeNaN("badParamsTouch.webkitRotationAngle");
successfullyParsed = true;
isSuccessfullyParsed();
Modified: trunk/Source/WebCore/ChangeLog (86699 => 86700)
--- trunk/Source/WebCore/ChangeLog 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/Source/WebCore/ChangeLog 2011-05-17 20:04:41 UTC (rev 86700)
@@ -1,3 +1,29 @@
+2011-05-17 Yufeng Shen <[email protected]>
+
+ Reviewed by Darin Fisher.
+
+ Make WebKit expose extra touch information
+ https://bugs.webkit.org/show_bug.cgi?id=59030
+
+ * 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::webkitRadiusX):
+ (WebCore::Touch::webkitRadiusY):
+ (WebCore::Touch::webkitRotationAngle):
+ * dom/Touch.idl:
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleTouchEvent):
+ * platform/PlatformTouchPoint.h:
+ (WebCore::PlatformTouchPoint::radiusX):
+ (WebCore::PlatformTouchPoint::radiusY):
+ (WebCore::PlatformTouchPoint::rotationAngle):
+
2011-05-17 Eric Seidel <[email protected]>
Reviewed by Ryosuke Niwa.
Modified: trunk/Source/WebCore/dom/Document.cpp (86699 => 86700)
--- trunk/Source/WebCore/dom/Document.cpp 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/Source/WebCore/dom/Document.cpp 2011-05-17 20:04:41 UTC (rev 86700)
@@ -5065,7 +5065,7 @@
#endif
#if ENABLE(TOUCH_EVENTS)
-PassRefPtr<Touch> Document::createTouch(DOMWindow* window, EventTarget* target, int identifier, int pageX, int pageY, int screenX, int screenY, ExceptionCode&) const
+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
{
// FIXME: It's not clear from the documentation at
// http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html
@@ -5073,7 +5073,7 @@
// and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=47819
// Ditto for the createTouchList method below.
Frame* frame = window ? window->frame() : this->frame();
- return Touch::create(frame, target, identifier, screenX, screenY, pageX, pageY);
+ return Touch::create(frame, target, identifier, screenX, screenY, pageX, pageY, radiusX, radiusY, rotationAngle);
}
PassRefPtr<TouchList> Document::createTouchList(ExceptionCode&) const
Modified: trunk/Source/WebCore/dom/Document.h (86699 => 86700)
--- trunk/Source/WebCore/dom/Document.h 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/Source/WebCore/dom/Document.h 2011-05-17 20:04:41 UTC (rev 86700)
@@ -1081,7 +1081,7 @@
bool isDelayingLoadEvent() const { return m_loadEventDelayCount; }
#if ENABLE(TOUCH_EVENTS)
- PassRefPtr<Touch> createTouch(DOMWindow*, EventTarget*, int identifier, int pageX, int pageY, int screenX, int screenY, ExceptionCode&) const;
+ PassRefPtr<Touch> createTouch(DOMWindow*, EventTarget*, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, ExceptionCode&) const;
PassRefPtr<TouchList> createTouchList(ExceptionCode&) const;
#endif
Modified: trunk/Source/WebCore/dom/Document.idl (86699 => 86700)
--- trunk/Source/WebCore/dom/Document.idl 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/Source/WebCore/dom/Document.idl 2011-05-17 20:04:41 UTC (rev 86700)
@@ -322,8 +322,11 @@
in long identifier,
in long pageX,
in long pageY,
- in long ScreenX,
- in long screenY)
+ in long screenX,
+ in long screenY,
+ in long webkitRadiusX,
+ in long webkitRadiusY,
+ in float webkitRotationAngle)
raises (DOMException);
[ReturnsNew, EnabledAtRuntime, Custom] TouchList createTouchList()
raises (DOMException);
Modified: trunk/Source/WebCore/dom/Touch.cpp (86699 => 86700)
--- trunk/Source/WebCore/dom/Touch.cpp 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/Source/WebCore/dom/Touch.cpp 2011-05-17 20:04:41 UTC (rev 86700)
@@ -54,7 +54,7 @@
return frameView->scrollY() / frame->pageZoomFactor();
}
-Touch::Touch(Frame* frame, EventTarget* target, unsigned identifier, int screenX, int screenY, int pageX, int pageY)
+Touch::Touch(Frame* frame, EventTarget* target, unsigned identifier, int screenX, int screenY, int pageX, int pageY, int radiusX, int radiusY, float rotationAngle)
: m_target(target)
, m_identifier(identifier)
, m_clientX(pageX - contentsX(frame))
@@ -63,6 +63,9 @@
, m_screenY(screenY)
, m_pageX(pageX)
, m_pageY(pageY)
+ , m_radiusX(radiusX)
+ , m_radiusY(radiusY)
+ , m_rotationAngle(rotationAngle)
{
}
Modified: trunk/Source/WebCore/dom/Touch.h (86699 => 86700)
--- trunk/Source/WebCore/dom/Touch.h 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/Source/WebCore/dom/Touch.h 2011-05-17 20:04:41 UTC (rev 86700)
@@ -40,10 +40,11 @@
class Touch : public RefCounted<Touch> {
public:
static PassRefPtr<Touch> create(Frame* frame, EventTarget* target,
- unsigned identifier, int screenX, int screenY, int pageX, int pageY)
+ unsigned identifier, int screenX, int screenY, int pageX, int pageY,
+ int radiusX, int radiusY, float rotationAngle)
{
return adoptRef(new Touch(frame, target, identifier, screenX,
- screenY, pageX, pageY));
+ screenY, pageX, pageY, radiusX, radiusY, rotationAngle));
}
EventTarget* target() const { return m_target.get(); }
@@ -54,10 +55,14 @@
int screenY() const { return m_screenY; }
int pageX() const { return m_pageX; }
int pageY() const { return m_pageY; }
+ int webkitRadiusX() const { return m_radiusX; }
+ int webkitRadiusY() const { return m_radiusY; }
+ float webkitRotationAngle() const { return m_rotationAngle; }
private:
Touch(Frame* frame, EventTarget* target, unsigned identifier,
- int screenX, int screenY, int pageX, int pageY);
+ int screenX, int screenY, int pageX, int pageY,
+ int radiusX, int radiusY, float rotationAngle);
RefPtr<EventTarget> m_target;
unsigned m_identifier;
@@ -67,6 +72,9 @@
int m_screenY;
int m_pageX;
int m_pageY;
+ int m_radiusX;
+ int m_radiusY;
+ float m_rotationAngle;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/dom/Touch.idl (86699 => 86700)
--- trunk/Source/WebCore/dom/Touch.idl 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/Source/WebCore/dom/Touch.idl 2011-05-17 20:04:41 UTC (rev 86700)
@@ -36,5 +36,8 @@
readonly attribute long pageY;
readonly attribute EventTarget target;
readonly attribute unsigned long identifier;
+ readonly attribute int webkitRadiusX;
+ readonly attribute int webkitRadiusY;
+ readonly attribute float webkitRotationAngle;
};
}
Modified: trunk/Source/WebCore/page/EventHandler.cpp (86699 => 86700)
--- trunk/Source/WebCore/page/EventHandler.cpp 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2011-05-17 20:04:41 UTC (rev 86700)
@@ -3159,7 +3159,8 @@
RefPtr<Touch> touch = Touch::create(doc->frame(), touchTarget.get(), point.id(),
point.screenPos().x(), point.screenPos().y(),
- adjustedPageX, adjustedPageY);
+ adjustedPageX, adjustedPageY,
+ point.radiusX(), point.radiusY(), point.rotationAngle());
// Ensure this target's touch list exists, even if it ends up empty, so it can always be passed to TouchEvent::Create below.
TargetTouchesMap::iterator targetTouchesIterator = touchesByTarget.find(touchTarget.get());
Modified: trunk/Source/WebCore/platform/PlatformTouchPoint.h (86699 => 86700)
--- trunk/Source/WebCore/platform/PlatformTouchPoint.h 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/Source/WebCore/platform/PlatformTouchPoint.h 2011-05-17 20:04:41 UTC (rev 86700)
@@ -59,12 +59,18 @@
State state() const { return m_state; }
IntPoint screenPos() const { return m_screenPos; }
IntPoint pos() const { return m_pos; }
-
+ int radiusX() const { return m_radiusX; }
+ int radiusY() const { return m_radiusY; }
+ float rotationAngle() const { return m_rotationAngle; }
+
protected:
unsigned m_id;
State m_state;
IntPoint m_screenPos;
IntPoint m_pos;
+ int m_radiusY;
+ int m_radiusX;
+ float m_rotationAngle;
};
}
Modified: trunk/Source/WebKit/chromium/ChangeLog (86699 => 86700)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-05-17 20:04:41 UTC (rev 86700)
@@ -1,3 +1,15 @@
+2011-05-17 Yufeng Shen <[email protected]>
+
+ Reviewed by Darin Fisher.
+
+ Make WebKit expose extra touch information
+ https://bugs.webkit.org/show_bug.cgi?id=59030
+
+ * public/WebTouchPoint.h:
+ (WebKit::WebTouchPoint::WebTouchPoint):
+ * src/WebInputEventConversion.cpp:
+ (WebKit::PlatformTouchPointBuilder::PlatformTouchPointBuilder):
+
2011-05-16 James Robinson <[email protected]>
Reviewed by Kenneth Russell.
@@ -1476,6 +1488,7 @@
* src/gtk/WebInputEventFactory.cpp: set click count for mouse up events.
* tests/WebInputEventFactoryTestGtk.cpp: added test case MouseUpClickCount.
+
2011-04-20 Evan Martin <[email protected]>
Reviewed by Tony Chang.
Modified: trunk/Source/WebKit/chromium/public/WebTouchPoint.h (86699 => 86700)
--- trunk/Source/WebKit/chromium/public/WebTouchPoint.h 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/Source/WebKit/chromium/public/WebTouchPoint.h 2011-05-17 20:04:41 UTC (rev 86700)
@@ -46,7 +46,12 @@
WebTouchPoint()
: id(FingerFirst)
- , state(StateUndefined) { }
+ , state(StateUndefined)
+ , radiusX(0)
+ , radiusY(0)
+ , rotationAngle(0)
+ {
+ }
enum State {
StateUndefined,
@@ -61,6 +66,10 @@
State state;
WebPoint screenPosition;
WebPoint position;
+
+ int radiusX;
+ int radiusY;
+ float rotationAngle;
};
} // namespace WebKit
Modified: trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp (86699 => 86700)
--- trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp 2011-05-17 20:02:41 UTC (rev 86699)
+++ trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp 2011-05-17 20:04:41 UTC (rev 86700)
@@ -212,6 +212,9 @@
m_state = toPlatformTouchPointState(point.state);
m_pos = widget->convertFromContainingWindow(point.position);
m_screenPos = point.screenPosition;
+ m_radiusY = point.radiusY;
+ m_radiusX = point.radiusX;
+ m_rotationAngle = point.rotationAngle;
}
PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTouchEvent& event)