Diff
Modified: trunk/LayoutTests/ChangeLog (181906 => 181907)
--- trunk/LayoutTests/ChangeLog 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/LayoutTests/ChangeLog 2015-03-24 21:31:28 UTC (rev 181907)
@@ -1,3 +1,16 @@
+2015-03-24 Beth Dakin <[email protected]>
+
+ Add events related to force click gesture
+ https://bugs.webkit.org/show_bug.cgi?id=142836
+ -and corresponding-
+ rdar://problem/20210239
+
+ Reviewed by Dean Jackson.
+
+ * fast/dom/event-handler-attributes-expected.txt:
+ * fast/dom/event-handler-attributes.html:
+ * platform/mac/js/dom/global-constructors-attributes-expected.txt:
+
2015-03-24 Chris Dumez <[email protected]>
[WK2] Responses with 404 HTTP Status Code should be cacheable by default
Modified: trunk/LayoutTests/fast/dom/event-handler-attributes-expected.txt (181906 => 181907)
--- trunk/LayoutTests/fast/dom/event-handler-attributes-expected.txt 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/LayoutTests/fast/dom/event-handler-attributes-expected.txt 2015-03-24 21:31:28 UTC (rev 181907)
@@ -88,6 +88,12 @@
PASS testScriptAttribute(window, "webkitanimationiteration") is "window"
PASS testScriptAttribute(window, "webkitanimationstart") is "window"
PASS testScriptAttribute(window, "webkitdeviceproximity") is "window"
+PASS testScriptAttribute(window, "webkitmouseforcecancelled") is "window"
+PASS testScriptAttribute(window, "webkitmouseforcechanged") is "window"
+PASS testScriptAttribute(window, "webkitmouseforceclick") is "window"
+PASS testScriptAttribute(window, "webkitmouseforcedown") is "window"
+PASS testScriptAttribute(window, "webkitmouseforceup") is "window"
+PASS testScriptAttribute(window, "webkitmouseforcewillbegin") is "window"
PASS testScriptAttribute(window, "webkittransitionend") is "window"
PASS testScriptAttribute(window, "webkitwillrevealbottom") is "window"
PASS testScriptAttribute(window, "webkitwillrevealleft") is "window"
@@ -177,6 +183,12 @@
PASS testScriptAttribute(document, "touchend") is "document"
PASS testScriptAttribute(document, "touchmove") is "document"
PASS testScriptAttribute(document, "touchstart") is "document"
+PASS testScriptAttribute(document, "webkitmouseforcecancelled") is "document"
+PASS testScriptAttribute(document, "webkitmouseforcechanged") is "document"
+PASS testScriptAttribute(document, "webkitmouseforceclick") is "document"
+PASS testScriptAttribute(document, "webkitmouseforcedown") is "document"
+PASS testScriptAttribute(document, "webkitmouseforceup") is "document"
+PASS testScriptAttribute(document, "webkitmouseforcewillbegin") is "document"
PASS testScriptAttribute(document, "webkitfullscreenchange") is "document"
PASS testScriptAttribute(document, "webkitfullscreenerror") is "document"
PASS testScriptAttribute(document, "webkitwillrevealbottom") is "document"
@@ -335,6 +347,12 @@
PASS testElementAttribute(element, "webkitkeyadded") is "target"
PASS testElementAttribute(element, "webkitkeyerror") is "target"
PASS testElementAttribute(element, "webkitkeymessage") is "target"
+PASS testElementAttribute(element, "webkitmouseforcecancelled") is "target"
+PASS testElementAttribute(element, "webkitmouseforcechanged") is "target"
+PASS testElementAttribute(element, "webkitmouseforceclick") is "target"
+PASS testElementAttribute(element, "webkitmouseforcedown") is "target"
+PASS testElementAttribute(element, "webkitmouseforceup") is "target"
+PASS testElementAttribute(element, "webkitmouseforcewillbegin") is "target"
PASS testElementAttribute(element, "webkitneedkey") is "target"
PASS testElementAttribute(element, "webkitplaybacktargetavailabilitychanged") is "target"
PASS testElementAttribute(element, "webkitpresentationmodechanged") is "target"
@@ -457,6 +475,12 @@
PASS testElementAttribute(inputElement, "webkitkeyadded") is "target"
PASS testElementAttribute(inputElement, "webkitkeyerror") is "target"
PASS testElementAttribute(inputElement, "webkitkeymessage") is "target"
+PASS testElementAttribute(inputElement, "webkitmouseforcecancelled") is "target"
+PASS testElementAttribute(inputElement, "webkitmouseforcechanged") is "target"
+PASS testElementAttribute(inputElement, "webkitmouseforceclick") is "target"
+PASS testElementAttribute(inputElement, "webkitmouseforcedown") is "target"
+PASS testElementAttribute(inputElement, "webkitmouseforceup") is "target"
+PASS testElementAttribute(inputElement, "webkitmouseforcewillbegin") is "target"
PASS testElementAttribute(inputElement, "webkitneedkey") is "target"
PASS testElementAttribute(inputElement, "webkitplaybacktargetavailabilitychanged") is "target"
PASS testElementAttribute(inputElement, "webkitpresentationmodechanged") is "target"
@@ -579,6 +603,12 @@
PASS testElementAttribute(audioElement, "webkitkeyadded") is "target"
PASS testElementAttribute(audioElement, "webkitkeyerror") is "target"
PASS testElementAttribute(audioElement, "webkitkeymessage") is "target"
+PASS testElementAttribute(audioElement, "webkitmouseforcecancelled") is "target"
+PASS testElementAttribute(audioElement, "webkitmouseforcechanged") is "target"
+PASS testElementAttribute(audioElement, "webkitmouseforceclick") is "target"
+PASS testElementAttribute(audioElement, "webkitmouseforcedown") is "target"
+PASS testElementAttribute(audioElement, "webkitmouseforceup") is "target"
+PASS testElementAttribute(audioElement, "webkitmouseforcewillbegin") is "target"
PASS testElementAttribute(audioElement, "webkitneedkey") is "target"
PASS testElementAttribute(audioElement, "webkitplaybacktargetavailabilitychanged") is "target"
PASS testElementAttribute(audioElement, "webkitpresentationmodechanged") is "target"
@@ -701,6 +731,12 @@
PASS testElementAttribute(videoElement, "webkitkeyadded") is "target"
PASS testElementAttribute(videoElement, "webkitkeyerror") is "target"
PASS testElementAttribute(videoElement, "webkitkeymessage") is "target"
+PASS testElementAttribute(videoElement, "webkitmouseforcecancelled") is "target"
+PASS testElementAttribute(videoElement, "webkitmouseforcechanged") is "target"
+PASS testElementAttribute(videoElement, "webkitmouseforceclick") is "target"
+PASS testElementAttribute(videoElement, "webkitmouseforcedown") is "target"
+PASS testElementAttribute(videoElement, "webkitmouseforceup") is "target"
+PASS testElementAttribute(videoElement, "webkitmouseforcewillbegin") is "target"
PASS testElementAttribute(videoElement, "webkitneedkey") is "target"
PASS testElementAttribute(videoElement, "webkitplaybacktargetavailabilitychanged") is "target"
PASS testElementAttribute(videoElement, "webkitpresentationmodechanged") is "target"
@@ -755,6 +791,12 @@
PASS testElementAttribute(bodyElement, "resize") is "window"
PASS testElementAttribute(bodyElement, "storage") is "window"
PASS testElementAttribute(bodyElement, "unload") is "window"
+PASS testElementAttribute(bodyElement, "webkitmouseforcecancelled") is "window"
+PASS testElementAttribute(bodyElement, "webkitmouseforcechanged") is "window"
+PASS testElementAttribute(bodyElement, "webkitmouseforceclick") is "window"
+PASS testElementAttribute(bodyElement, "webkitmouseforcedown") is "window"
+PASS testElementAttribute(bodyElement, "webkitmouseforceup") is "window"
+PASS testElementAttribute(bodyElement, "webkitmouseforcewillbegin") is "window"
PASS testElementAttribute(bodyElement, "webkitwillrevealbottom") is "window"
PASS testElementAttribute(bodyElement, "webkitwillrevealleft") is "window"
PASS testElementAttribute(bodyElement, "webkitwillrevealright") is "window"
@@ -883,6 +925,12 @@
PASS testElementAttribute(framesetElement, "resize") is "window"
PASS testElementAttribute(framesetElement, "storage") is "window"
PASS testElementAttribute(framesetElement, "unload") is "window"
+FAIL testElementAttribute(framesetElement, "webkitmouseforcecancelled") should be window. Was script: target; content: window.
+FAIL testElementAttribute(framesetElement, "webkitmouseforcechanged") should be window. Was script: target; content: window.
+FAIL testElementAttribute(framesetElement, "webkitmouseforceclick") should be window. Was script: target; content: window.
+FAIL testElementAttribute(framesetElement, "webkitmouseforcedown") should be window. Was script: target; content: window.
+FAIL testElementAttribute(framesetElement, "webkitmouseforceup") should be window. Was script: target; content: window.
+FAIL testElementAttribute(framesetElement, "webkitmouseforcewillbegin") should be window. Was script: target; content: window.
PASS testElementAttribute(framesetElement, "webkitwillrevealbottom") is "window"
PASS testElementAttribute(framesetElement, "webkitwillrevealleft") is "window"
PASS testElementAttribute(framesetElement, "webkitwillrevealright") is "window"
@@ -1079,6 +1127,12 @@
PASS testElementAttribute(rectElement, "webkitkeyadded") is "target"
PASS testElementAttribute(rectElement, "webkitkeyerror") is "target"
PASS testElementAttribute(rectElement, "webkitkeymessage") is "target"
+PASS testElementAttribute(rectElement, "webkitmouseforcecancelled") is "target"
+PASS testElementAttribute(rectElement, "webkitmouseforcechanged") is "target"
+PASS testElementAttribute(rectElement, "webkitmouseforceclick") is "target"
+PASS testElementAttribute(rectElement, "webkitmouseforcedown") is "target"
+PASS testElementAttribute(rectElement, "webkitmouseforceup") is "target"
+PASS testElementAttribute(rectElement, "webkitmouseforcewillbegin") is "target"
PASS testElementAttribute(rectElement, "webkitneedkey") is "target"
PASS testElementAttribute(rectElement, "webkitplaybacktargetavailabilitychanged") is "target"
PASS testElementAttribute(rectElement, "webkitpresentationmodechanged") is "target"
@@ -1222,6 +1276,12 @@
FAIL testElementAttribute(nonHTMLElement, "webkitkeyadded") should be none. Was script: target; content: none.
FAIL testElementAttribute(nonHTMLElement, "webkitkeyerror") should be none. Was script: target; content: none.
FAIL testElementAttribute(nonHTMLElement, "webkitkeymessage") should be none. Was script: target; content: none.
+FAIL testElementAttribute(nonHTMLElement, "webkitmouseforcecancelled") should be none. Was script: target; content: none.
+FAIL testElementAttribute(nonHTMLElement, "webkitmouseforcechanged") should be none. Was script: target; content: none.
+FAIL testElementAttribute(nonHTMLElement, "webkitmouseforceclick") should be none. Was script: target; content: none.
+FAIL testElementAttribute(nonHTMLElement, "webkitmouseforcedown") should be none. Was script: target; content: none.
+FAIL testElementAttribute(nonHTMLElement, "webkitmouseforceup") should be none. Was script: target; content: none.
+FAIL testElementAttribute(nonHTMLElement, "webkitmouseforcewillbegin") should be none. Was script: target; content: none.
FAIL testElementAttribute(nonHTMLElement, "webkitneedkey") should be none. Was script: target; content: none.
FAIL testElementAttribute(nonHTMLElement, "webkitplaybacktargetavailabilitychanged") should be none. Was script: target; content: none.
FAIL testElementAttribute(nonHTMLElement, "webkitpresentationmodechanged") should be none. Was script: target; content: none.
Modified: trunk/LayoutTests/fast/dom/event-handler-attributes.html (181906 => 181907)
--- trunk/LayoutTests/fast/dom/event-handler-attributes.html 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/LayoutTests/fast/dom/event-handler-attributes.html 2015-03-24 21:31:28 UTC (rev 181907)
@@ -96,6 +96,12 @@
"webkitanimationiteration",
"webkitanimationstart",
"webkitdeviceproximity",
+ "webkitmouseforcecancelled",
+ "webkitmouseforcechanged",
+ "webkitmouseforceclick",
+ "webkitmouseforcedown",
+ "webkitmouseforceup",
+ "webkitmouseforcewillbegin",
"webkittransitionend",
"webkitwillrevealbottom",
"webkitwillrevealleft",
@@ -155,6 +161,12 @@
"touchend",
"touchmove",
"touchstart",
+ "webkitmouseforcecancelled",
+ "webkitmouseforcechanged",
+ "webkitmouseforceclick",
+ "webkitmouseforcedown",
+ "webkitmouseforceup",
+ "webkitmouseforcewillbegin",
"webkitfullscreenchange",
"webkitfullscreenerror",
"webkitwillrevealbottom",
@@ -251,6 +263,12 @@
"webkitkeyadded",
"webkitkeyerror",
"webkitkeymessage",
+ "webkitmouseforcecancelled",
+ "webkitmouseforcechanged",
+ "webkitmouseforceclick",
+ "webkitmouseforcedown",
+ "webkitmouseforceup",
+ "webkitmouseforcewillbegin",
"webkitneedkey",
"webkitplaybacktargetavailabilitychanged",
"webkitpresentationmodechanged",
@@ -281,6 +299,12 @@
"resize",
"storage",
"unload",
+ "webkitmouseforcecancelled",
+ "webkitmouseforcechanged",
+ "webkitmouseforceclick",
+ "webkitmouseforcedown",
+ "webkitmouseforceup",
+ "webkitmouseforcewillbegin",
"webkitwillrevealbottom",
"webkitwillrevealleft",
"webkitwillrevealright",
Modified: trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt (181906 => 181907)
--- trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt 2015-03-24 21:31:28 UTC (rev 181907)
@@ -2018,6 +2018,11 @@
PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeys').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeys').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeys').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceChangedEvent').value is WebKitMouseForceChangedEvent
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceChangedEvent').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceChangedEvent').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceChangedEvent').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceChangedEvent').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'WebKitMutationObserver').value is WebKitMutationObserver
PASS Object.getOwnPropertyDescriptor(global, 'WebKitMutationObserver').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'WebKitMutationObserver').hasOwnProperty('set') is false
Modified: trunk/Source/WTF/ChangeLog (181906 => 181907)
--- trunk/Source/WTF/ChangeLog 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WTF/ChangeLog 2015-03-24 21:31:28 UTC (rev 181907)
@@ -1,3 +1,15 @@
+2015-03-24 Beth Dakin <[email protected]>
+
+ Add events related to force click gesture
+ https://bugs.webkit.org/show_bug.cgi?id=142836
+ -and corresponding-
+ rdar://problem/20210239
+
+ Reviewed by Dean Jackson.
+
+ New enable flag for the events.
+ * wtf/FeatureDefines.h:
+
2015-03-23 Filip Pizlo <[email protected]>
JSC should have a low-cost asynchronous disassembler
Modified: trunk/Source/WTF/wtf/FeatureDefines.h (181906 => 181907)
--- trunk/Source/WTF/wtf/FeatureDefines.h 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WTF/wtf/FeatureDefines.h 2015-03-24 21:31:28 UTC (rev 181907)
@@ -569,6 +569,10 @@
#define ENABLE_MOUSE_CURSOR_SCALE 0
#endif
+#if !defined(ENABLE_MOUSE_FORCE_EVENTS)
+#define ENABLE_MOUSE_FORCE_EVENTS 1
+#endif
+
#if !defined(ENABLE_NAVIGATOR_CONTENT_UTILS)
#define ENABLE_NAVIGATOR_CONTENT_UTILS 0
#endif
Modified: trunk/Source/WebCore/CMakeLists.txt (181906 => 181907)
--- trunk/Source/WebCore/CMakeLists.txt 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/CMakeLists.txt 2015-03-24 21:31:28 UTC (rev 181907)
@@ -427,6 +427,7 @@
dom/TreeWalker.idl
dom/UIEvent.idl
dom/WebKitAnimationEvent.idl
+ dom/WebKitMouseForceEvent.idl
dom/WebKitNamedFlow.idl
dom/WebKitTransitionEvent.idl
dom/WheelEvent.idl
@@ -1452,6 +1453,7 @@
dom/ViewportArguments.cpp
dom/VisitedLinkState.cpp
dom/WebKitAnimationEvent.cpp
+ dom/WebKitMouseForceEvent.cpp
dom/WebKitNamedFlow.cpp
dom/WebKitTransitionEvent.cpp
dom/WheelEvent.cpp
Modified: trunk/Source/WebCore/ChangeLog (181906 => 181907)
--- trunk/Source/WebCore/ChangeLog 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/ChangeLog 2015-03-24 21:31:28 UTC (rev 181907)
@@ -1,3 +1,87 @@
+2015-03-24 Beth Dakin <[email protected]>
+
+ Add events related to force click gesture
+ https://bugs.webkit.org/show_bug.cgi?id=142836
+ -and corresponding-
+ rdar://problem/20210239
+
+ Reviewed by Dean Jackson.
+
+ This patch adds six new events for the force click gesture:
+
+ webkitmouseforcewillbegin -> Event is sent just before mousedown to indicate that
+ force can be perceived if the user presses any harder. The author should prevent
+ default on this event to both prevent the user agent’s default force click
+ features and to receive the other 5 events.
+
+ webkitmouseforcechanged -> This event fires whenever force changes between the
+ mousedown and mouseup. It is a new type of mouse event that includes a force
+ variable which is a normalized number between 0 (corresponds to click) and 1
+ (corresponds to force click). In this patch, I have only added code to send this
+ event between mousedown and mouseforcedown, but as a followup patch, we plan to
+ send it through mouseup.
+
+ webkitmouseforcecancelled -> If the user releases their finger from the trackpad
+ after pressing hard enough to send webkitmouseforcewillbegin events but not hard
+ enough to force click, this event will be sent to indicate that the user bailed
+ out on the gesture.
+
+ webkitmouseforcedown -> The down part of the force click.
+
+ webkitmouseforceup -> The up part of the force click. This event is added in this
+ patch, but does not yet fire. That is work for a follow-up patch.
+
+ webkitmouseforceclick -> The equivalent of the click event for the force click.
+ Should fire just after webkitmouseforceup. This event is added in this patch, but
+ does not yet fire. That is work for a follow-up patch.
+
+ Add new files for WebKitMouseForceEvent to build systems.
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * WebCore.vcxproj/WebCore.vcxproj:
+ * WebCore.vcxproj/WebCore.vcxproj.filters:
+ * WebCore.xcodeproj/project.pbxproj:
+ * WebCore.xcodeproj/project.pbxproj:
+
+ Plumbing for new events.
+ * dom/Document.idl:
+
+ Code to dispatch the new events. Currently the code that calls these functions is
+ in WebKit2.
+ * dom/Element.cpp:
+ (WebCore::Element::dispatchMouseForceWillBegin):
+ (WebCore::Element::dispatchMouseForceChanged):
+ (WebCore::Element::dispatchMouseForceDown):
+ (WebCore::Element::dispatchMouseForceUp):
+ (WebCore::Element::dispatchMouseForceClick):
+ (WebCore::Element::dispatchMouseForceCancelled):
+ * dom/Element.h:
+
+ More plumbing.
+ * dom/Element.idl:
+ * dom/EventNames.h:
+ * dom/EventNames.in:
+
+ Our new type of mouse event that includes force.
+ * dom/WebKitMouseForceEvent.cpp: Added.
+ (WebCore::WebKitMouseForceEventInit::WebKitMouseForceEventInit):
+ (WebCore::WebKitMouseForceEvent::WebKitMouseForceEvent):
+ (WebCore::WebKitMouseForceEvent::~WebKitMouseForceEvent):
+ (WebCore::WebKitMouseForceEvent::eventInterface):
+ * dom/WebKitMouseForceEvent.h: Added.
+ * dom/WebKitMouseForceEvent.idl: Added.
+
+ More plumbing.
+ * html/HTMLAttributeNames.in:
+ * html/HTMLBodyElement.cpp:
+ (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
+ * html/HTMLBodyElement.idl:
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::createEventHandlerNameMap):
+ * page/DOMWindow.idl:
+ * page/EventHandler.h:
+ (WebCore::EventHandler::lastMouseDownEvent):
+
2015-03-24 Anders Carlsson <[email protected]>
Fix designated initializer violations
Modified: trunk/Source/WebCore/DerivedSources.cpp (181906 => 181907)
--- trunk/Source/WebCore/DerivedSources.cpp 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/DerivedSources.cpp 2015-03-24 21:31:28 UTC (rev 181907)
@@ -509,6 +509,7 @@
#include "JSWebKitCSSTransformValue.cpp"
#include "JSWebKitCSSMatrix.cpp"
#include "JSWebKitCSSRegionRule.cpp"
+#include "JSWebKitMouseForceEvent.cpp"
#include "JSWebKitNamedFlow.cpp"
#include "JSWebKitPoint.cpp"
#include "JSWebKitTransitionEvent.cpp"
Modified: trunk/Source/WebCore/DerivedSources.make (181906 => 181907)
--- trunk/Source/WebCore/DerivedSources.make 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/DerivedSources.make 2015-03-24 21:31:28 UTC (rev 181907)
@@ -313,6 +313,7 @@
$(WebCore)/dom/TreeWalker.idl \
$(WebCore)/dom/UIEvent.idl \
$(WebCore)/dom/WebKitAnimationEvent.idl \
+ $(WebCore)/dom/WebKitMouseForceEvent.idl \
$(WebCore)/dom/WebKitNamedFlow.idl \
$(WebCore)/dom/WebKitTransitionEvent.idl \
$(WebCore)/dom/WheelEvent.idl \
Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (181906 => 181907)
--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj 2015-03-24 21:31:28 UTC (rev 181907)
@@ -6318,6 +6318,20 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitMouseForceEvent.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitNamedFlow.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -14185,6 +14199,20 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="..\dom\WebKitMouseForceEvent.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="..\dom\WebKitNamedFlow.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -18776,6 +18804,7 @@
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitCSSMatrix.h" />
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitCSSRegionRule.h" />
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitCSSTransformValue.h" />
+ <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitMouseForceEvent.h" />
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitNamedFlow.h" />
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitPoint.h" />
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitTransitionEvent.h" />
@@ -20693,6 +20722,7 @@
<ClInclude Include="..\dom\UserTypingGestureIndicator.h" />
<ClInclude Include="..\dom\ViewportArguments.h" />
<ClInclude Include="..\dom\WebKitAnimationEvent.h" />
+ <ClInclude Include="..\dom\WebKitMouseForceEvent.h" />
<ClInclude Include="..\dom\WebKitNamedFlow.h" />
<ClInclude Include="..\dom\WebKitTransitionEvent.h" />
<ClInclude Include="..\dom\WheelEvent.h" />
Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (181906 => 181907)
--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters 2015-03-24 21:31:28 UTC (rev 181907)
@@ -3378,6 +3378,9 @@
<ClCompile Include="..\dom\WebKitAnimationEvent.cpp">
<Filter>dom</Filter>
</ClCompile>
+ <ClCompile Include="..\dom\WebKitMouseForceEvent.cpp">
+ <Filter>dom</Filter>
+ </ClCompile>
<ClCompile Include="..\dom\WebKitNamedFlow.cpp">
<Filter>dom</Filter>
</ClCompile>
@@ -6208,6 +6211,9 @@
<ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitCSSTransformValue.cpp">
<Filter>DerivedSources</Filter>
</ClCompile>
+ <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitMouseForceEvent.cpp">
+ <Filter>DerivedSources</Filter>
+ </ClCompile>
<ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitNamedFlow.cpp">
<Filter>DerivedSources</Filter>
</ClCompile>
@@ -10470,6 +10476,9 @@
<ClInclude Include="..\dom\WebKitAnimationEvent.h">
<Filter>dom</Filter>
</ClInclude>
+ <ClInclude Include="..\dom\WebKitMouseForceEvent.h">
+ <Filter>dom</Filter>
+ </ClInclude>
<ClInclude Include="..\dom\WebKitNamedFlow.h">
<Filter>dom</Filter>
</ClInclude>
@@ -13574,6 +13583,9 @@
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitCSSTransformValue.h">
<Filter>DerivedSources</Filter>
</ClInclude>
+ <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitMouseForceEvent.h">
+ <Filter>DerivedSources</Filter>
+ </ClInclude>
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitNamedFlow.h">
<Filter>DerivedSources</Filter>
</ClInclude>
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (181906 => 181907)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2015-03-24 21:31:28 UTC (rev 181907)
@@ -3416,6 +3416,10 @@
93C4F6EB1108F9A50099D0DB /* AccessibilityScrollbar.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C4F6E91108F9A50099D0DB /* AccessibilityScrollbar.h */; };
93CCF0270AF6C52900018E89 /* NavigationAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CCF0260AF6C52900018E89 /* NavigationAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
93CCF0600AF6CA7600018E89 /* NavigationAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93CCF05F0AF6CA7600018E89 /* NavigationAction.cpp */; };
+ 93D200ED1AB8ED090025E851 /* WebKitMouseForceEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93D200EB1AB8ED090025E851 /* WebKitMouseForceEvent.cpp */; };
+ 93D200EE1AB8ED090025E851 /* WebKitMouseForceEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D200EC1AB8ED090025E851 /* WebKitMouseForceEvent.h */; };
+ 93D200F21AB8F81F0025E851 /* JSWebKitMouseForceEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93D200F01AB8F81F0025E851 /* JSWebKitMouseForceEvent.cpp */; };
+ 93D200F31AB8F8200025E851 /* JSWebKitMouseForceEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D200F11AB8F81F0025E851 /* JSWebKitMouseForceEvent.h */; };
93D3C1590F97A9D70053C013 /* DOMHTMLCanvasElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D3C1580F97A9D70053C013 /* DOMHTMLCanvasElement.h */; };
93D3C17D0F97AA760053C013 /* DOMHTMLCanvasElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 93D3C1580F97A9D70053C013 /* DOMHTMLCanvasElement.h */; };
93D9D53C0DA27E180077216C /* RangeBoundaryPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D9D53B0DA27E180077216C /* RangeBoundaryPoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -10653,6 +10657,11 @@
93CA4CA209DF93FA00DF8677 /* svg.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = svg.css; sourceTree = "<group>"; };
93CCF0260AF6C52900018E89 /* NavigationAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigationAction.h; sourceTree = "<group>"; };
93CCF05F0AF6CA7600018E89 /* NavigationAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NavigationAction.cpp; sourceTree = "<group>"; };
+ 93D200EB1AB8ED090025E851 /* WebKitMouseForceEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitMouseForceEvent.cpp; sourceTree = "<group>"; };
+ 93D200EC1AB8ED090025E851 /* WebKitMouseForceEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitMouseForceEvent.h; sourceTree = "<group>"; };
+ 93D200EF1AB8ED640025E851 /* WebKitMouseForceEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebKitMouseForceEvent.idl; sourceTree = "<group>"; };
+ 93D200F01AB8F81F0025E851 /* JSWebKitMouseForceEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitMouseForceEvent.cpp; sourceTree = "<group>"; };
+ 93D200F11AB8F81F0025E851 /* JSWebKitMouseForceEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitMouseForceEvent.h; sourceTree = "<group>"; };
93D3C1580F97A9D70053C013 /* DOMHTMLCanvasElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLCanvasElement.h; sourceTree = "<group>"; };
93D9D53B0DA27E180077216C /* RangeBoundaryPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RangeBoundaryPoint.h; sourceTree = "<group>"; };
93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentLoader.cpp; sourceTree = "<group>"; };
@@ -19691,6 +19700,8 @@
A86629C909DA2B47009633A5 /* JSUIEvent.h */,
31C0FF390E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.cpp */,
31C0FF3A0E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.h */,
+ 93D200F01AB8F81F0025E851 /* JSWebKitMouseForceEvent.cpp */,
+ 93D200F11AB8F81F0025E851 /* JSWebKitMouseForceEvent.h */,
31C0FF3B0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp */,
31C0FF3C0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h */,
65DF31F109D1CC60000BE325 /* JSWheelEvent.cpp */,
@@ -23164,6 +23175,9 @@
31C0FF1B0E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp */,
31C0FF1C0E4CEB6E007D6FE5 /* WebKitAnimationEvent.h */,
31C0FF1D0E4CEB6E007D6FE5 /* WebKitAnimationEvent.idl */,
+ 93D200EB1AB8ED090025E851 /* WebKitMouseForceEvent.cpp */,
+ 93D200EC1AB8ED090025E851 /* WebKitMouseForceEvent.h */,
+ 93D200EF1AB8ED640025E851 /* WebKitMouseForceEvent.idl */,
D7613A4E1474F13F00DB8606 /* WebKitNamedFlow.cpp */,
D7613A4D1474F13F00DB8606 /* WebKitNamedFlow.h */,
D7613A4A1474EE9500DB8606 /* WebKitNamedFlow.idl */,
@@ -24205,6 +24219,7 @@
7CC289DF1AA0FE5D009A9CE3 /* URLRegistry.h in Headers */,
BC1A37B6097C715F0019F3D8 /* DOMHTML.h in Headers */,
319848081A1E6CB500A13318 /* DOMAnimationEvent.h in Headers */,
+ 93D200F31AB8F8200025E851 /* JSWebKitMouseForceEvent.h in Headers */,
85DF81270AA7787200486AD7 /* DOMHTMLAnchorElement.h in Headers */,
85E7119B0AC5D5350053270F /* DOMHTMLAnchorElementInternal.h in Headers */,
854075690AD6CBF900620C57 /* DOMHTMLAppletElement.h in Headers */,
@@ -26562,6 +26577,7 @@
B2227A390D00BF220071B782 /* SVGLinearGradientElement.h in Headers */,
B2227A3C0D00BF220071B782 /* SVGLineElement.h in Headers */,
0810764412828556007C63BA /* SVGListProperty.h in Headers */,
+ 93D200EE1AB8ED090025E851 /* WebKitMouseForceEvent.h in Headers */,
088A0E09126EF1DB00978F7A /* SVGListPropertyTearOff.h in Headers */,
B2227A410D00BF220071B782 /* SVGLocatable.h in Headers */,
436708EE12D9CA4B00044234 /* SVGMarkerData.h in Headers */,
@@ -27490,6 +27506,7 @@
976D6C78122B8A3D001FD1F7 /* Blob.cpp in Sources */,
2EDEF1F3121B0EFC00726DB2 /* BlobData.cpp in Sources */,
E1D31CDC19196020001005A3 /* BlobDataFileReference.cpp in Sources */,
+ 93D200ED1AB8ED090025E851 /* WebKitMouseForceEvent.cpp in Sources */,
E164A2ED191AE6350010737D /* BlobDataFileReferenceMac.mm in Sources */,
E14A94D716DFDF950068DE82 /* BlobRegistry.cpp in Sources */,
2EDEF1F6121B0EFC00726DB2 /* BlobRegistryImpl.cpp in Sources */,
@@ -27517,6 +27534,7 @@
E47B4BE90E71241600038854 /* CachedResourceHandle.cpp in Sources */,
BCB16C290979C3BD00467741 /* CachedResourceLoader.cpp in Sources */,
5081E3C33CE580C16EF8B48B /* CachedResourceRequest.cpp in Sources */,
+ 93D200F21AB8F81F0025E851 /* JSWebKitMouseForceEvent.cpp in Sources */,
6C638896A96CCEE50C8C946C /* CachedResourceRequestInitiators.cpp in Sources */,
BCB16C230979C3BD00467741 /* CachedScript.cpp in Sources */,
A104F24314C71F7A009E2C23 /* CachedSVGDocument.cpp in Sources */,
Modified: trunk/Source/WebCore/dom/DOMAllInOne.cpp (181906 => 181907)
--- trunk/Source/WebCore/dom/DOMAllInOne.cpp 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/dom/DOMAllInOne.cpp 2015-03-24 21:31:28 UTC (rev 181907)
@@ -149,6 +149,7 @@
#include "ViewportArguments.cpp"
#include "VisitedLinkState.cpp"
#include "WebKitAnimationEvent.cpp"
+#include "WebKitMouseForceEvent.cpp"
#include "WebKitNamedFlow.cpp"
#include "WebKitTransitionEvent.cpp"
#include "WheelEvent.cpp"
Modified: trunk/Source/WebCore/dom/Document.idl (181906 => 181907)
--- trunk/Source/WebCore/dom/Document.idl 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/dom/Document.idl 2015-03-24 21:31:28 UTC (rev 181907)
@@ -296,6 +296,12 @@
[NotEnumerable] attribute EventHandler ontouchstart;
[NotEnumerable] attribute EventHandler onwebkitfullscreenchange;
[NotEnumerable] attribute EventHandler onwebkitfullscreenerror;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforcecancelled;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforcechanged;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforceclick;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforcedown;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforceup;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforcewillbegin;
[NotEnumerable] attribute EventHandler onwebkitwillrevealbottom;
[NotEnumerable] attribute EventHandler onwebkitwillrevealleft;
[NotEnumerable] attribute EventHandler onwebkitwillrevealright;
Modified: trunk/Source/WebCore/dom/Element.cpp (181906 => 181907)
--- trunk/Source/WebCore/dom/Element.cpp 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/dom/Element.cpp 2015-03-24 21:31:28 UTC (rev 181907)
@@ -78,6 +78,7 @@
#include "StyleResolver.h"
#include "TextIterator.h"
#include "VoidCallback.h"
+#include "WebKitMouseForceEvent.h"
#include "WheelEvent.h"
#include "XLinkNames.h"
#include "XMLNSNames.h"
@@ -2106,6 +2107,86 @@
EventDispatcher::dispatchEvent(this, FocusEvent::create(eventNames().blurEvent, false, false, document().defaultView(), 0, WTF::move(newFocusedElement)));
}
+#if ENABLE(MOUSE_FORCE_EVENTS)
+bool Element::dispatchMouseForceWillBegin()
+{
+ Frame* frame = document().frame();
+ if (!frame)
+ return false;
+
+ PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime());
+ RefPtr<Event> mouseForceWillBeginEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforcewillbeginEvent, 0, platformMouseEvent, document().defaultView());
+ mouseForceWillBeginEvent->setTarget(this);
+ dispatchEvent(mouseForceWillBeginEvent);
+
+ if (mouseForceWillBeginEvent->defaultHandled() || mouseForceWillBeginEvent->defaultPrevented())
+ return true;
+ return false;
+}
+
+void Element::dispatchMouseForceChanged(float force, const PlatformMouseEvent& platformMouseEvent)
+{
+ RefPtr<WebKitMouseForceEvent> mouseForceChangedEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforcechangedEvent, force, platformMouseEvent, document().defaultView());
+ mouseForceChangedEvent->setTarget(this);
+ dispatchEvent(mouseForceChangedEvent);
+}
+
+void Element::dispatchMouseForceDown(const PlatformMouseEvent& platformMouseEvent)
+{
+ RefPtr<Event> mouseForceDownEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforcedownEvent, 1, platformMouseEvent, document().defaultView());
+ mouseForceDownEvent->setTarget(this);
+ dispatchEvent(mouseForceDownEvent);
+}
+
+void Element::dispatchMouseForceUp(const PlatformMouseEvent& platformMouseEvent)
+{
+ RefPtr<Event> mouseForceUpEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforceupEvent, 1, platformMouseEvent, document().defaultView());
+ mouseForceUpEvent->setTarget(this);
+ dispatchEvent(mouseForceUpEvent);
+}
+
+void Element::dispatchMouseForceClick(const PlatformMouseEvent& platformMouseEvent)
+{
+ RefPtr<Event> mouseForceClickEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforceclickEvent, 1, platformMouseEvent, document().defaultView());
+ mouseForceClickEvent->setTarget(this);
+ dispatchEvent(mouseForceClickEvent);
+}
+
+void Element::dispatchMouseForceCancelled(const PlatformMouseEvent& platformMouseEvent)
+{
+ RefPtr<Event> mouseForceCancelledEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforcecancelledEvent, 0, platformMouseEvent, document().defaultView());
+ mouseForceCancelledEvent->setTarget(this);
+ dispatchEvent(mouseForceCancelledEvent);
+}
+
+#else // #if ENABLE(MOUSE_FORCE_EVENTS)
+
+bool Element::dispatchMouseForceWillBegin()
+{
+ return false;
+}
+
+void Element::dispatchMouseForceChanged(float, const PlatformMouseEvent&)
+{
+}
+
+void Element::dispatchMouseForceDown(const PlatformMouseEvent&)
+{
+}
+
+void Element::dispatchMouseForceUp(const PlatformMouseEvent&)
+{
+}
+
+void Element::dispatchMouseForceClick(const PlatformMouseEvent&)
+{
+}
+
+void Element::dispatchMouseForceCancelled(const PlatformMouseEvent&)
+{
+}
+#endif // #if ENABLE(MOUSE_FORCE_EVENTS)
+
void Element::mergeWithNextTextNode(Text& node, ExceptionCode& ec)
{
Node* next = node.nextSibling();
Modified: trunk/Source/WebCore/dom/Element.h (181906 => 181907)
--- trunk/Source/WebCore/dom/Element.h 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/dom/Element.h 2015-03-24 21:31:28 UTC (rev 181907)
@@ -468,6 +468,13 @@
virtual void dispatchFocusEvent(RefPtr<Element>&& oldFocusedElement, FocusDirection);
virtual void dispatchBlurEvent(RefPtr<Element>&& newFocusedElement);
+ WEBCORE_EXPORT bool dispatchMouseForceWillBegin();
+ WEBCORE_EXPORT void dispatchMouseForceChanged(float force, const PlatformMouseEvent&);
+ WEBCORE_EXPORT void dispatchMouseForceDown(const PlatformMouseEvent&);
+ WEBCORE_EXPORT void dispatchMouseForceUp(const PlatformMouseEvent&);
+ WEBCORE_EXPORT void dispatchMouseForceClick(const PlatformMouseEvent&);
+ WEBCORE_EXPORT void dispatchMouseForceCancelled(const PlatformMouseEvent&);
+
virtual bool willRecalcStyle(Style::Change);
virtual void didRecalcStyle(Style::Change);
virtual void willResetComputedStyle();
Modified: trunk/Source/WebCore/dom/Element.idl (181906 => 181907)
--- trunk/Source/WebCore/dom/Element.idl 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/dom/Element.idl 2015-03-24 21:31:28 UTC (rev 181907)
@@ -254,6 +254,12 @@
[NotEnumerable] attribute EventHandler onwebkitkeyadded;
[NotEnumerable] attribute EventHandler onwebkitkeyerror;
[NotEnumerable] attribute EventHandler onwebkitkeymessage;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforcecancelled;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforcechanged;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforceclick;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforcedown;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforcewillbegin;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforceup;
[NotEnumerable] attribute EventHandler onwebkitneedkey;
[NotEnumerable] attribute EventHandler onwebkitplaybacktargetavailabilitychanged;
[NotEnumerable] attribute EventHandler onwebkitpresentationmodechanged;
Modified: trunk/Source/WebCore/dom/EventNames.h (181906 => 181907)
--- trunk/Source/WebCore/dom/EventNames.h 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/dom/EventNames.h 2015-03-24 21:31:28 UTC (rev 181907)
@@ -232,6 +232,12 @@
macro(webkitkeyadded) \
macro(webkitkeyerror) \
macro(webkitkeymessage) \
+ macro(webkitmouseforcecancelled) \
+ macro(webkitmouseforcechanged) \
+ macro(webkitmouseforceclick) \
+ macro(webkitmouseforcedown) \
+ macro(webkitmouseforcewillbegin) \
+ macro(webkitmouseforceup) \
macro(webkitneedkey) \
macro(webkitnetworkinfochange) \
macro(webkitplaybacktargetavailabilitychanged) \
Modified: trunk/Source/WebCore/dom/EventNames.in (181906 => 181907)
--- trunk/Source/WebCore/dom/EventNames.in 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/dom/EventNames.in 2015-03-24 21:31:28 UTC (rev 181907)
@@ -28,6 +28,7 @@
UIEvent
UIEvents interfaceName=UIEvent
WebKitAnimationEvent
+WebKitMouseForceEvent
WebKitTransitionEvent
WheelEvent
XMLHttpRequestProgressEvent
Added: trunk/Source/WebCore/dom/WebKitMouseForceEvent.cpp (0 => 181907)
--- trunk/Source/WebCore/dom/WebKitMouseForceEvent.cpp (rev 0)
+++ trunk/Source/WebCore/dom/WebKitMouseForceEvent.cpp 2015-03-24 21:31:28 UTC (rev 181907)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebKitMouseForceEvent.h"
+
+#include "DataTransfer.h"
+#include "EventNames.h"
+#include "PlatformMouseEvent.h"
+
+namespace WebCore {
+
+WebKitMouseForceEvent::WebKitMouseForceEvent()
+{
+}
+
+WebKitMouseForceEvent::WebKitMouseForceEvent(const AtomicString& type, double force, const PlatformMouseEvent& event, PassRefPtr<AbstractView> view)
+ : MouseEvent(type, true, true, event.timestamp(), view, 0, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y()
+#if ENABLE(POINTER_LOCK)
+ , 0, 0
+#endif
+ , event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 0, 0, 0, false)
+ , m_force(force)
+{
+}
+
+WebKitMouseForceEvent::WebKitMouseForceEvent(const AtomicString& type, const WebKitMouseForceEventInit& initializer)
+ : MouseEvent(type, initializer)
+ , m_force(initializer.force)
+{
+}
+
+EventInterface WebKitMouseForceEvent::eventInterface() const
+{
+ return WebKitMouseForceEventInterfaceType;
+}
+
+} // namespace WebCore
Added: trunk/Source/WebCore/dom/WebKitMouseForceEvent.h (0 => 181907)
--- trunk/Source/WebCore/dom/WebKitMouseForceEvent.h (rev 0)
+++ trunk/Source/WebCore/dom/WebKitMouseForceEvent.h 2015-03-24 21:31:28 UTC (rev 181907)
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebKitMouseForceEvent_h
+#define WebKitMouseForceEvent_h
+
+#if ENABLE(MOUSE_FORCE_EVENTS)
+
+#include "MouseEvent.h"
+
+namespace WebCore {
+
+struct WebKitMouseForceEventInit : public MouseEventInit {
+ double force { 0 };
+};
+
+class WebKitMouseForceEvent final : public MouseEvent {
+public:
+ static Ref<WebKitMouseForceEvent> create()
+ {
+ return adoptRef(*new WebKitMouseForceEvent);
+ }
+ static Ref<WebKitMouseForceEvent> create(const AtomicString& type, double force, const PlatformMouseEvent& event, PassRefPtr<AbstractView> view)
+ {
+ return adoptRef(*new WebKitMouseForceEvent(type, force, event, view));
+ }
+ static Ref<WebKitMouseForceEvent> create(const AtomicString& type, const WebKitMouseForceEventInit& initializer)
+ {
+ return adoptRef(*new WebKitMouseForceEvent(type, initializer));
+ }
+
+ double force() const { return m_force; }
+
+private:
+ WebKitMouseForceEvent();
+ WebKitMouseForceEvent(const AtomicString&, double m_force, const PlatformMouseEvent&, PassRefPtr<AbstractView>);
+ WebKitMouseForceEvent(const AtomicString&, const WebKitMouseForceEventInit&);
+
+ virtual EventInterface eventInterface() const override;
+
+ double m_force { 0 };
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MOUSE_FORCE_EVENTS)
+
+#endif // WebKitMouseForceEvent_h
Added: trunk/Source/WebCore/dom/WebKitMouseForceEvent.idl (0 => 181907)
--- trunk/Source/WebCore/dom/WebKitMouseForceEvent.idl (rev 0)
+++ trunk/Source/WebCore/dom/WebKitMouseForceEvent.idl 2015-03-24 21:31:28 UTC (rev 181907)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+ ConstructorTemplate=Event
+] interface WebKitMouseForceEvent : MouseEvent {
+ [InitializedByEventConstructor] readonly attribute double force;
+};
Modified: trunk/Source/WebCore/html/HTMLAttributeNames.in (181906 => 181907)
--- trunk/Source/WebCore/html/HTMLAttributeNames.in 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/html/HTMLAttributeNames.in 2015-03-24 21:31:28 UTC (rev 181907)
@@ -270,6 +270,12 @@
onwebkitkeyadded
onwebkitkeyerror
onwebkitkeymessage
+onwebkitmouseforcecancelled
+onwebkitmouseforcechanged
+onwebkitmouseforceclick
+onwebkitmouseforcedown
+onwebkitmouseforceup
+onwebkitmouseforcewillbegin
onwebkitneedkey
onwebkitsourceclose
onwebkitsourceended
Modified: trunk/Source/WebCore/html/HTMLBodyElement.cpp (181906 => 181907)
--- trunk/Source/WebCore/html/HTMLBodyElement.cpp 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/html/HTMLBodyElement.cpp 2015-03-24 21:31:28 UTC (rev 181907)
@@ -117,6 +117,12 @@
&onscrollAttr,
&onstorageAttr,
&onunloadAttr,
+ &onwebkitmouseforcecancelledAttr,
+ &onwebkitmouseforcechangedAttr,
+ &onwebkitmouseforceclickAttr,
+ &onwebkitmouseforcedownAttr,
+ &onwebkitmouseforceupAttr,
+ &onwebkitmouseforcewillbeginAttr,
&onwebkitwillrevealbottomAttr,
&onwebkitwillrevealleftAttr,
&onwebkitwillrevealrightAttr,
Modified: trunk/Source/WebCore/html/HTMLBodyElement.idl (181906 => 181907)
--- trunk/Source/WebCore/html/HTMLBodyElement.idl 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/html/HTMLBodyElement.idl 2015-03-24 21:31:28 UTC (rev 181907)
@@ -45,6 +45,12 @@
[NotEnumerable, WindowEventHandler] attribute EventHandler onscroll;
[NotEnumerable, WindowEventHandler] attribute EventHandler onstorage;
[NotEnumerable, WindowEventHandler] attribute EventHandler onunload;
+ [NotEnumerable, WindowEventHandler] attribute EventHandler onwebkitmouseforcecancelled;
+ [NotEnumerable, WindowEventHandler] attribute EventHandler onwebkitmouseforcechanged;
+ [NotEnumerable, WindowEventHandler] attribute EventHandler onwebkitmouseforceclick;
+ [NotEnumerable, WindowEventHandler] attribute EventHandler onwebkitmouseforcedown;
+ [NotEnumerable, WindowEventHandler] attribute EventHandler onwebkitmouseforcewillbegin;
+ [NotEnumerable, WindowEventHandler] attribute EventHandler onwebkitmouseforceup;
[NotEnumerable, WindowEventHandler] attribute EventHandler onwebkitwillrevealbottom;
[NotEnumerable, WindowEventHandler] attribute EventHandler onwebkitwillrevealleft;
[NotEnumerable, WindowEventHandler] attribute EventHandler onwebkitwillrevealright;
Modified: trunk/Source/WebCore/html/HTMLElement.cpp (181906 => 181907)
--- trunk/Source/WebCore/html/HTMLElement.cpp 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/html/HTMLElement.cpp 2015-03-24 21:31:28 UTC (rev 181907)
@@ -338,6 +338,12 @@
&onwebkitkeyaddedAttr,
&onwebkitkeyerrorAttr,
&onwebkitkeymessageAttr,
+ &onwebkitmouseforcecancelledAttr,
+ &onwebkitmouseforcechangedAttr,
+ &onwebkitmouseforceclickAttr,
+ &onwebkitmouseforcedownAttr,
+ &onwebkitmouseforcewillbeginAttr,
+ &onwebkitmouseforceupAttr,
&onwebkitneedkeyAttr,
&onwebkitplaybacktargetavailabilitychangedAttr,
&onwebkitpresentationmodechangedAttr,
Modified: trunk/Source/WebCore/page/DOMWindow.idl (181906 => 181907)
--- trunk/Source/WebCore/page/DOMWindow.idl 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/page/DOMWindow.idl 2015-03-24 21:31:28 UTC (rev 181907)
@@ -269,6 +269,12 @@
[NotEnumerable] attribute EventHandler onwebkitanimationiteration;
[NotEnumerable] attribute EventHandler onwebkitanimationstart;
[NotEnumerable] attribute EventHandler onwebkitdeviceproximity;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforcecancelled;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforcechanged;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforceclick;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforcedown;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforceup;
+ [NotEnumerable] attribute EventHandler onwebkitmouseforcewillbegin;
[NotEnumerable] attribute EventHandler onwebkittransitionend;
[NotEnumerable] attribute EventHandler onwebkitwillrevealbottom;
[NotEnumerable] attribute EventHandler onwebkitwillrevealleft;
Modified: trunk/Source/WebCore/page/EventHandler.cpp (181906 => 181907)
--- trunk/Source/WebCore/page/EventHandler.cpp 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2015-03-24 21:31:28 UTC (rev 181907)
@@ -4022,6 +4022,11 @@
m_lastKnownMouseGlobalPosition = event.globalPosition();
}
+const PlatformMouseEvent& EventHandler::lastMouseDownEvent() const
+{
+ return m_mouseDown;
+}
+
void EventHandler::setImmediateActionStage(ImmediateActionStage stage)
{
m_immediateActionStage = stage;
Modified: trunk/Source/WebCore/page/EventHandler.h (181906 => 181907)
--- trunk/Source/WebCore/page/EventHandler.h 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebCore/page/EventHandler.h 2015-03-24 21:31:28 UTC (rev 181907)
@@ -180,6 +180,7 @@
void resizeLayerDestroyed();
IntPoint lastKnownMousePosition() const;
+ IntPoint lastKnownMouseGlobalPosition() const { return m_lastKnownMouseGlobalPosition; }
Cursor currentMouseCursor() const { return m_currentMouseCursor; }
static Frame* subframeForTargetNode(Node*);
@@ -313,6 +314,7 @@
bool isHandlingWheelEvent() const { return m_isHandlingWheelEvent; }
WEBCORE_EXPORT void setImmediateActionStage(ImmediateActionStage stage);
+ WEBCORE_EXPORT const PlatformMouseEvent& lastMouseDownEvent() const;
private:
#if ENABLE(DRAG_SUPPORT)
Modified: trunk/Source/WebKit2/ChangeLog (181906 => 181907)
--- trunk/Source/WebKit2/ChangeLog 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebKit2/ChangeLog 2015-03-24 21:31:28 UTC (rev 181907)
@@ -1,3 +1,55 @@
+2015-03-24 Beth Dakin <[email protected]>
+
+ Add events related to force click gesture
+ https://bugs.webkit.org/show_bug.cgi?id=142836
+ -and corresponding-
+ rdar://problem/20210239
+
+ Reviewed by Dean Jackson.
+
+ ActionMenuHitTestResult has a new bool indicating whether to not the HitTestResult
+ will prevent default.
+ * Shared/mac/ActionMenuHitTestResult.h:
+ * Shared/mac/ActionMenuHitTestResult.mm:
+ (WebKit::ActionMenuHitTestResult::encode):
+ (WebKit::ActionMenuHitTestResult::decode):
+
+ Send immediateActionDidUpdate and the normalized force over the the WebProcess.
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::immediateActionDidUpdate):
+ * UIProcess/WebPageProxy.h:
+
+ We need a dummy animation controller when web content is overriding the default
+ behavior.
+ * UIProcess/mac/WKImmediateActionController.mm:
+
+ Send along the update information.
+ (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
+
+ Use the dummy animation controller if default has been prevented.
+ (-[WKImmediateActionController _defaultAnimationController]):
+ (-[WKImmediateActionController _updateImmediateActionItem]):
+
+ Keep track of whether m_lastActionMenuHitTes prevented the default immediate
+ action behavior.
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+
+ Call dispatchMouseForceMayBegin() at hit test time.
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+ (WebKit::WebPage::performActionMenuHitTestAtLocation):
+
+ Call dispatchMouseForceChanged() if appropriate.
+ (WebKit::WebPage::immediateActionDidUpdate):
+
+ Call dispatchMouseForceCancelled() if appropriate.
+ (WebKit::WebPage::immediateActionDidCancel):
+
+ Call dispatchMouseForceDown() if appropriate.
+ (WebKit::WebPage::immediateActionDidComplete):
+
2015-03-24 Anders Carlsson <[email protected]>
Fix designated initializer violations
Modified: trunk/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.h (181906 => 181907)
--- trunk/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.h 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.h 2015-03-24 21:31:28 UTC (rev 181907)
@@ -65,6 +65,8 @@
DictionaryPopupInfo dictionaryPopupInfo;
RefPtr<WebCore::TextIndicator> linkTextIndicator;
+
+ bool contentPreventsDefault;
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.mm (181906 => 181907)
--- trunk/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.mm 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.mm 2015-03-24 21:31:28 UTC (rev 181907)
@@ -76,6 +76,8 @@
encoder << hasLinkTextIndicator;
if (hasLinkTextIndicator)
encoder << linkTextIndicator->data();
+
+ encoder << contentPreventsDefault;
}
bool ActionMenuHitTestResult::decode(IPC::ArgumentDecoder& decoder, ActionMenuHitTestResult& actionMenuHitTestResult)
@@ -156,6 +158,9 @@
actionMenuHitTestResult.linkTextIndicator = WebCore::TextIndicator::create(indicatorData);
}
+ if (!decoder.decode(actionMenuHitTestResult.contentPreventsDefault))
+ return false;
+
return true;
}
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (181906 => 181907)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2015-03-24 21:31:28 UTC (rev 181907)
@@ -5570,6 +5570,11 @@
m_process->send(Messages::WebPage::FocusAndSelectLastActionMenuHitTestResult(), m_pageID);
}
+void WebPageProxy::immediateActionDidUpdate(float force)
+{
+ m_process->send(Messages::WebPage::ImmediateActionDidUpdate(force), m_pageID);
+}
+
void WebPageProxy::immediateActionDidCancel()
{
m_process->send(Messages::WebPage::ImmediateActionDidCancel(), m_pageID);
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (181906 => 181907)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2015-03-24 21:31:28 UTC (rev 181907)
@@ -988,6 +988,7 @@
void selectLastActionMenuRange();
void focusAndSelectLastActionMenuHitTestResult();
+ void immediateActionDidUpdate(float force);
void immediateActionDidCancel();
void immediateActionDidComplete();
Modified: trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm (181906 => 181907)
--- trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm 2015-03-24 21:31:28 UTC (rev 181907)
@@ -53,6 +53,13 @@
@interface WKImmediateActionController () <QLPreviewMenuItemDelegate>
@end
+@interface WebAnimationController : NSObject <NSImmediateActionAnimationController> {
+}
+@end
+
+@implementation WebAnimationController
+@end
+
@implementation WKImmediateActionController
- (instancetype)initWithPage:(WebPageProxy&)page view:(WKView *)wkView recognizer:(NSImmediateActionGestureRecognizer *)immediateActionRecognizer
@@ -205,6 +212,11 @@
if (immediateActionRecognizer != _immediateActionRecognizer)
return;
+ if (_hitTestResult.contentPreventsDefault) {
+ _page->immediateActionDidUpdate([immediateActionRecognizer animationProgress]);
+ return;
+ }
+
_page->setTextIndicatorAnimationProgress([immediateActionRecognizer animationProgress]);
}
@@ -249,6 +261,11 @@
- (id <NSImmediateActionAnimationController>)_defaultAnimationController
{
+ if (_hitTestResult.contentPreventsDefault) {
+ RetainPtr<WebAnimationController> dummyController = [[WebAnimationController alloc] init];
+ return dummyController.get();
+ }
+
RefPtr<WebHitTestResult> hitTestResult = [self _webHitTestResult];
if (!hitTestResult)
@@ -289,6 +306,11 @@
id <NSImmediateActionAnimationController> defaultAnimationController = [self _defaultAnimationController];
+ if (_hitTestResult.contentPreventsDefault) {
+ [_immediateActionRecognizer.get() setAnimationController:defaultAnimationController];
+ return;
+ }
+
RefPtr<WebHitTestResult> hitTestResult = [self _webHitTestResult];
id customClientAnimationController = [_wkView _immediateActionAnimationControllerForHitTestResult:toAPI(hitTestResult.get()) withType:_type userData:toAPI(_userData.get())];
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (181906 => 181907)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-03-24 21:31:28 UTC (rev 181907)
@@ -340,6 +340,9 @@
#if ENABLE(WEBGL)
, m_systemWebGLPolicy(WebGLAllowCreation)
#endif
+#if PLATFORM(MAC)
+ , m_lastActionMenuHitTestPreventsDefault(false)
+#endif
, m_mainFrameProgressCompleted(false)
, m_shouldDispatchFakeMouseMoveEvents(true)
{
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (181906 => 181907)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2015-03-24 21:31:28 UTC (rev 181907)
@@ -1084,6 +1084,7 @@
PassRefPtr<WebCore::Range> lookupTextAtLocation(WebCore::FloatPoint, NSDictionary **options);
void selectLastActionMenuRange();
void focusAndSelectLastActionMenuHitTestResult();
+ void immediateActionDidUpdate(float force);
void immediateActionDidCancel();
void immediateActionDidComplete();
void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits);
@@ -1341,6 +1342,7 @@
RefPtr<WebCore::Range> m_lastActionMenuRangeForSelection;
WebCore::HitTestResult m_lastActionMenuHitTestResult;
RefPtr<WebPageOverlay> m_lastActionMenuHitPageOverlay;
+ bool m_lastActionMenuHitTestPreventsDefault;
#endif
bool m_mainFrameProgressCompleted;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (181906 => 181907)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2015-03-24 21:31:28 UTC (rev 181907)
@@ -405,6 +405,7 @@
PerformActionMenuHitTestAtLocation(WebCore::FloatPoint location, bool forImmediateAction)
SelectLastActionMenuRange()
FocusAndSelectLastActionMenuHitTestResult()
+ ImmediateActionDidUpdate(float force)
ImmediateActionDidCancel()
ImmediateActionDidComplete()
DataDetectorsDidPresentUI(WebCore::PageOverlay::PageOverlayID pageOverlay)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (181906 => 181907)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2015-03-24 21:17:26 UTC (rev 181906)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2015-03-24 21:31:28 UTC (rev 181907)
@@ -1024,12 +1024,19 @@
IntPoint locationInContentCoordinates = mainFrame.view()->rootViewToContents(roundedIntPoint(locationInViewCooordinates));
HitTestResult hitTestResult = mainFrame.eventHandler().hitTestResultAtPoint(locationInContentCoordinates);
- if (forImmediateAction)
+ m_lastActionMenuHitTestPreventsDefault = false;
+ Element* element = hitTestResult.innerElement();
+
+ if (forImmediateAction) {
mainFrame.eventHandler().setImmediateActionStage(ImmediateActionStage::PerformedHitTest);
+ if (element)
+ m_lastActionMenuHitTestPreventsDefault = element->dispatchMouseForceWillBegin();
+ }
ActionMenuHitTestResult actionMenuResult;
actionMenuResult.hitTestLocationInViewCooordinates = locationInViewCooordinates;
actionMenuResult.hitTestResult = WebHitTestResult::Data(hitTestResult);
+ actionMenuResult.contentPreventsDefault = m_lastActionMenuHitTestPreventsDefault;
RefPtr<Range> selectionRange = corePage()->focusController().focusedOrMainFrame().selection().selection().firstRange();
@@ -1149,14 +1156,44 @@
frame->selection().setSelection(position);
}
+void WebPage::immediateActionDidUpdate(float force)
+{
+ Element* element = m_lastActionMenuHitTestResult.innerElement();
+ if (!element)
+ return;
+
+ if (!m_lastActionMenuHitTestPreventsDefault)
+ return;
+
+ element->dispatchMouseForceChanged(force, m_page->mainFrame().eventHandler().lastMouseDownEvent());
+}
+
void WebPage::immediateActionDidCancel()
{
m_page->mainFrame().eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCancelled);
+
+ Element* element = m_lastActionMenuHitTestResult.innerElement();
+ if (!element)
+ return;
+
+ if (!m_lastActionMenuHitTestPreventsDefault)
+ return;
+
+ element->dispatchMouseForceCancelled(m_page->mainFrame().eventHandler().lastMouseDownEvent());
}
void WebPage::immediateActionDidComplete()
{
m_page->mainFrame().eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCompleted);
+
+ Element* element = m_lastActionMenuHitTestResult.innerElement();
+ if (!element)
+ return;
+
+ if (!m_lastActionMenuHitTestPreventsDefault)
+ return;
+
+ element->dispatchMouseForceDown(m_page->mainFrame().eventHandler().lastMouseDownEvent());
}
void WebPage::dataDetectorsDidPresentUI(PageOverlay::PageOverlayID overlayID)