Add force property to MouseEvents
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Apr 2015 19:17:48 +0000 (19:17 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Apr 2015 19:17:48 +0000 (19:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143569
-and corresponding-
rdar://problem/20472954

Reviewed by Darin Adler.

Source/WebCore:

This patch removes WebKitMouseForceEvent and uses a MouseEvent everywhere that it
was used. That’s possible because this patch also adds a force property to all
MouseEvents and to PlatformMouseEvent.

Remove WebKitMouseForceEvent.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:

Create MouseEvents with the appropriate force instead of WebKitMouseForceEvents.
This patch also gets rid of the PlatformMouseEvent parameter for these events.
They were re-using the cached mousedown event before, which they never should have
done. Instead, we create PlatformMouseEvents inside these functions and then use
that to make MouseEvents.
* dom/Element.cpp:
(WebCore::Element::dispatchMouseForceWillBegin):
(WebCore::Element::dispatchMouseForceChanged):
(WebCore::Element::dispatchMouseForceDown):
(WebCore::Element::dispatchMouseForceUp):
(WebCore::Element::dispatchMouseForceClick):
(WebCore::Element::dispatchMouseForceCancelled):
* dom/Element.h:

No More WebKitMouseForceEvent.
* dom/EventNames.in:

Add force to MouseEvent.
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
(WebCore::MouseEvent::MouseEvent):
(WebCore::MouseEvent::cloneFor):
(WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
* dom/MouseEvent.h:
(WebCore::MouseEvent::force):
(WebCore::MouseEvent::setForce):
* dom/MouseEvent.idl:

No More WebKitMouseForceEvent.
* dom/WebKitMouseForceEvent.cpp: Removed.
* dom/WebKitMouseForceEvent.h: Removed.
* dom/WebKitMouseForceEvent.idl: Removed.

PlatformMouseEvent now takes a force parameter.
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::showContextMenuAt):
* page/DragController.cpp:
(WebCore::createMouseEvent):
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchDragEvent):
(WebCore::EventHandler::sendContextMenuEventForKey):
(WebCore::EventHandler::fakeMouseMoveEventTimerFired):

We don’t need lastMouseDownEvent() anymore. We were using it to avoid creating new
PlatformMouseEvents for the force events, but we fix that in this patch.
(WebCore::EventHandler::lastMouseDownEvent): Deleted.
* page/EventHandler.h:

At force to PlatformMouseEvent.
* platform/PlatformMouseEvent.h:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
(WebCore::PlatformMouseEvent::force):
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformMouseEvent>::encodeValue):
(JSC::EncodingTraits<PlatformMouseEvent>::decodeValue):

Source/WebKit/ios:

Send the appropriate force with this simulated click event.
* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]):

Source/WebKit/mac:

PlatformMouseEvent and MouseEvent now take force parameters.
* WebView/WebFrame.mm:
(-[WebFrame _dragSourceEndedAt:operation:]):
* WebView/WebPDFView.mm:
(-[WebPDFView PDFViewWillClickOnLink:withURL:]):

Source/WebKit/win:

PlatformMouseEvent takes a force parameter.
* WebDropSource.cpp:
(generateMouseEvent):

Source/WebKit2:

In order to accommodate adding force to all PlatformMouseEvents, we have to add it
to pass a caches pressure event to NativeWebMouseEvent and add force to
WebMouseEvent.

NativeWebMouseEvent now requires a second NSEvent for the pressureEvent.
* Shared/NativeWebMouseEvent.h:

WebMouseEvent takes a force parameter.
* Shared/WebEvent.h:
(WebKit::WebMouseEvent::force):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
* Shared/WebMouseEvent.cpp:
(WebKit::WebMouseEvent::WebMouseEvent):
(WebKit::WebMouseEvent::encode):
(WebKit::WebMouseEvent::decode):
* Shared/mac/NativeWebMouseEventMac.mm:
(WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
* Shared/mac/WebEventFactory.h:
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebMouseEvent):

Cache the most recent pressureEvent in _data so that it can be sent along to the
NativeWebMouseEvent constructor.
* UIProcess/API/mac/WKView.mm:
(-[WKView pressureChangeWithEvent:]):
(-[WKView acceptsFirstMouse:]):
(-[WKView shouldDelayWindowOrderingForEvent:]):
(-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]):
(-[WKView initWithFrame:processPool:configuration:webView:]):

WebMouseEvent takes a force parameter.
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::showContextMenuAtPoint):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::createWebEvent):

MouseEvent and PlatformMouseEvent both take force parameters too.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::navigateToURLWithSimulatedClick):
(WebKit::WebPage::contextMenuAtPointInWindow):
(WebKit::WebPage::dragEnded):
(WebKit::WebPage::simulateMouseDown):
(WebKit::WebPage::simulateMouseUp):
(WebKit::WebPage::simulateMouseMotion):

The functions that dispatch the force events no longer take a PlatformMouseEvent
as a parameter.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::inputDeviceForceDidChange):
(WebKit::WebPage::immediateActionDidCancel):

LayoutTests:

* platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:

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

49 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/DOMAllInOne.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/EventNames.in
Source/WebCore/dom/MouseEvent.cpp
Source/WebCore/dom/MouseEvent.h
Source/WebCore/dom/MouseEvent.idl
Source/WebCore/dom/WebKitMouseForceEvent.cpp [deleted file]
Source/WebCore/dom/WebKitMouseForceEvent.h [deleted file]
Source/WebCore/dom/WebKitMouseForceEvent.idl [deleted file]
Source/WebCore/dom/WheelEvent.cpp
Source/WebCore/page/ContextMenuController.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/EventHandler.h
Source/WebCore/platform/PlatformMouseEvent.h
Source/WebCore/replay/SerializationMethods.cpp
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/mac/WebView/WebPDFView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebDropSource.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/NativeWebMouseEvent.h
Source/WebKit2/Shared/WebEvent.h
Source/WebKit2/Shared/WebEventConversion.cpp
Source/WebKit2/Shared/WebMouseEvent.cpp
Source/WebKit2/Shared/mac/NativeWebMouseEventMac.mm
Source/WebKit2/Shared/mac/WebEventFactory.h
Source/WebKit2/Shared/mac/WebEventFactory.mm
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

index 1cb78be..c7ee706 100644 (file)
@@ -1,3 +1,16 @@
+2015-04-13  Beth Dakin  <bdakin@apple.com>
+
+        Add force property to MouseEvents
+        https://bugs.webkit.org/show_bug.cgi?id=143569
+        -and corresponding-
+        rdar://problem/20472954
+
+        Reviewed by Darin Adler.
+
+        * platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac/js/dom/global-constructors-attributes-expected.txt:
+        * platform/win/js/dom/global-constructors-attributes-expected.txt:
+
 2015-04-13  Simon Fraser  <simon.fraser@apple.com>
 
         Fixed position element is truncated if moved onscreen by a transform
index 064a6b3..c77557e 100644 (file)
@@ -2003,11 +2003,6 @@ PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeys').hasOwnProperty('
 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, 'WebKitMouseForceEvent').value is WebKitMouseForceEvent
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').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
index 1340266..4f871fa 100644 (file)
@@ -2023,11 +2023,6 @@ PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeys').hasOwnProperty('
 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, 'WebKitMouseForceEvent').value is WebKitMouseForceEvent
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').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
index 589418a..d6f5ed0 100644 (file)
@@ -1808,11 +1808,6 @@ PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeys').hasOwnProperty('
 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, 'WebKitMouseForceEvent').value is WebKitMouseForceEvent
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').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
index 1ec3479..469dc66 100644 (file)
@@ -428,7 +428,6 @@ set(WebCore_NON_SVG_IDL_FILES
     dom/TreeWalker.idl
     dom/UIEvent.idl
     dom/WebKitAnimationEvent.idl
-    dom/WebKitMouseForceEvent.idl
     dom/WebKitNamedFlow.idl
     dom/WebKitTransitionEvent.idl
     dom/WheelEvent.idl
@@ -1456,7 +1455,6 @@ set(WebCore_SOURCES
     dom/ViewportArguments.cpp
     dom/VisitedLinkState.cpp
     dom/WebKitAnimationEvent.cpp
-    dom/WebKitMouseForceEvent.cpp
     dom/WebKitNamedFlow.cpp
     dom/WebKitTransitionEvent.cpp
     dom/WheelEvent.cpp
index 88ad56c..8563205 100644 (file)
@@ -1,3 +1,83 @@
+2015-04-13  Beth Dakin  <bdakin@apple.com>
+
+        Add force property to MouseEvents
+        https://bugs.webkit.org/show_bug.cgi?id=143569
+        -and corresponding-
+        rdar://problem/20472954
+
+        Reviewed by Darin Adler.
+
+        This patch removes WebKitMouseForceEvent and uses a MouseEvent everywhere that it 
+        was used. That’s possible because this patch also adds a force property to all 
+        MouseEvents and to PlatformMouseEvent.
+
+        Remove WebKitMouseForceEvent.
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/DOMAllInOne.cpp:
+
+        Create MouseEvents with the appropriate force instead of WebKitMouseForceEvents. 
+        This patch also gets rid of the PlatformMouseEvent parameter for these events. 
+        They were re-using the cached mousedown event before, which they never should have 
+        done. Instead, we create PlatformMouseEvents inside these functions and then use 
+        that to make MouseEvents.
+        * dom/Element.cpp:
+        (WebCore::Element::dispatchMouseForceWillBegin):
+        (WebCore::Element::dispatchMouseForceChanged):
+        (WebCore::Element::dispatchMouseForceDown):
+        (WebCore::Element::dispatchMouseForceUp):
+        (WebCore::Element::dispatchMouseForceClick):
+        (WebCore::Element::dispatchMouseForceCancelled):
+        * dom/Element.h:
+
+        No More WebKitMouseForceEvent.
+        * dom/EventNames.in:
+
+        Add force to MouseEvent.
+        * dom/MouseEvent.cpp:
+        (WebCore::MouseEvent::create):
+        (WebCore::MouseEvent::MouseEvent):
+        (WebCore::MouseEvent::cloneFor):
+        (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
+        * dom/MouseEvent.h:
+        (WebCore::MouseEvent::force):
+        (WebCore::MouseEvent::setForce):
+        * dom/MouseEvent.idl:
+
+        No More WebKitMouseForceEvent.
+        * dom/WebKitMouseForceEvent.cpp: Removed.
+        * dom/WebKitMouseForceEvent.h: Removed.
+        * dom/WebKitMouseForceEvent.idl: Removed.
+
+        PlatformMouseEvent now takes a force parameter.
+        * dom/WheelEvent.cpp:
+        (WebCore::WheelEvent::WheelEvent):
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::showContextMenuAt):
+        * page/DragController.cpp:
+        (WebCore::createMouseEvent):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::dispatchDragEvent):
+        (WebCore::EventHandler::sendContextMenuEventForKey):
+        (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
+
+        We don’t need lastMouseDownEvent() anymore. We were using it to avoid creating new 
+        PlatformMouseEvents for the force events, but we fix that in this patch.
+        (WebCore::EventHandler::lastMouseDownEvent): Deleted.
+        * page/EventHandler.h:
+
+        At force to PlatformMouseEvent.
+        * platform/PlatformMouseEvent.h:
+        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
+        (WebCore::PlatformMouseEvent::force):
+        * replay/SerializationMethods.cpp:
+        (JSC::EncodingTraits<PlatformMouseEvent>::encodeValue):
+        (JSC::EncodingTraits<PlatformMouseEvent>::decodeValue):
+
 2015-04-13  Andreas Kling  <akling@apple.com>
 
         Don't segregate heap objects based on Structure immortality.
index 3301906..be6c757 100644 (file)
 #include "JSWebKitCSSTransformValue.cpp"
 #include "JSWebKitCSSMatrix.cpp"
 #include "JSWebKitCSSRegionRule.cpp"
-#include "JSWebKitMouseForceEvent.cpp"
 #include "JSWebKitNamedFlow.cpp"
 #include "JSWebKitPoint.cpp"
 #include "JSWebKitTransitionEvent.cpp"
index 10b09c7..28adcca 100644 (file)
@@ -314,7 +314,6 @@ NON_SVG_BINDING_IDLS = \
     $(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 \
index decdd53..04d47c6 100644 (file)
       <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>
       <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>
     <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" />
     <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" />
index bc0a666..8b4af32 100644 (file)
     <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>
     <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>
     <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>
     <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>
index 19bc469..f25b003 100644 (file)
                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, ); }; };
                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>"; };
                                A86629C909DA2B47009633A5 /* JSUIEvent.h */,
                                31C0FF390E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.cpp */,
                                31C0FF3A0E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.h */,
-                               93D200F01AB8F81F0025E851 /* JSWebKitMouseForceEvent.cpp */,
-                               93D200F11AB8F81F0025E851 /* JSWebKitMouseForceEvent.h */,
                                31C0FF3B0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp */,
                                31C0FF3C0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h */,
                                65DF31F109D1CC60000BE325 /* JSWheelEvent.cpp */,
                                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 */,
                                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 */,
                                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 */,
                                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 */,
                                BCB16C290979C3BD00467741 /* CachedResourceLoader.cpp in Sources */,
                                4634592C1AC2271000ECB71C /* PowerObserverMac.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 */,
index 3e7394f..a6d00b7 100644 (file)
 #include "ViewportArguments.cpp"
 #include "VisitedLinkState.cpp"
 #include "WebKitAnimationEvent.cpp"
-#include "WebKitMouseForceEvent.cpp"
 #include "WebKitNamedFlow.cpp"
 #include "WebKitTransitionEvent.cpp"
 #include "WheelEvent.cpp"
index 5148f35..b7fb864 100644 (file)
@@ -79,7 +79,6 @@
 #include "StyleResolver.h"
 #include "TextIterator.h"
 #include "VoidCallback.h"
-#include "WebKitMouseForceEvent.h"
 #include "WheelEvent.h"
 #include "XLinkNames.h"
 #include "XMLNSNames.h"
@@ -2244,8 +2243,8 @@ bool Element::dispatchMouseForceWillBegin()
     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());
+    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtClick);
+    RefPtr<MouseEvent> mouseForceWillBeginEvent =  MouseEvent::create(eventNames().webkitmouseforcewillbeginEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
     mouseForceWillBeginEvent->setTarget(this);
     dispatchEvent(mouseForceWillBeginEvent);
 
@@ -2254,52 +2253,82 @@ bool Element::dispatchMouseForceWillBegin()
     return false;
 }
 
-void Element::dispatchMouseForceChanged(float force, const PlatformMouseEvent& platformMouseEvent)
+void Element::dispatchMouseForceChanged(float force)
 {
     if (!document().hasListenerType(Document::FORCECHANGED_LISTENER))
         return;
 
-    RefPtr<WebKitMouseForceEvent> mouseForceChangedEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforcechangedEvent, force, platformMouseEvent, document().defaultView());
+    Frame* frame = document().frame();
+    if (!frame)
+        return;
+
+    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), force);
+    RefPtr<MouseEvent> mouseForceChangedEvent =  MouseEvent::create(eventNames().webkitmouseforcechangedEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
+
     mouseForceChangedEvent->setTarget(this);
     dispatchEvent(mouseForceChangedEvent);
 }
 
-void Element::dispatchMouseForceDown(const PlatformMouseEvent& platformMouseEvent)
+void Element::dispatchMouseForceDown()
 {
     if (!document().hasListenerType(Document::FORCEDOWN_LISTENER))
         return;
 
-    RefPtr<Event> mouseForceDownEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforcedownEvent, 1, platformMouseEvent, document().defaultView());
+    Frame* frame = document().frame();
+    if (!frame)
+        return;
+
+    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtForceClick);
+    RefPtr<MouseEvent> mouseForceDownEvent =  MouseEvent::create(eventNames().webkitmouseforcedownEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
+
     mouseForceDownEvent->setTarget(this);
     dispatchEvent(mouseForceDownEvent);
 }
 
-void Element::dispatchMouseForceUp(const PlatformMouseEvent& platformMouseEvent)
+void Element::dispatchMouseForceUp()
 {
     if (!document().hasListenerType(Document::FORCEUP_LISTENER))
         return;
 
-    RefPtr<Event> mouseForceUpEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforceupEvent, 1, platformMouseEvent, document().defaultView());
+    Frame* frame = document().frame();
+    if (!frame)
+        return;
+
+    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtForceClick);
+    RefPtr<MouseEvent> mouseForceUpEvent =  MouseEvent::create(eventNames().webkitmouseforceupEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
+
     mouseForceUpEvent->setTarget(this);
     dispatchEvent(mouseForceUpEvent);
 }
 
-void Element::dispatchMouseForceClick(const PlatformMouseEvent& platformMouseEvent)
+void Element::dispatchMouseForceClick()
 {
     if (!document().hasListenerType(Document::FORCECLICK_LISTENER))
         return;
 
-    RefPtr<Event> mouseForceClickEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforceclickEvent, 1, platformMouseEvent, document().defaultView());
+    Frame* frame = document().frame();
+    if (!frame)
+        return;
+
+    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtForceClick);
+    RefPtr<MouseEvent> mouseForceClickEvent =  MouseEvent::create(eventNames().webkitmouseforceclickEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
+
     mouseForceClickEvent->setTarget(this);
     dispatchEvent(mouseForceClickEvent);
 }
 
-void Element::dispatchMouseForceCancelled(const PlatformMouseEvent& platformMouseEvent)
+void Element::dispatchMouseForceCancelled()
 {
     if (!document().hasListenerType(Document::FORCECANCELLED_LISTENER))
         return;
 
-    RefPtr<Event> mouseForceCancelledEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforcecancelledEvent, 0, platformMouseEvent, document().defaultView());
+    Frame* frame = document().frame();
+    if (!frame)
+        return;
+
+    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), 0);
+    RefPtr<MouseEvent> mouseForceCancelledEvent =  MouseEvent::create(eventNames().webkitmouseforcecancelledEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
+
     mouseForceCancelledEvent->setTarget(this);
     dispatchEvent(mouseForceCancelledEvent);
 }
@@ -2311,23 +2340,23 @@ bool Element::dispatchMouseForceWillBegin()
     return false;
 }
 
-void Element::dispatchMouseForceChanged(float, const PlatformMouseEvent&)
+void Element::dispatchMouseForceChanged(float)
 {
 }
 
-void Element::dispatchMouseForceDown(const PlatformMouseEvent&)
+void Element::dispatchMouseForceDown()
 {
 }
 
-void Element::dispatchMouseForceUp(const PlatformMouseEvent&)
+void Element::dispatchMouseForceUp()
 {
 }
 
-void Element::dispatchMouseForceClick(const PlatformMouseEvent&)
+void Element::dispatchMouseForceClick()
 {
 }
 
-void Element::dispatchMouseForceCancelled(const PlatformMouseEvent&)
+void Element::dispatchMouseForceCancelled()
 {
 }
 #endif // #if ENABLE(MOUSE_FORCE_EVENTS)
index c900960..2a79885 100644 (file)
@@ -469,11 +469,11 @@ public:
     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&);
+    WEBCORE_EXPORT void dispatchMouseForceChanged(float force);
+    WEBCORE_EXPORT void dispatchMouseForceDown();
+    WEBCORE_EXPORT void dispatchMouseForceUp();
+    WEBCORE_EXPORT void dispatchMouseForceClick();
+    WEBCORE_EXPORT void dispatchMouseForceCancelled();
 
     virtual bool willRecalcStyle(Style::Change);
     virtual void didRecalcStyle(Style::Change);
index dfe9ddd..c74f685 100644 (file)
@@ -28,7 +28,6 @@ TransitionEvent
 UIEvent
 UIEvents interfaceName=UIEvent
 WebKitAnimationEvent
-WebKitMouseForceEvent
 WebKitTransitionEvent
 WheelEvent
 XMLHttpRequestProgressEvent
index 7b7cbd1..66b310e 100644 (file)
@@ -66,7 +66,7 @@ Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRefPtr<Abs
         event.movementDelta().x(), event.movementDelta().y(),
 #endif
         event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.button(),
-        relatedTarget);
+        relatedTarget, event.force());
 }
 
 Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView> view,
@@ -75,7 +75,7 @@ Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, boo
     int movementX, int movementY,
 #endif
     bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
-    PassRefPtr<EventTarget> relatedTarget)
+    PassRefPtr<EventTarget> relatedTarget, double force)
 
 {
     return MouseEvent::create(type, canBubble, cancelable, timestamp, view,
@@ -83,7 +83,7 @@ Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, boo
 #if ENABLE(POINTER_LOCK)
         movementX, movementY,
 #endif
-        ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, 0, false);
+        ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, force, 0, false);
 }
 
 Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView> view,
@@ -92,14 +92,14 @@ Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, boo
     int movementX, int movementY,
 #endif
     bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
-    PassRefPtr<EventTarget> relatedTarget, PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
+    PassRefPtr<EventTarget> relatedTarget, double force, PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
 {
     return adoptRef(*new MouseEvent(type, canBubble, cancelable, timestamp, view,
         detail, screenX, screenY, pageX, pageY,
 #if ENABLE(POINTER_LOCK)
         movementX, movementY,
 #endif
-        ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, dataTransfer, isSimulated));
+        ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, force, dataTransfer, isSimulated));
 }
 
 MouseEvent::MouseEvent()
@@ -114,7 +114,7 @@ MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cance
                        int movementX, int movementY,
 #endif
                        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
-                       unsigned short button, PassRefPtr<EventTarget> relatedTarget,
+                       unsigned short button, PassRefPtr<EventTarget> relatedTarget, double force,
                        PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
     : MouseRelatedEvent(eventType, canBubble, cancelable, timestamp, view, detail, IntPoint(screenX, screenY),
                         IntPoint(pageX, pageY),
@@ -125,6 +125,7 @@ MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cance
     , m_button(button == (unsigned short)-1 ? 0 : button)
     , m_buttonDown(button != (unsigned short)-1)
     , m_relatedTarget(relatedTarget)
+    , m_force(force)
     , m_dataTransfer(dataTransfer)
 {
 }
@@ -254,6 +255,7 @@ PassRefPtr<Event> MouseEvent::cloneFor(HTMLIFrameElement* iframe) const
         button(),
         // Nullifies relatedTarget.
         0);
+    clonedMouseEvent->setForce(force());
     return clonedMouseEvent.release();
 }
 
@@ -271,7 +273,7 @@ SimulatedMouseEvent::SimulatedMouseEvent(const AtomicString& eventType, PassRefP
 #if ENABLE(POINTER_LOCK)
                  0, 0,
 #endif
-                 false, false, false, false, 0, 0, 0, true)
+                 false, false, false, false, 0, 0, 0, 0, true)
 {
     if (UIEventWithKeyState* keyStateEvent = findEventWithKeyState(underlyingEvent.get())) {
         m_ctrlKey = keyStateEvent->ctrlKey();
index 5b29bc3..8322892 100644 (file)
@@ -59,7 +59,7 @@ public:
         int movementX, int movementY,
 #endif
         bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
-        PassRefPtr<EventTarget> relatedTarget);
+        PassRefPtr<EventTarget> relatedTarget, double force);
 
     WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView>,
         int detail, int screenX, int screenY, int pageX, int pageY,
@@ -67,7 +67,7 @@ public:
         int movementX, int movementY,
 #endif
         bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
-        PassRefPtr<EventTarget> relatedTarget, PassRefPtr<DataTransfer>, bool isSimulated = false);
+        PassRefPtr<EventTarget> relatedTarget, double force, PassRefPtr<DataTransfer>, bool isSimulated = false);
 
     WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& eventType, PassRefPtr<AbstractView>, const PlatformMouseEvent&, int detail, PassRefPtr<Node> relatedTarget);
 
@@ -86,7 +86,8 @@ public:
     bool buttonDown() const { return m_buttonDown; }
     virtual EventTarget* relatedTarget() const override final { return m_relatedTarget.get(); }
     void setRelatedTarget(PassRefPtr<EventTarget> relatedTarget) { m_relatedTarget = relatedTarget; }
-
+    double force() const { return m_force; }
+    void setForce(double force) { m_force = force; }
 
     Node* toElement() const;
     Node* fromElement() const;
@@ -112,7 +113,7 @@ protected:
         int movementX, int movementY,
 #endif
         bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
-        PassRefPtr<EventTarget> relatedTarget, PassRefPtr<DataTransfer>, bool isSimulated);
+        PassRefPtr<EventTarget> relatedTarget, double force, PassRefPtr<DataTransfer>, bool isSimulated);
 
     MouseEvent(const AtomicString& type, const MouseEventInit&);
 
@@ -122,6 +123,7 @@ private:
     unsigned short m_button;
     bool m_buttonDown;
     RefPtr<EventTarget> m_relatedTarget;
+    double m_force { 0 };
     RefPtr<DataTransfer> m_dataTransfer;
 };
 
index cccc0de..524cd6d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2015 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -33,6 +33,7 @@
     [InitializedByEventConstructor] readonly attribute EventTarget      relatedTarget;
     [Conditional=POINTER_LOCK]      readonly attribute long             movementX;
     [Conditional=POINTER_LOCK]      readonly attribute long             movementY;
+    [Conditional=MOUSE_FORCE_EVENTS]readonly attribute double           force;
     
     [ObjCLegacyUnnamedParameters] void initMouseEvent([Default=Undefined] optional DOMString type, 
                                        [Default=Undefined] optional boolean canBubble, 
diff --git a/Source/WebCore/dom/WebKitMouseForceEvent.cpp b/Source/WebCore/dom/WebKitMouseForceEvent.cpp
deleted file mode 100644 (file)
index 6a325f1..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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
diff --git a/Source/WebCore/dom/WebKitMouseForceEvent.h b/Source/WebCore/dom/WebKitMouseForceEvent.h
deleted file mode 100644 (file)
index 732e2a3..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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
diff --git a/Source/WebCore/dom/WebKitMouseForceEvent.idl b/Source/WebCore/dom/WebKitMouseForceEvent.idl
deleted file mode 100644 (file)
index b023af4..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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;
-};
index 8ec20ac..bb80894 100644 (file)
@@ -70,7 +70,7 @@ WheelEvent::WheelEvent(const PlatformWheelEvent& event, PassRefPtr<AbstractView>
 #if ENABLE(POINTER_LOCK)
                 , 0, 0
 #endif
-                , event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 0, 0, 0, false)
+                , event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 0, 0, 0, 0, false)
     , m_wheelDelta(event.wheelTicksX() * TickMultiplier, event.wheelTicksY() * TickMultiplier)
     , m_deltaX(-event.deltaX())
     , m_deltaY(-event.deltaY())
index d441fae..3889e54 100644 (file)
@@ -1433,7 +1433,7 @@ void ContextMenuController::showContextMenuAt(Frame* frame, const IntPoint& clic
     clearContextMenu();
     
     // Simulate a click in the middle of the accessibility object.
-    PlatformMouseEvent mouseEvent(clickPoint, clickPoint, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime());
+    PlatformMouseEvent mouseEvent(clickPoint, clickPoint, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), ForceAtClick);
     frame->eventHandler().handleMousePressEvent(mouseEvent);
     bool handled = frame->eventHandler().sendContextMenuEvent(mouseEvent);
     if (handled)
index 6706a44..95152b2 100644 (file)
@@ -93,7 +93,7 @@ static PlatformMouseEvent createMouseEvent(DragData& dragData)
 
     return PlatformMouseEvent(dragData.clientPosition(), dragData.globalPosition(),
                               LeftButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey,
-                              metaKey, currentTime());
+                              metaKey, currentTime(), ForceAtClick);
 }
 
 DragController::DragController(Page& page, DragClient& client)
index 46051c6..98a5d39 100644 (file)
@@ -2159,7 +2159,7 @@ bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Element& dra
         event.movementDelta().x(), event.movementDelta().y(),
 #endif
         event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(),
-        0, 0, dataTransfer);
+        0, 0, event.force(), dataTransfer);
 
     dragTarget.dispatchEvent(me.get(), IGNORE_EXCEPTION);
     return me->defaultPrevented();
@@ -2849,7 +2849,7 @@ bool EventHandler::sendContextMenuEventForKey()
     PlatformEvent::Type eventType = PlatformEvent::MousePressed;
 #endif
 
-    PlatformMouseEvent platformMouseEvent(position, globalPosition, RightButton, eventType, 1, false, false, false, false, WTF::currentTime());
+    PlatformMouseEvent platformMouseEvent(position, globalPosition, RightButton, eventType, 1, false, false, false, false, WTF::currentTime(), ForceAtClick);
 
     return !dispatchMouseEvent(eventNames().contextmenuEvent, targetNode, true, 0, platformMouseEvent, false);
 }
@@ -2936,7 +2936,7 @@ void EventHandler::fakeMouseMoveEventTimerFired()
     bool altKey;
     bool metaKey;
     PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey);
-    PlatformMouseEvent fakeMouseMoveEvent(m_lastKnownMousePosition, m_lastKnownMouseGlobalPosition, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, currentTime());
+    PlatformMouseEvent fakeMouseMoveEvent(m_lastKnownMousePosition, m_lastKnownMouseGlobalPosition, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, currentTime(), 0);
     mouseMoved(fakeMouseMoveEvent);
 }
 #endif // !ENABLE(IOS_TOUCH_EVENTS)
@@ -4020,11 +4020,6 @@ void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event)
     m_lastKnownMouseGlobalPosition = event.globalPosition();
 }
 
-const PlatformMouseEvent& EventHandler::lastMouseDownEvent() const
-{
-    return m_mouseDown;
-}
-
 void EventHandler::setImmediateActionStage(ImmediateActionStage stage)
 {
     m_immediateActionStage = stage;
index d510057..c26f0af 100644 (file)
@@ -312,7 +312,6 @@ public:
     bool isHandlingWheelEvent() const { return m_isHandlingWheelEvent; }
 
     WEBCORE_EXPORT void setImmediateActionStage(ImmediateActionStage stage);
-    WEBCORE_EXPORT const PlatformMouseEvent& lastMouseDownEvent() const;
 
 private:
 #if ENABLE(DRAG_SUPPORT)
index d417d3a..81f35b7 100644 (file)
@@ -42,7 +42,10 @@ typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move;
 #endif
 
 namespace WebCore {
-    
+
+const double ForceAtClick = 0;
+const double ForceAtForceClick = 1;
+
     // 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 };
 
@@ -63,13 +66,14 @@ namespace WebCore {
         }
 
         PlatformMouseEvent(const IntPoint& position, const IntPoint& globalPosition, MouseButton button, PlatformEvent::Type type,
-                           int clickCount, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, double timestamp)
+                           int clickCount, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, double timestamp, double force)
             : PlatformEvent(type, shiftKey, ctrlKey, altKey, metaKey, timestamp)
             , m_position(position)
             , m_globalPosition(globalPosition)
             , m_button(button)
             , m_clickCount(clickCount)
             , m_modifierFlags(0)
+            , m_force(force)
 #if PLATFORM(MAC)
             , m_eventNumber(0)
             , m_menuTypeForEvent(0)
@@ -88,6 +92,7 @@ namespace WebCore {
         MouseButton button() const { return m_button; }
         int clickCount() const { return m_clickCount; }
         unsigned modifierFlags() const { return m_modifierFlags; }
+        double force() const { return m_force; }
         
 
 #if PLATFORM(GTK) 
@@ -123,6 +128,7 @@ namespace WebCore {
         MouseButton m_button;
         int m_clickCount;
         unsigned m_modifierFlags;
+        double m_force { 0 };
 
 #if PLATFORM(MAC)
         int m_eventNumber;
index 7236ac1..f9f065b 100644 (file)
@@ -314,6 +314,7 @@ EncodedValue EncodingTraits<PlatformMouseEvent>::encodeValue(const PlatformMouse
     ENCODE_TYPE_WITH_KEY(encodedValue, bool, altKey, input.altKey());
     ENCODE_TYPE_WITH_KEY(encodedValue, bool, metaKey, input.metaKey());
     ENCODE_TYPE_WITH_KEY(encodedValue, int, timestamp, input.timestamp());
+    ENCODE_TYPE_WITH_KEY(encodedValue, double, force, input.force());
 
     return encodedValue;
 }
@@ -332,11 +333,12 @@ bool EncodingTraits<PlatformMouseEvent>::decodeValue(EncodedValue& encodedValue,
     DECODE_TYPE_WITH_KEY(encodedValue, bool, altKey);
     DECODE_TYPE_WITH_KEY(encodedValue, bool, metaKey);
     DECODE_TYPE_WITH_KEY(encodedValue, int, timestamp);
+    DECODE_TYPE_WITH_KEY(encodedValue, double, force);
 
     input = std::make_unique<PlatformMouseEvent>(IntPoint(positionX, positionY),
         IntPoint(globalPositionX, globalPositionY),
         button, type, clickCount,
-        shiftKey, ctrlKey, altKey, metaKey, timestamp);
+        shiftKey, ctrlKey, altKey, metaKey, timestamp, force);
     return true;
 }
 
index 1c264a0..157271d 100644 (file)
@@ -1,3 +1,16 @@
+2015-04-13  Beth Dakin  <bdakin@apple.com>
+
+        Add force property to MouseEvents
+        https://bugs.webkit.org/show_bug.cgi?id=143569
+        -and corresponding-
+        rdar://problem/20472954
+
+        Reviewed by Darin Adler.
+
+        Send the appropriate force with this simulated click event.
+        * WebView/WebPDFViewPlaceholder.mm:
+        (-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]):
+
 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Move ExpansionBehaviorFlags and TextDirection to their own file
index 2f468d0..81c0fde 100644 (file)
@@ -471,7 +471,7 @@ static const float PAGE_HEIGHT_INSET = 4.0f * 2.0f;
 #if ENABLE(POINTER_LOCK)
         0, 0,
 #endif
-        false, false, false, false, 0, 0, 0, true);
+        false, false, false, false, 0, 0, 0, 0, true);
 
     // Call to the frame loader because this is where our security checks are made.
     Frame* frame = core([_dataSource webFrame]);
index 033ea3d..1246f52 100644 (file)
@@ -1,3 +1,18 @@
+2015-04-13  Beth Dakin  <bdakin@apple.com>
+
+        Add force property to MouseEvents
+        https://bugs.webkit.org/show_bug.cgi?id=143569
+        -and corresponding-
+        rdar://problem/20472954
+
+        Reviewed by Darin Adler.
+
+        PlatformMouseEvent and MouseEvent now take force parameters.
+        * WebView/WebFrame.mm:
+        (-[WebFrame _dragSourceEndedAt:operation:]):
+        * WebView/WebPDFView.mm:
+        (-[WebPDFView PDFViewWillClickOnLink:withURL:]):
+
 2015-04-12  Darin Adler  <darin@apple.com>
 
         [Cocoa] Localizable strings are inconsistent and need to be regenerated
index dd0246d..33a7be3 100644 (file)
@@ -966,7 +966,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
         return;
     // FIXME: These are fake modifier keys here, but they should be real ones instead.
     PlatformMouseEvent event(IntPoint(windowLoc), globalPoint(windowLoc, [view->platformWidget() window]),
-        LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime());
+        LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), WebCore::ForceAtClick);
     _private->coreFrame->eventHandler().dragSourceEndedAt(event, (DragOperation)operation);
 }
 #endif
index bd385ad..a81e4f0 100644 (file)
@@ -1027,7 +1027,7 @@ static BOOL isFrameInRange(WebFrame *frame, DOMRange *range)
             [nsEvent modifierFlags] & NSAlternateKeyMask,
             [nsEvent modifierFlags] & NSShiftKeyMask,
             [nsEvent modifierFlags] & NSCommandKeyMask,
-            button, 0, 0, true);
+            button, 0, WebCore::ForceAtClick, 0, true);
     }
 
     // Call to the frame loader because this is where our security checks are made.
index 7e6fd04..9be68ea 100644 (file)
@@ -1,3 +1,16 @@
+2015-04-13  Beth Dakin  <bdakin@apple.com>
+
+        Add force property to MouseEvents
+        https://bugs.webkit.org/show_bug.cgi?id=143569
+        -and corresponding-
+        rdar://problem/20472954
+
+        Reviewed by Darin Adler.
+
+        PlatformMouseEvent takes a force parameter.
+        * WebDropSource.cpp:
+        (generateMouseEvent):
+
 2015-04-13  Per Arne Vollan  <peavo@outlook.com>
 
         [Win] Incorrect parameter order in call to WebView::repaint.
index 9f677b6..054be86 100644 (file)
@@ -101,7 +101,7 @@ PlatformMouseEvent generateMouseEvent(WebView* webView, bool isDrag)
     if (SUCCEEDED(webView->viewWindow(&viewWindow)))
         ::ScreenToClient(viewWindow, reinterpret_cast<LPPOINT>(&localpt));
     return PlatformMouseEvent(IntPoint(localpt.x, localpt.y), IntPoint(pt.x, pt.y),
-        isDrag ? LeftButton : NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime());
+        isDrag ? LeftButton : NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), 0);
 }
 
 STDMETHODIMP WebDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
index d6cd922..ac0317e 100644 (file)
@@ -1,3 +1,64 @@
+2015-04-13  Beth Dakin  <bdakin@apple.com>
+
+        Add force property to MouseEvents
+        https://bugs.webkit.org/show_bug.cgi?id=143569
+        -and corresponding-
+        rdar://problem/20472954
+
+        Reviewed by Darin Adler.
+
+        In order to accommodate adding force to all PlatformMouseEvents, we have to add it 
+        to pass a caches pressure event to NativeWebMouseEvent and add force to 
+        WebMouseEvent.
+
+        NativeWebMouseEvent now requires a second NSEvent for the pressureEvent. 
+        * Shared/NativeWebMouseEvent.h:
+
+        WebMouseEvent takes a force parameter.
+        * Shared/WebEvent.h:
+        (WebKit::WebMouseEvent::force):
+        * Shared/WebEventConversion.cpp:
+        (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
+        * Shared/WebMouseEvent.cpp:
+        (WebKit::WebMouseEvent::WebMouseEvent):
+        (WebKit::WebMouseEvent::encode):
+        (WebKit::WebMouseEvent::decode):
+        * Shared/mac/NativeWebMouseEventMac.mm:
+        (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
+        * Shared/mac/WebEventFactory.h:
+        * Shared/mac/WebEventFactory.mm:
+        (WebKit::WebEventFactory::createWebMouseEvent):
+
+        Cache the most recent pressureEvent in _data so that it can be sent along to the 
+        NativeWebMouseEvent constructor.
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView pressureChangeWithEvent:]):
+        (-[WKView acceptsFirstMouse:]):
+        (-[WKView shouldDelayWindowOrderingForEvent:]):
+        (-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]):
+        (-[WKView initWithFrame:processPool:configuration:webView:]):
+
+        WebMouseEvent takes a force parameter.
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::showContextMenuAtPoint):
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::createWebEvent):
+
+        MouseEvent and PlatformMouseEvent both take force parameters too.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::navigateToURLWithSimulatedClick):
+        (WebKit::WebPage::contextMenuAtPointInWindow):
+        (WebKit::WebPage::dragEnded):
+        (WebKit::WebPage::simulateMouseDown):
+        (WebKit::WebPage::simulateMouseUp):
+        (WebKit::WebPage::simulateMouseMotion):
+
+        The functions that dispatch the force events no longer take a PlatformMouseEvent 
+        as a parameter.
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::inputDeviceForceDidChange):
+        (WebKit::WebPage::immediateActionDidCancel):
+
 2015-04-13  Andreas Kling  <akling@apple.com>
 
         Don't segregate heap objects based on Structure immortality.
index 7eec804..03a73f4 100644 (file)
@@ -49,7 +49,7 @@ namespace WebKit {
 class NativeWebMouseEvent : public WebMouseEvent {
 public:
 #if USE(APPKIT)
-    NativeWebMouseEvent(NSEvent *, NSView *);
+    NativeWebMouseEvent(NSEvent *, NSEvent *pressureEvent, NSView *);
 #elif PLATFORM(GTK)
     NativeWebMouseEvent(const NativeWebMouseEvent&);
     NativeWebMouseEvent(GdkEvent*, int);
index ada49a7..3ecda9d 100644 (file)
@@ -124,9 +124,9 @@ public:
     WebMouseEvent();
 
 #if PLATFORM(MAC)
-    WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp, int eventNumber = -1, int menuType = 0);
+    WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp, double force, int eventNumber = -1, int menuType = 0);
 #else
-    WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp);
+    WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp, double force = 0);
 #endif
 
     Button button() const { return static_cast<Button>(m_button); }
@@ -140,6 +140,7 @@ public:
     int32_t eventNumber() const { return m_eventNumber; }
     int32_t menuTypeForEvent() const { return m_menuTypeForEvent; }
 #endif
+    double force() const { return m_force; }
 
     void encode(IPC::ArgumentEncoder&) const;
     static bool decode(IPC::ArgumentDecoder&, WebMouseEvent&);
@@ -158,6 +159,7 @@ private:
     int32_t m_eventNumber;
     int32_t m_menuTypeForEvent;
 #endif
+    double m_force { 0 };
 };
 
 // FIXME: Move this class to its own header file.
index 422e0c7..4740eb5 100644 (file)
@@ -38,12 +38,15 @@ public:
         switch (webEvent.type()) {
         case WebEvent::MouseDown:
             m_type = WebCore::PlatformEvent::MousePressed;
+            m_force = WebCore::ForceAtClick;
             break;
         case WebEvent::MouseUp:
             m_type = WebCore::PlatformEvent::MouseReleased;
+            m_force = WebCore::ForceAtClick;
             break;
         case WebEvent::MouseMove:
             m_type = WebCore::PlatformEvent::MouseMoved;
+            m_force = webEvent.force();
             break;
         default:
             ASSERT_NOT_REACHED();
index 791f709..72c63e2 100644 (file)
@@ -48,9 +48,9 @@ WebMouseEvent::WebMouseEvent()
 }
 
 #if PLATFORM(MAC)
-WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp, int eventNumber, int menuType)
+WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp, double force, int eventNumber, int menuType)
 #else
-WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp)
+WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp, double force)
 #endif
     : WebEvent(type, modifiers, timestamp)
     , m_button(button)
@@ -64,6 +64,7 @@ WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position,
     , m_eventNumber(eventNumber)
     , m_menuTypeForEvent(menuType)
 #endif
+    , m_force(force)
 {
     ASSERT(isMouseEventType(type));
 }
@@ -83,6 +84,7 @@ void WebMouseEvent::encode(IPC::ArgumentEncoder& encoder) const
     encoder << m_eventNumber;
     encoder << m_menuTypeForEvent;
 #endif
+    encoder << m_force;
 }
 
 bool WebMouseEvent::decode(IPC::ArgumentDecoder& decoder, WebMouseEvent& result)
@@ -110,6 +112,8 @@ bool WebMouseEvent::decode(IPC::ArgumentDecoder& decoder, WebMouseEvent& result)
     if (!decoder.decode(result.m_menuTypeForEvent))
         return false;
 #endif
+    if (!decoder.decode(result.m_force))
+        return false;
 
     return true;
 }
index 79179ff..0abef14 100644 (file)
@@ -32,8 +32,8 @@
 
 namespace WebKit {
 
-NativeWebMouseEvent::NativeWebMouseEvent(NSEvent* event, NSView* view)
-    : WebMouseEvent(WebEventFactory::createWebMouseEvent(event, view))
+NativeWebMouseEvent::NativeWebMouseEvent(NSEvent *event, NSEvent *pressureEvent, NSView *view)
+    : WebMouseEvent(WebEventFactory::createWebMouseEvent(event, pressureEvent, view))
     , m_nativeEvent(event)
 {
 }
index 71b93fc..1cc715b 100644 (file)
@@ -42,7 +42,7 @@ namespace WebKit {
 class WebEventFactory {
 public:
 #if USE(APPKIT)
-    static WebMouseEvent createWebMouseEvent(NSEvent *, NSView *windowView);
+    static WebMouseEvent createWebMouseEvent(NSEvent *, NSEvent *pressureEvent, NSView *windowView);
     static WebWheelEvent createWebWheelEvent(NSEvent *, NSView *windowView);
     static WebKeyboardEvent createWebKeyboardEvent(NSEvent *, bool handledByInputMethod, const Vector<WebCore::KeypressCommand>&);
     static bool shouldBeHandledAsContextClick(const WebCore::PlatformMouseEvent&);
index 7533ac7..74ff76b 100644 (file)
@@ -358,7 +358,7 @@ bool WebEventFactory::shouldBeHandledAsContextClick(const WebCore::PlatformMouse
     return (static_cast<NSMenuType>(event.menuTypeForEvent()) == NSMenuTypeContextMenu);
 }
 
-WebMouseEvent WebEventFactory::createWebMouseEvent(NSEvent *event, NSView *windowView)
+WebMouseEvent WebEventFactory::createWebMouseEvent(NSEvent *event, NSEvent *pressureEvent, NSView *windowView)
 {
     NSPoint position = pointForEvent(event, windowView);
     NSPoint globalPosition = globalPointForEvent(event);
@@ -374,7 +374,12 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(NSEvent *event, NSView *windo
     int eventNumber                         = [event eventNumber];
     int menuTypeForEvent                    = typeForEvent(event);
 
-    return WebMouseEvent(type, button, IntPoint(position), IntPoint(globalPosition), deltaX, deltaY, deltaZ, clickCount, modifiers, timestamp, eventNumber, menuTypeForEvent);
+    double force = 0;
+#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101003
+    force = pressureEvent.stage < 1 ? pressureEvent.pressure : pressureEvent.pressure + pressureEvent.stage - 1;
+#endif
+
+    return WebMouseEvent(type, button, IntPoint(position), IntPoint(globalPosition), deltaX, deltaY, deltaZ, clickCount, modifiers, timestamp, force, eventNumber, menuTypeForEvent);
 }
 
 WebWheelEvent WebEventFactory::createWebWheelEvent(NSEvent *event, NSView *windowView)
index b4778b6..e4b0961 100644 (file)
@@ -224,6 +224,7 @@ struct WKViewInterpretKeyEventsParameters {
     bool _inResignFirstResponder;
     BOOL _willBecomeFirstResponderAgain;
     NSEvent *_mouseDownEvent;
+    NSEvent *_pressureEvent;
     BOOL _ignoringMouseDraggedEvents;
 
     id _flagsChangedEventMonitor;
@@ -1249,7 +1250,7 @@ static NSToolbarItem *toolbarItem(id <NSValidatedUserInterfaceItem> item)
                 if (handled) \
                     LOG(TextInput, "%s was handled by text input context", String(#Selector).substring(0, String(#Selector).find("Internal")).ascii().data()); \
                 else { \
-                    NativeWebMouseEvent webEvent(theEvent, self); \
+                    NativeWebMouseEvent webEvent(theEvent, _data->_pressureEvent, self); \
                     _data->_page->handleMouseEvent(webEvent); \
                 } \
             }]; \
@@ -1259,7 +1260,7 @@ static NSToolbarItem *toolbarItem(id <NSValidatedUserInterfaceItem> item)
             [super Selector:theEvent]; \
             return; \
         } \
-        NativeWebMouseEvent webEvent(theEvent, self); \
+        NativeWebMouseEvent webEvent(theEvent, _data->_pressureEvent, self); \
         _data->_page->handleMouseEvent(webEvent); \
     }
 #define NATIVE_MOUSE_EVENT_HANDLER_INTERNAL(Selector) \
@@ -1272,13 +1273,13 @@ static NSToolbarItem *toolbarItem(id <NSValidatedUserInterfaceItem> item)
                 if (handled) \
                     LOG(TextInput, "%s was handled by text input context", String(#Selector).substring(0, String(#Selector).find("Internal")).ascii().data()); \
                 else { \
-                    NativeWebMouseEvent webEvent(theEvent, self); \
+                    NativeWebMouseEvent webEvent(theEvent, _data->_pressureEvent, self); \
                     _data->_page->handleMouseEvent(webEvent); \
                 } \
             }]; \
             return; \
         } \
-        NativeWebMouseEvent webEvent(theEvent, self); \
+        NativeWebMouseEvent webEvent(theEvent, _data->_pressureEvent, self); \
         _data->_page->handleMouseEvent(webEvent); \
     }
 #else
@@ -1295,7 +1296,7 @@ static NSToolbarItem *toolbarItem(id <NSValidatedUserInterfaceItem> item)
             [super Selector:theEvent]; \
             return; \
         } \
-        NativeWebMouseEvent webEvent(theEvent, self); \
+        NativeWebMouseEvent webEvent(theEvent, _data->_pressureEvent, self); \
         _data->_page->handleMouseEvent(webEvent); \
     }
 #define NATIVE_MOUSE_EVENT_HANDLER_INTERNAL(Selector) \
@@ -1307,7 +1308,7 @@ static NSToolbarItem *toolbarItem(id <NSValidatedUserInterfaceItem> item)
             LOG(TextInput, "%s was handled by text input context", String(#Selector).substring(0, String(#Selector).find("Internal")).ascii().data()); \
             return; \
         } \
-        NativeWebMouseEvent webEvent(theEvent, self); \
+        NativeWebMouseEvent webEvent(theEvent, _data->_pressureEvent, self); \
         _data->_page->handleMouseEvent(webEvent); \
     }
 #endif
@@ -1417,8 +1418,16 @@ NATIVE_MOUSE_EVENT_HANDLER_INTERNAL(mouseDraggedInternal)
 - (void)pressureChangeWithEvent:(NSEvent *)event
 {
 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101003
-    if (event.phase == NSEventPhaseChanged || event.phase == NSEventPhaseBegan || event.phase == NSEventPhaseEnded)
-        _data->_page->inputDeviceForceDidChange(event.pressure, event.stage);
+    if (event == _data->_pressureEvent)
+        return;
+
+    if (event.phase != NSEventPhaseChanged && event.phase != NSEventPhaseBegan && event.phase != NSEventPhaseEnded)
+        return;
+
+    [_data->_pressureEvent release];
+    _data->_pressureEvent = [event retain];
+
+    _data->_page->inputDeviceForceDidChange(event.pressure, event.stage);
 #endif
 }
 
@@ -1433,7 +1442,7 @@ NATIVE_MOUSE_EVENT_HANDLER_INTERNAL(mouseDraggedInternal)
         return NO;
     
     [self _setMouseDownEvent:event];
-    bool result = _data->_page->acceptsFirstMouse([event eventNumber], WebEventFactory::createWebMouseEvent(event, self));
+    bool result = _data->_page->acceptsFirstMouse([event eventNumber], WebEventFactory::createWebMouseEvent(event, _data->_pressureEvent, self));
     [self _setMouseDownEvent:nil];
     return result;
 }
@@ -1454,7 +1463,7 @@ NATIVE_MOUSE_EVENT_HANDLER_INTERNAL(mouseDraggedInternal)
         return NO;
     
     [self _setMouseDownEvent:event];
-    bool result = _data->_page->shouldDelayWindowOrderingForEvent(WebEventFactory::createWebMouseEvent(event, self));
+    bool result = _data->_page->shouldDelayWindowOrderingForEvent(WebEventFactory::createWebMouseEvent(event, _data->_pressureEvent, self));
     [self _setMouseDownEvent:nil];
     return result;
 }
@@ -2970,7 +2979,7 @@ static void* keyValueObservingContext = &keyValueObservingContext;
     NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:[[flagsChangedEvent window] mouseLocationOutsideOfEventStream]
         modifierFlags:[flagsChangedEvent modifierFlags] timestamp:[flagsChangedEvent timestamp] windowNumber:[flagsChangedEvent windowNumber]
         context:[flagsChangedEvent context] eventNumber:0 clickCount:0 pressure:0];
-    NativeWebMouseEvent webEvent(fakeEvent, self);
+    NativeWebMouseEvent webEvent(fakeEvent, _data->_pressureEvent, self);
     _data->_page->handleMouseEvent(webEvent);
 }
 
@@ -3775,6 +3784,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
     _data->_page->initializeWebPage();
 
     _data->_mouseDownEvent = nil;
+    _data->_pressureEvent = nil;
     _data->_ignoringMouseDraggedEvents = NO;
     _data->_clipsToVisibleRect = NO;
     _data->_useContentPreparationRectForVisibleRect = NO;
index 1b203e7..4069d42 100644 (file)
@@ -1458,7 +1458,7 @@ bool PDFPlugin::showContextMenuAtPoint(const IntPoint& point)
 {
     FrameView* frameView = webFrame()->coreFrame()->view();
     IntPoint contentsPoint = frameView->contentsToRootView(point);
-    WebMouseEvent event(WebEvent::MouseDown, WebMouseEvent::RightButton, contentsPoint, contentsPoint, 0, 0, 0, 1, static_cast<WebEvent::Modifiers>(0), monotonicallyIncreasingTime());
+    WebMouseEvent event(WebEvent::MouseDown, WebMouseEvent::RightButton, contentsPoint, contentsPoint, 0, 0, 0, 1, static_cast<WebEvent::Modifiers>(0), monotonicallyIncreasingTime(), WebCore::ForceAtClick);
     return handleContextMenuEvent(event);
 }
 
index 83efd82..43a05a7 100644 (file)
@@ -887,7 +887,7 @@ std::unique_ptr<WebEvent> PluginView::createWebEvent(MouseEvent* event) const
     if (event->metaKey())
         modifiers |= WebEvent::MetaKey;
 
-    return std::make_unique<WebMouseEvent>(type, button, m_plugin->convertToRootView(IntPoint(event->offsetX(), event->offsetY())), event->screenLocation(), 0, 0, 0, clickCount, static_cast<WebEvent::Modifiers>(modifiers), 0);
+    return std::make_unique<WebMouseEvent>(type, button, m_plugin->convertToRootView(IntPoint(event->offsetX(), event->offsetY())), event->screenLocation(), 0, 0, 0, clickCount, static_cast<WebEvent::Modifiers>(modifiers), 0, 0);
 }
 
 void PluginView::handleEvent(Event* event)
index 13687e0..6c6a54d 100644 (file)
@@ -1090,7 +1090,7 @@ void WebPage::navigateToURLWithSimulatedClick(const String& url, IntPoint docume
         return;
 
     const int singleClick = 1;
-    RefPtr<MouseEvent> mouseEvent = MouseEvent::create(eventNames().clickEvent, true, true, currentTime(), nullptr, singleClick, screenPoint.x(), screenPoint.y(), documentPoint.x(), documentPoint.y(), false, false, false, false, 0, nullptr, nullptr);
+    RefPtr<MouseEvent> mouseEvent = MouseEvent::create(eventNames().clickEvent, true, true, currentTime(), nullptr, singleClick, screenPoint.x(), screenPoint.y(), documentPoint.x(), documentPoint.y(), false, false, false, false, 0, nullptr, 0, nullptr);
     mainFrame->loader().urlSelected(mainFrameDocument->completeURL(url), emptyString(), mouseEvent.release(), LockHistory::No, LockBackForwardList::No, ShouldSendReferrer::MaybeSendReferrer);
 }
 
@@ -1782,7 +1782,7 @@ WebContextMenu* WebPage::contextMenuAtPointInWindow(const IntPoint& point)
     corePage()->contextMenuController().clearContextMenu();
     
     // Simulate a mouse click to generate the correct menu.
-    PlatformMouseEvent mouseEvent(point, point, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime());
+    PlatformMouseEvent mouseEvent(point, point, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick);
     bool handled = corePage()->userInputBridge().handleContextMenuEvent(mouseEvent, &corePage()->mainFrame());
     if (!handled)
         return 0;
@@ -3087,7 +3087,7 @@ void WebPage::dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint glob
     if (!view)
         return;
     // FIXME: These are fake modifier keys here, but they should be real ones instead.
-    PlatformMouseEvent event(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime());
+    PlatformMouseEvent event(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), 0);
     m_page->mainFrame().eventHandler().dragSourceEndedAt(event, (DragOperation)operation);
 }
 
@@ -4016,17 +4016,17 @@ void WebPage::handleAlternativeTextUIResult(const String& result)
 
 void WebPage::simulateMouseDown(int button, WebCore::IntPoint position, int clickCount, WKEventModifiers modifiers, double time)
 {
-    mouseEvent(WebMouseEvent(WebMouseEvent::MouseDown, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time));
+    mouseEvent(WebMouseEvent(WebMouseEvent::MouseDown, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time, WebCore::ForceAtClick));
 }
 
 void WebPage::simulateMouseUp(int button, WebCore::IntPoint position, int clickCount, WKEventModifiers modifiers, double time)
 {
-    mouseEvent(WebMouseEvent(WebMouseEvent::MouseUp, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time));
+    mouseEvent(WebMouseEvent(WebMouseEvent::MouseUp, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time, WebCore::ForceAtClick));
 }
 
 void WebPage::simulateMouseMotion(WebCore::IntPoint position, double time)
 {
-    mouseEvent(WebMouseEvent(WebMouseEvent::MouseMove, WebMouseEvent::NoButton, position, position, 0, 0, 0, 0, WebMouseEvent::Modifiers(), time));
+    mouseEvent(WebMouseEvent(WebMouseEvent::MouseMove, WebMouseEvent::NoButton, position, position, 0, 0, 0, 0, WebMouseEvent::Modifiers(), time, 0));
 }
 
 void WebPage::setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length)
index b7ba137..7de684f 100644 (file)
@@ -522,7 +522,7 @@ void WebPage::handleSyntheticClick(Node* nodeRespondingToClick, const WebCore::F
 
     WKBeginObservingContentChanges(true);
 
-    mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0));
+    mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0, WebCore::ForceAtClick));
     mainframe.document()->updateStyleIfNeeded();
 
     WKStopObservingContentChanges();
@@ -569,8 +569,8 @@ void WebPage::completeSyntheticClick(Node* nodeRespondingToClick, const WebCore:
 
     bool tapWasHandled = false;
     m_lastInteractionLocation = roundedAdjustedPoint;
-    tapWasHandled |= mainframe.eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, 0));
-    tapWasHandled |= mainframe.eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, false, false, false, false, 0));
+    tapWasHandled |= mainframe.eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, 0, WebCore::ForceAtClick));
+    tapWasHandled |= mainframe.eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, false, false, false, false, 0, WebCore::ForceAtClick));
 
     RefPtr<Frame> newFocusedFrame = m_page->focusController().focusedFrame();
     RefPtr<Element> newFocusedElement = newFocusedFrame ? newFocusedFrame->document()->focusedElement() : nullptr;
@@ -685,7 +685,7 @@ void WebPage::inspectorNodeSearchMovedToPosition(const FloatPoint& position)
     IntPoint adjustedPoint = roundedIntPoint(position);
     Frame& mainframe = m_page->mainFrame();
 
-    mainframe.eventHandler().mouseMoved(PlatformMouseEvent(adjustedPoint, adjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0));
+    mainframe.eventHandler().mouseMoved(PlatformMouseEvent(adjustedPoint, adjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0, 0));
     mainframe.document()->updateStyleIfNeeded();
 }
 
index 26a4741..a748923 100644 (file)
@@ -1148,13 +1148,13 @@ void WebPage::inputDeviceForceDidChange(float force, int stage)
         return;
 
     float overallForce = stage < 1 ? force : force + stage - 1;
-    element->dispatchMouseForceChanged(overallForce, m_page->mainFrame().eventHandler().lastMouseDownEvent());
+    element->dispatchMouseForceChanged(overallForce);
 
     if (m_lastForceStage == 1 && stage == 2)
-        element->dispatchMouseForceDown(m_page->mainFrame().eventHandler().lastMouseDownEvent());
+        element->dispatchMouseForceDown();
     else if (m_lastForceStage == 2 && stage == 1) {
-        element->dispatchMouseForceUp(m_page->mainFrame().eventHandler().lastMouseDownEvent());
-        element->dispatchMouseForceClick(m_page->mainFrame().eventHandler().lastMouseDownEvent());
+        element->dispatchMouseForceUp();
+        element->dispatchMouseForceClick();
     }
 
     m_lastForceStage = stage;
@@ -1173,7 +1173,7 @@ void WebPage::immediateActionDidCancel()
     if (!element)
         return;
 
-    element->dispatchMouseForceCancelled(m_page->mainFrame().eventHandler().lastMouseDownEvent());
+    element->dispatchMouseForceCancelled();
 }
 
 void WebPage::immediateActionDidComplete()