- Revision
- 197790
- Author
- [email protected]
- Date
- 2016-03-08 12:18:51 -0800 (Tue, 08 Mar 2016)
Log Message
Add an event for when touch force changes
https://bugs.webkit.org/show_bug.cgi?id=155143
-and corresponding-
rdar://problem/24068726
Reviewed by Darin Adler.
We will be able to test this once we fix the iOS touch tests.
This patch adds touchforcechange which is a lot like the iOS equivalent of
webkitmouseforcechanged. We had originally hoped to use touchmove to dispatch
force changes, but that turned out to be a compatibility nightmare.
* dom/EventNames.h:
(WebCore::EventNames::isTouchEventType):
(WebCore::EventNames::isWheelEventType):
(WebCore::EventNames::touchEventNames):
* dom/GlobalEventHandlers.idl:
* html/HTMLAttributeNames.in:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):
* platform/PlatformEvent.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (197789 => 197790)
--- trunk/Source/WebCore/ChangeLog 2016-03-08 20:11:36 UTC (rev 197789)
+++ trunk/Source/WebCore/ChangeLog 2016-03-08 20:18:51 UTC (rev 197790)
@@ -1,3 +1,28 @@
+2016-03-08 Beth Dakin <[email protected]>
+
+ Add an event for when touch force changes
+ https://bugs.webkit.org/show_bug.cgi?id=155143
+ -and corresponding-
+ rdar://problem/24068726
+
+ Reviewed by Darin Adler.
+
+ We will be able to test this once we fix the iOS touch tests.
+
+ This patch adds touchforcechange which is a lot like the iOS equivalent of
+ webkitmouseforcechanged. We had originally hoped to use touchmove to dispatch
+ force changes, but that turned out to be a compatibility nightmare.
+
+ * dom/EventNames.h:
+ (WebCore::EventNames::isTouchEventType):
+ (WebCore::EventNames::isWheelEventType):
+ (WebCore::EventNames::touchEventNames):
+ * dom/GlobalEventHandlers.idl:
+ * html/HTMLAttributeNames.in:
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::createEventHandlerNameMap):
+ * platform/PlatformEvent.h:
+
2016-03-08 Anders Carlsson <[email protected]>
Ignore deprecation warnings.
Modified: trunk/Source/WebCore/dom/EventNames.h (197789 => 197790)
--- trunk/Source/WebCore/dom/EventNames.h 2016-03-08 20:11:36 UTC (rev 197789)
+++ trunk/Source/WebCore/dom/EventNames.h 2016-03-08 20:18:51 UTC (rev 197790)
@@ -216,6 +216,7 @@
macro(tonechange) \
macro(touchcancel) \
macro(touchend) \
+ macro(touchforcechange) \
macro(touchmove) \
macro(touchstart) \
macro(track) \
@@ -306,7 +307,7 @@
bool isGamepadEventType(const AtomicString& eventType) const;
#endif
- std::array<std::reference_wrapper<const AtomicString>, 4> touchEventNames() const;
+ std::array<std::reference_wrapper<const AtomicString>, 5> touchEventNames() const;
private:
EventNames(); // Private to prevent accidental call to EventNames() instead of eventNames().
@@ -332,7 +333,8 @@
return eventType == touchstartEvent
|| eventType == touchmoveEvent
|| eventType == touchendEvent
- || eventType == touchcancelEvent;
+ || eventType == touchcancelEvent
+ || eventType == touchforcechangeEvent;
}
inline bool EventNames::isWheelEventType(const AtomicString& eventType) const
@@ -341,9 +343,9 @@
|| eventType == mousewheelEvent;
}
-inline std::array<std::reference_wrapper<const AtomicString>, 4> EventNames::touchEventNames() const
+inline std::array<std::reference_wrapper<const AtomicString>, 5> EventNames::touchEventNames() const
{
- return { { touchstartEvent, touchmoveEvent, touchendEvent, touchcancelEvent } };
+ return { { touchstartEvent, touchmoveEvent, touchendEvent, touchcancelEvent, touchforcechangeEvent } };
}
#if ENABLE(GAMEPAD)
Modified: trunk/Source/WebCore/dom/GlobalEventHandlers.idl (197789 => 197790)
--- trunk/Source/WebCore/dom/GlobalEventHandlers.idl 2016-03-08 20:11:36 UTC (rev 197789)
+++ trunk/Source/WebCore/dom/GlobalEventHandlers.idl 2016-03-08 20:18:51 UTC (rev 197790)
@@ -104,6 +104,7 @@
[NotEnumerable, Conditional=TOUCH_EVENTS] attribute EventHandler ontouchend;
[NotEnumerable, Conditional=TOUCH_EVENTS] attribute EventHandler ontouchmove;
[NotEnumerable, Conditional=TOUCH_EVENTS] attribute EventHandler ontouchstart;
+ [NotEnumerable, Conditional=TOUCH_EVENTS] attribute EventHandler ontouchforcechange;
[NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcechanged;
[NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcedown;
[NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcewillbegin;
Modified: trunk/Source/WebCore/html/HTMLAttributeNames.in (197789 => 197790)
--- trunk/Source/WebCore/html/HTMLAttributeNames.in 2016-03-08 20:11:36 UTC (rev 197789)
+++ trunk/Source/WebCore/html/HTMLAttributeNames.in 2016-03-08 20:18:51 UTC (rev 197790)
@@ -262,6 +262,7 @@
onsuspend
onsubmit
ontimeupdate
+ontouchforcechange
ontouchstart
ontouchmove
ontouchend
Modified: trunk/Source/WebCore/html/HTMLElement.cpp (197789 => 197790)
--- trunk/Source/WebCore/html/HTMLElement.cpp 2016-03-08 20:11:36 UTC (rev 197789)
+++ trunk/Source/WebCore/html/HTMLElement.cpp 2016-03-08 20:18:51 UTC (rev 197790)
@@ -327,6 +327,7 @@
&ontimeupdateAttr,
&ontouchcancelAttr,
&ontouchendAttr,
+ &ontouchforcechangeAttr,
&ontouchmoveAttr,
&ontouchstartAttr,
&ontransitionendAttr,
Modified: trunk/Source/WebCore/platform/PlatformEvent.h (197789 => 197790)
--- trunk/Source/WebCore/platform/PlatformEvent.h 2016-03-08 20:11:36 UTC (rev 197789)
+++ trunk/Source/WebCore/platform/PlatformEvent.h 2016-03-08 20:18:51 UTC (rev 197790)
@@ -57,6 +57,7 @@
TouchMove,
TouchEnd,
TouchCancel,
+ TouchForceChange,
#endif
#if ENABLE(MAC_GESTURE_EVENTS)