Change range of possible forces for mouseforcechanged DOM event
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 May 2015 18:17:39 +0000 (18:17 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 May 2015 18:17:39 +0000 (18:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144987
-and corresponding-
rdar://problem/20472802

Reviewed by Tim Horton.

Change to a 0-3 range.
Source/WebCore:

* platform/PlatformMouseEvent.h:
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):

Source/WebKit2:

* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebMouseEvent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184345 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/PlatformMouseEvent.h
Source/WebCore/platform/mac/PlatformEventFactoryMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/WebEventFactory.mm

index dcaae39..1d02dd0 100644 (file)
@@ -1,3 +1,17 @@
+2015-05-14  Beth Dakin  <bdakin@apple.com>
+
+        Change range of possible forces for mouseforcechanged DOM event
+        https://bugs.webkit.org/show_bug.cgi?id=144987
+        -and corresponding-
+        rdar://problem/20472802
+
+        Reviewed by Tim Horton.
+
+        Change to a 0-3 range.
+        * platform/PlatformMouseEvent.h:
+        * platform/mac/PlatformEventFactoryMac.mm:
+        (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
+
 2015-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
 
         Fix typo in RenderBox::instrinsicScrollbarLogicalWidth()
index 81f35b7..3f9d97f 100644 (file)
@@ -43,8 +43,8 @@ typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move;
 
 namespace WebCore {
 
-const double ForceAtClick = 0;
-const double ForceAtForceClick = 1;
+const double ForceAtClick = 1;
+const double ForceAtForceClick = 2;
 
     // These button numbers match the ones used in the DOM API, 0 through 2, except for NoButton which isn't specified.
     enum MouseButton : int8_t { NoButton = -1, LeftButton, MiddleButton, RightButton };
index 05bb81c..d4a7cea 100644 (file)
@@ -454,7 +454,7 @@ public:
 #if defined(__LP64__) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101003
         int stage = eventIsPressureEvent ? event.stage : correspondingPressureEvent.stage;
         double pressure = eventIsPressureEvent ? event.pressure : correspondingPressureEvent.pressure;
-        m_force = stage < 1 ? pressure : pressure + stage - 1;
+        m_force = pressure + stage;
 #endif
 
         // Mac specific
index 96b85cf..40d1850 100644 (file)
@@ -1,3 +1,16 @@
+2015-05-14  Beth Dakin  <bdakin@apple.com>
+
+        Change range of possible forces for mouseforcechanged DOM event
+        https://bugs.webkit.org/show_bug.cgi?id=144987
+        -and corresponding-
+        rdar://problem/20472802
+
+        Reviewed by Tim Horton.
+
+        Change to a 0-3 range.
+        * Shared/mac/WebEventFactory.mm:
+        (WebKit::WebEventFactory::createWebMouseEvent):
+
 2015-05-14  Zan Dobersek  <zdobersek@igalia.com>
 
         [GTK] Add missing ENABLE(NETSCAPE_PLUGIN_API) build guards
index 6010ff6..00f1348 100644 (file)
@@ -400,7 +400,7 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(NSEvent *event, NSEvent *last
 #if defined(__LP64__) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101003
     int stage = [event type] == NSEventTypePressure ? event.stage : lastPressureEvent.stage;
     double pressure = [event type] == NSEventTypePressure ? event.pressure : lastPressureEvent.pressure;
-    force = stage < 1 ? pressure : pressure + stage - 1;
+    force = pressure + stage;
 #endif
 
     return WebMouseEvent(type, button, IntPoint(position), IntPoint(globalPosition), deltaX, deltaY, deltaZ, clickCount, modifiers, timestamp, force, eventNumber, menuTypeForEvent);