Title: [206651] trunk
Revision
206651
Author
cdu...@apple.com
Date
2016-09-30 12:19:44 -0700 (Fri, 30 Sep 2016)

Log Message

[WK2][iOS] Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint
https://bugs.webkit.org/show_bug.cgi?id=162787
<rdar://problem/28554292>

Reviewed by Benjamin Poulain.

Source/WebKit2:

Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint.

* Platform/spi/ios/UIKitSPI.h:
* Shared/WebEvent.h:
(WebKit::WebPlatformTouchPoint::setRadiusX):
(WebKit::WebPlatformTouchPoint::radiusX):
(WebKit::WebPlatformTouchPoint::setRadiusY):
(WebKit::WebPlatformTouchPoint::radiusY):
(WebKit::WebPlatformTouchPoint::setRotationAngle):
(WebKit::WebPlatformTouchPoint::rotationAngle):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint):
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::extractWebTouchPoint):
* Shared/ios/WebPlatformTouchPointIOS.cpp:
(WebKit::WebPlatformTouchPoint::encode):
(WebKit::WebPlatformTouchPoint::decode):

LayoutTests:

Extend Touch constructor test coverage to cover radiusX / radiusY / rotationAngle
attributes.

* fast/events/touch/touch-constructor.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (206650 => 206651)


--- trunk/LayoutTests/ChangeLog	2016-09-30 18:50:49 UTC (rev 206650)
+++ trunk/LayoutTests/ChangeLog	2016-09-30 19:19:44 UTC (rev 206651)
@@ -1,3 +1,16 @@
+2016-09-30  Chris Dumez  <cdu...@apple.com>
+
+        [WK2][iOS] Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint
+        https://bugs.webkit.org/show_bug.cgi?id=162787
+        <rdar://problem/28554292>
+
+        Reviewed by Benjamin Poulain.
+
+        Extend Touch constructor test coverage to cover radiusX / radiusY / rotationAngle
+        attributes.
+
+        * fast/events/touch/touch-constructor.html:
+
 2016-09-30  Saam Barati  <sbar...@apple.com>
 
         Arrow functions should not allow duplicate parameter names

Modified: trunk/LayoutTests/fast/events/touch/touch-constructor.html (206650 => 206651)


--- trunk/LayoutTests/fast/events/touch/touch-constructor.html	2016-09-30 18:50:49 UTC (rev 206650)
+++ trunk/LayoutTests/fast/events/touch/touch-constructor.html	2016-09-30 19:19:44 UTC (rev 206651)
@@ -25,14 +25,6 @@
         shouldBe("createdTouch.screenX", "init.screenX");
     else
         shouldBe("createdTouch.screenX", "0");
-    if (init.hasOwnProperty("screenX"))
-        shouldBe("createdTouch.screenX", "init.screenX");
-    else
-        shouldBe("createdTouch.screenX", "0");
-    if (init.hasOwnProperty("screenX"))
-        shouldBe("createdTouch.screenX", "init.screenX");
-    else
-        shouldBe("createdTouch.screenX", "0");
     if (init.hasOwnProperty("screenY"))
         shouldBe("createdTouch.screenY", "init.screenY");
     else
@@ -53,6 +45,18 @@
         shouldBe("createdTouch.clientY", "init.clientY");
     else
         shouldBe("createdTouch.clientY", "0");
+    if (init.hasOwnProperty("radiusX"))
+        shouldBe("createdTouch.radiusX", "init.radiusX");
+    else
+        shouldBe("createdTouch.radiusX", "0");
+    if (init.hasOwnProperty("radiusY"))
+        shouldBe("createdTouch.radiusY", "init.radiusY");
+    else
+        shouldBe("createdTouch.radiusY", "0");
+    if (init.hasOwnProperty("rotationAngle"))
+        shouldBe("createdTouch.rotationAngle", "init.rotationAngle");
+    else
+        shouldBe("createdTouch.rotationAngle", "0");
     if (init.hasOwnProperty("force"))
         shouldBe("createdTouch.force", "init.force");
     else
@@ -64,12 +68,12 @@
 validateTouch(touch, { identifier: 1, target: document.body });
 
 debug("");
-shouldNotThrow("touch = new Touch({ identifier: 1, target: document.body, clientX: 1, clientY: 2, screenX: 3, screenY: 4, pageX: 5, pageY: 6, force: 7 })");
-validateTouch(touch, { identifier: 1, target: document.body, clientX: 1, clientY: 2, screenX: 3, screenY: 4, pageX: 5, pageY: 6, force: 7 });
+shouldNotThrow("touch = new Touch({ identifier: 1, target: document.body, clientX: 1, clientY: 2, screenX: 3, screenY: 4, pageX: 5, pageY: 6, force: 7, radiusX: 8, radiusY: 9, rotationAngle: 10 })");
+validateTouch(touch, { identifier: 1, target: document.body, clientX: 1, clientY: 2, screenX: 3, screenY: 4, pageX: 5, pageY: 6, force: 7, radiusX: 8, radiusY: 9, rotationAngle: 10 });
 
 debug("");
-shouldNotThrow("touch = new Touch({ identifier: 1, target: document.body, clientX: 1.5, clientY: 2.5, screenX: 3.5, screenY: 4.5, pageX: 5.5, pageY: 6.5, force: 7.5, clientX: 8.5, clientY: 9.5 })");
-validateTouch(touch, { identifier: 1, target: document.body, clientX: 1.5, clientY: 2.5, screenX: 3.5, screenY: 4.5, pageX: 5.5, pageY: 6.5, force: 7.5, clientX: 8.5, clientY: 9.5 });
+shouldNotThrow("touch = new Touch({ identifier: 1, target: document.body, clientX: 1.5, clientY: 2.5, screenX: 3.5, screenY: 4.5, pageX: 5.5, pageY: 6.5, force: 7.5, radiusX: 8.5, radiusY: 9.5, rotationAngle: 10.5 })");
+validateTouch(touch, { identifier: 1, target: document.body, clientX: 1.5, clientY: 2.5, screenX: 3.5, screenY: 4.5, pageX: 5.5, pageY: 6.5, force: 7.5, radiusX: 8.5, radiusY: 9.5, rotationAngle: 10.5 });
 </script>
 <script src=""
 </body>

Modified: trunk/Source/WebKit2/ChangeLog (206650 => 206651)


--- trunk/Source/WebKit2/ChangeLog	2016-09-30 18:50:49 UTC (rev 206650)
+++ trunk/Source/WebKit2/ChangeLog	2016-09-30 19:19:44 UTC (rev 206651)
@@ -1,3 +1,29 @@
+2016-09-30  Chris Dumez  <cdu...@apple.com>
+
+        [WK2][iOS] Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint
+        https://bugs.webkit.org/show_bug.cgi?id=162787
+        <rdar://problem/28554292>
+
+        Reviewed by Benjamin Poulain.
+
+        Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        * Shared/WebEvent.h:
+        (WebKit::WebPlatformTouchPoint::setRadiusX):
+        (WebKit::WebPlatformTouchPoint::radiusX):
+        (WebKit::WebPlatformTouchPoint::setRadiusY):
+        (WebKit::WebPlatformTouchPoint::radiusY):
+        (WebKit::WebPlatformTouchPoint::setRotationAngle):
+        (WebKit::WebPlatformTouchPoint::rotationAngle):
+        * Shared/WebEventConversion.cpp:
+        (WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint):
+        * Shared/ios/NativeWebTouchEventIOS.mm:
+        (WebKit::NativeWebTouchEvent::extractWebTouchPoint):
+        * Shared/ios/WebPlatformTouchPointIOS.cpp:
+        (WebKit::WebPlatformTouchPoint::encode):
+        (WebKit::WebPlatformTouchPoint::decode):
+
 2016-09-30  Megan Gardner  <megan_gard...@apple.com>
 
         Make it possible to test web-related user-interface features

Modified: trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h (206650 => 206651)


--- trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h	2016-09-30 18:50:49 UTC (rev 206650)
+++ trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h	2016-09-30 19:19:44 UTC (rev 206651)
@@ -654,6 +654,8 @@
     unsigned identifier;
     UITouchPhase phase;
 #if __IPHONE_OS_VERSION_MIN_REQUIRED > 100000
+    // FIXME: Uncomment this once UIKit is updated (rdar://problem/28555313).
+    // CGFloat majorRadiusInScreenCoordinates;
     CGFloat force;
     CGFloat altitudeAngle;
     CGFloat azimuthAngle;

Modified: trunk/Source/WebKit2/Shared/WebEvent.h (206650 => 206651)


--- trunk/Source/WebKit2/Shared/WebEvent.h	2016-09-30 18:50:49 UTC (rev 206650)
+++ trunk/Source/WebKit2/Shared/WebEvent.h	2016-09-30 19:19:44 UTC (rev 206651)
@@ -325,6 +325,12 @@
     TouchPointState state() const { return phase(); }
 
 #if ENABLE(IOS_TOUCH_EVENTS)
+    void setRadiusX(double radiusX) { m_radiusX = radiusX; }
+    double radiusX() const { return m_radiusX; }
+    void setRadiusY(double radiusY) { m_radiusY = radiusY; }
+    double radiusY() const { return m_radiusY; }
+    void setRotationAngle(double rotationAngle) { m_rotationAngle = rotationAngle; }
+    double rotationAngle() const { return m_rotationAngle; }
     void setForce(double force) { m_force = force; }
     double force() const { return m_force; }
     void setAltitudeAngle(double altitudeAngle) { m_altitudeAngle = altitudeAngle; }
@@ -343,6 +349,9 @@
     WebCore::IntPoint m_location;
     uint32_t m_phase;
 #if ENABLE(IOS_TOUCH_EVENTS)
+    double m_radiusX { 0 };
+    double m_radiusY { 0 };
+    double m_rotationAngle { 0 };
     double m_force { 0 };
     double m_altitudeAngle { 0 };
     double m_azimuthAngle { 0 };

Modified: trunk/Source/WebKit2/Shared/WebEventConversion.cpp (206650 => 206651)


--- trunk/Source/WebKit2/Shared/WebEventConversion.cpp	2016-09-30 18:50:49 UTC (rev 206650)
+++ trunk/Source/WebKit2/Shared/WebEventConversion.cpp	2016-09-30 19:19:44 UTC (rev 206651)
@@ -243,7 +243,7 @@
 WebKit2PlatformTouchPoint(const WebPlatformTouchPoint& webTouchPoint)
     : PlatformTouchPoint(webTouchPoint.identifier(), webTouchPoint.location(), touchEventType(webTouchPoint)
 #if ENABLE(IOS_TOUCH_EVENTS)
-        , webTouchPoint.force(), webTouchPoint.altitudeAngle(), webTouchPoint.azimuthAngle(), webPlatformTouchTypeToPlatform(webTouchPoint.touchType())
+        , webTouchPoint.radiusX(), webTouchPoint.radiusY(), webTouchPoint.rotationAngle(), webTouchPoint.force(), webTouchPoint.altitudeAngle(), webTouchPoint.azimuthAngle(), webPlatformTouchTypeToPlatform(webTouchPoint.touchType())
 #endif
     )
 {

Modified: trunk/Source/WebKit2/Shared/ios/NativeWebTouchEventIOS.mm (206650 => 206651)


--- trunk/Source/WebKit2/Shared/ios/NativeWebTouchEventIOS.mm	2016-09-30 18:50:49 UTC (rev 206650)
+++ trunk/Source/WebKit2/Shared/ios/NativeWebTouchEventIOS.mm	2016-09-30 19:19:44 UTC (rev 206651)
@@ -103,6 +103,10 @@
         WebPlatformTouchPoint::TouchPointState phase = convertTouchPhase(touchPoint.phase);
         WebPlatformTouchPoint platformTouchPoint = WebPlatformTouchPoint(identifier, location, phase);
 #if ENABLE(IOS_TOUCH_EVENTS)
+        // FIXME: We should use touchPoint.majorRadiusInScreenCoordinates for radiusX / radiusY once it is available (rdar://problem/28555313).
+        platformTouchPoint.setRadiusX(0);
+        platformTouchPoint.setRadiusY(0);
+        platformTouchPoint.setRotationAngle(0); // Not available in _UIWebTouchEvent yet.
         platformTouchPoint.setForce(touchPoint.force);
 #if defined UI_WEB_TOUCH_EVENT_HAS_STYLUS_DATA && UI_WEB_TOUCH_EVENT_HAS_STYLUS_DATA
         platformTouchPoint.setAltitudeAngle(touchPoint.altitudeAngle);

Modified: trunk/Source/WebKit2/Shared/ios/WebPlatformTouchPointIOS.cpp (206650 => 206651)


--- trunk/Source/WebKit2/Shared/ios/WebPlatformTouchPointIOS.cpp	2016-09-30 18:50:49 UTC (rev 206650)
+++ trunk/Source/WebKit2/Shared/ios/WebPlatformTouchPointIOS.cpp	2016-09-30 19:19:44 UTC (rev 206651)
@@ -40,6 +40,9 @@
     encoder << m_location;
     encoder << m_phase;
 #if ENABLE(IOS_TOUCH_EVENTS)
+    encoder << m_radiusX;
+    encoder << m_radiusY;
+    encoder << m_rotationAngle;
     encoder << m_force;
     encoder << m_altitudeAngle;
     encoder << m_azimuthAngle;
@@ -56,6 +59,12 @@
     if (!decoder.decode(result.m_phase))
         return false;
 #if ENABLE(IOS_TOUCH_EVENTS)
+    if (!decoder.decode(result.m_radiusX))
+        return false;
+    if (!decoder.decode(result.m_radiusY))
+        return false;
+    if (!decoder.decode(result.m_rotationAngle))
+        return false;
     if (!decoder.decode(result.m_force))
         return false;
     if (!decoder.decode(result.m_altitudeAngle))
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to