Changeset 182748 in webkit


Ignore:
Timestamp:
Apr 13, 2015 12:17:48 PM (9 years ago)
Author:
Beth Dakin
Message:

Add force property to MouseEvents
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:
Location:
trunk
Files:
3 deleted
46 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r182743 r182748  
     12015-04-13  Beth Dakin  <bdakin@apple.com>
     2
     3        Add force property to MouseEvents
     4        https://bugs.webkit.org/show_bug.cgi?id=143569
     5        -and corresponding-
     6        rdar://problem/20472954
     7
     8        Reviewed by Darin Adler.
     9
     10        * platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
     11        * platform/mac/js/dom/global-constructors-attributes-expected.txt:
     12        * platform/win/js/dom/global-constructors-attributes-expected.txt:
     13
    1142015-04-13  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/LayoutTests/platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt

    r182180 r182748  
    20042004PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeys').enumerable is false
    20052005PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeys').configurable is true
    2006 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').value is WebKitMouseForceEvent
    2007 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').hasOwnProperty('get') is false
    2008 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').hasOwnProperty('set') is false
    2009 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').enumerable is false
    2010 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').configurable is true
    20112006PASS Object.getOwnPropertyDescriptor(global, 'WebKitMutationObserver').value is WebKitMutationObserver
    20122007PASS Object.getOwnPropertyDescriptor(global, 'WebKitMutationObserver').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt

    r182180 r182748  
    20242024PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeys').enumerable is false
    20252025PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeys').configurable is true
    2026 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').value is WebKitMouseForceEvent
    2027 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').hasOwnProperty('get') is false
    2028 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').hasOwnProperty('set') is false
    2029 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').enumerable is false
    2030 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').configurable is true
    20312026PASS Object.getOwnPropertyDescriptor(global, 'WebKitMutationObserver').value is WebKitMutationObserver
    20322027PASS Object.getOwnPropertyDescriptor(global, 'WebKitMutationObserver').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt

    r182180 r182748  
    18091809PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeys').enumerable is false
    18101810PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeys').configurable is true
    1811 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').value is WebKitMouseForceEvent
    1812 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').hasOwnProperty('get') is false
    1813 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').hasOwnProperty('set') is false
    1814 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').enumerable is false
    1815 PASS Object.getOwnPropertyDescriptor(global, 'WebKitMouseForceEvent').configurable is true
    18161811PASS Object.getOwnPropertyDescriptor(global, 'WebKitMutationObserver').value is WebKitMutationObserver
    18171812PASS Object.getOwnPropertyDescriptor(global, 'WebKitMutationObserver').hasOwnProperty('get') is false
  • trunk/Source/WebCore/CMakeLists.txt

    r182627 r182748  
    429429    dom/UIEvent.idl
    430430    dom/WebKitAnimationEvent.idl
    431     dom/WebKitMouseForceEvent.idl
    432431    dom/WebKitNamedFlow.idl
    433432    dom/WebKitTransitionEvent.idl
     
    14571456    dom/VisitedLinkState.cpp
    14581457    dom/WebKitAnimationEvent.cpp
    1459     dom/WebKitMouseForceEvent.cpp
    14601458    dom/WebKitNamedFlow.cpp
    14611459    dom/WebKitTransitionEvent.cpp
  • trunk/Source/WebCore/ChangeLog

    r182747 r182748  
     12015-04-13  Beth Dakin  <bdakin@apple.com>
     2
     3        Add force property to MouseEvents
     4        https://bugs.webkit.org/show_bug.cgi?id=143569
     5        -and corresponding-
     6        rdar://problem/20472954
     7
     8        Reviewed by Darin Adler.
     9
     10        This patch removes WebKitMouseForceEvent and uses a MouseEvent everywhere that it
     11        was used. That’s possible because this patch also adds a force property to all
     12        MouseEvents and to PlatformMouseEvent.
     13
     14        Remove WebKitMouseForceEvent.
     15        * CMakeLists.txt:
     16        * DerivedSources.cpp:
     17        * DerivedSources.make:
     18        * WebCore.vcxproj/WebCore.vcxproj:
     19        * WebCore.vcxproj/WebCore.vcxproj.filters:
     20        * WebCore.xcodeproj/project.pbxproj:
     21        * dom/DOMAllInOne.cpp:
     22
     23        Create MouseEvents with the appropriate force instead of WebKitMouseForceEvents.
     24        This patch also gets rid of the PlatformMouseEvent parameter for these events.
     25        They were re-using the cached mousedown event before, which they never should have
     26        done. Instead, we create PlatformMouseEvents inside these functions and then use
     27        that to make MouseEvents.
     28        * dom/Element.cpp:
     29        (WebCore::Element::dispatchMouseForceWillBegin):
     30        (WebCore::Element::dispatchMouseForceChanged):
     31        (WebCore::Element::dispatchMouseForceDown):
     32        (WebCore::Element::dispatchMouseForceUp):
     33        (WebCore::Element::dispatchMouseForceClick):
     34        (WebCore::Element::dispatchMouseForceCancelled):
     35        * dom/Element.h:
     36
     37        No More WebKitMouseForceEvent.
     38        * dom/EventNames.in:
     39
     40        Add force to MouseEvent.
     41        * dom/MouseEvent.cpp:
     42        (WebCore::MouseEvent::create):
     43        (WebCore::MouseEvent::MouseEvent):
     44        (WebCore::MouseEvent::cloneFor):
     45        (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
     46        * dom/MouseEvent.h:
     47        (WebCore::MouseEvent::force):
     48        (WebCore::MouseEvent::setForce):
     49        * dom/MouseEvent.idl:
     50
     51        No More WebKitMouseForceEvent.
     52        * dom/WebKitMouseForceEvent.cpp: Removed.
     53        * dom/WebKitMouseForceEvent.h: Removed.
     54        * dom/WebKitMouseForceEvent.idl: Removed.
     55
     56        PlatformMouseEvent now takes a force parameter.
     57        * dom/WheelEvent.cpp:
     58        (WebCore::WheelEvent::WheelEvent):
     59        * page/ContextMenuController.cpp:
     60        (WebCore::ContextMenuController::showContextMenuAt):
     61        * page/DragController.cpp:
     62        (WebCore::createMouseEvent):
     63        * page/EventHandler.cpp:
     64        (WebCore::EventHandler::dispatchDragEvent):
     65        (WebCore::EventHandler::sendContextMenuEventForKey):
     66        (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
     67
     68        We don’t need lastMouseDownEvent() anymore. We were using it to avoid creating new
     69        PlatformMouseEvents for the force events, but we fix that in this patch.
     70        (WebCore::EventHandler::lastMouseDownEvent): Deleted.
     71        * page/EventHandler.h:
     72
     73        At force to PlatformMouseEvent.
     74        * platform/PlatformMouseEvent.h:
     75        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
     76        (WebCore::PlatformMouseEvent::force):
     77        * replay/SerializationMethods.cpp:
     78        (JSC::EncodingTraits<PlatformMouseEvent>::encodeValue):
     79        (JSC::EncodingTraits<PlatformMouseEvent>::decodeValue):
     80
    1812015-04-13  Andreas Kling  <akling@apple.com>
    282
  • trunk/Source/WebCore/DerivedSources.cpp

    r182180 r182748  
    511511#include "JSWebKitCSSMatrix.cpp"
    512512#include "JSWebKitCSSRegionRule.cpp"
    513 #include "JSWebKitMouseForceEvent.cpp"
    514513#include "JSWebKitNamedFlow.cpp"
    515514#include "JSWebKitPoint.cpp"
  • trunk/Source/WebCore/DerivedSources.make

    r182627 r182748  
    315315    $(WebCore)/dom/UIEvent.idl \
    316316    $(WebCore)/dom/WebKitAnimationEvent.idl \
    317         $(WebCore)/dom/WebKitMouseForceEvent.idl \
    318317    $(WebCore)/dom/WebKitNamedFlow.idl \
    319318    $(WebCore)/dom/WebKitTransitionEvent.idl \
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r182351 r182748  
    63336333      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
    63346334    </ClCompile>
    6335     <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitMouseForceEvent.cpp">
    6336       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
    6337       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    6338       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
    6339       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
    6340       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
    6341       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
    6342       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
    6343       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    6344       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
    6345       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
    6346       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
    6347       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
    6348     </ClCompile>
    63496335    <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitNamedFlow.cpp">
    63506336      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
     
    1424414230    </ClCompile>
    1424514231    <ClCompile Include="..\dom\WebKitAnimationEvent.cpp">
    14246       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
    14247       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    14248       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
    14249       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
    14250       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
    14251       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
    14252       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
    14253       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    14254       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
    14255       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
    14256       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
    14257       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
    14258     </ClCompile>
    14259     <ClCompile Include="..\dom\WebKitMouseForceEvent.cpp">
    1426014232      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
    1426114233      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
     
    1912219094    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitCSSRegionRule.h" />
    1912319095    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitCSSTransformValue.h" />
    19124     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitMouseForceEvent.h" />
    1912519096    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitNamedFlow.h" />
    1912619097    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitPoint.h" />
     
    2104521016    <ClInclude Include="..\dom\ViewportArguments.h" />
    2104621017    <ClInclude Include="..\dom\WebKitAnimationEvent.h" />
    21047     <ClInclude Include="..\dom\WebKitMouseForceEvent.h" />
    2104821018    <ClInclude Include="..\dom\WebKitNamedFlow.h" />
    2104921019    <ClInclude Include="..\dom\WebKitTransitionEvent.h" />
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

    r182351 r182748  
    33793379      <Filter>dom</Filter>
    33803380    </ClCompile>
    3381     <ClCompile Include="..\dom\WebKitMouseForceEvent.cpp">
    3382       <Filter>dom</Filter>
    3383     </ClCompile>
    33843381    <ClCompile Include="..\dom\WebKitNamedFlow.cpp">
    33853382      <Filter>dom</Filter>
     
    62166213    </ClCompile>
    62176214    <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitCSSTransformValue.cpp">
    6218       <Filter>DerivedSources</Filter>
    6219     </ClCompile>
    6220     <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitMouseForceEvent.cpp">
    62216215      <Filter>DerivedSources</Filter>
    62226216    </ClCompile>
     
    1049510489      <Filter>dom</Filter>
    1049610490    </ClInclude>
    10497     <ClInclude Include="..\dom\WebKitMouseForceEvent.h">
    10498       <Filter>dom</Filter>
    10499     </ClInclude>
    1050010491    <ClInclude Include="..\dom\WebKitNamedFlow.h">
    1050110492      <Filter>dom</Filter>
     
    1360013591    </ClInclude>
    1360113592    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitCSSTransformValue.h">
    13602       <Filter>DerivedSources</Filter>
    13603     </ClInclude>
    13604     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebKitMouseForceEvent.h">
    1360513593      <Filter>DerivedSources</Filter>
    1360613594    </ClInclude>
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r182650 r182748  
    34283428                93CCF0270AF6C52900018E89 /* NavigationAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CCF0260AF6C52900018E89 /* NavigationAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
    34293429                93CCF0600AF6CA7600018E89 /* NavigationAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93CCF05F0AF6CA7600018E89 /* NavigationAction.cpp */; };
    3430                 93D200ED1AB8ED090025E851 /* WebKitMouseForceEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93D200EB1AB8ED090025E851 /* WebKitMouseForceEvent.cpp */; };
    3431                 93D200EE1AB8ED090025E851 /* WebKitMouseForceEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D200EC1AB8ED090025E851 /* WebKitMouseForceEvent.h */; };
    3432                 93D200F21AB8F81F0025E851 /* JSWebKitMouseForceEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93D200F01AB8F81F0025E851 /* JSWebKitMouseForceEvent.cpp */; };
    3433                 93D200F31AB8F8200025E851 /* JSWebKitMouseForceEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D200F11AB8F81F0025E851 /* JSWebKitMouseForceEvent.h */; };
    34343430                93D3C1590F97A9D70053C013 /* DOMHTMLCanvasElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D3C1580F97A9D70053C013 /* DOMHTMLCanvasElement.h */; };
    34353431                93D3C17D0F97AA760053C013 /* DOMHTMLCanvasElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 93D3C1580F97A9D70053C013 /* DOMHTMLCanvasElement.h */; };
     
    1068010676                93CCF0260AF6C52900018E89 /* NavigationAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigationAction.h; sourceTree = "<group>"; };
    1068110677                93CCF05F0AF6CA7600018E89 /* NavigationAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NavigationAction.cpp; sourceTree = "<group>"; };
    10682                 93D200EB1AB8ED090025E851 /* WebKitMouseForceEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitMouseForceEvent.cpp; sourceTree = "<group>"; };
    10683                 93D200EC1AB8ED090025E851 /* WebKitMouseForceEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitMouseForceEvent.h; sourceTree = "<group>"; };
    10684                 93D200EF1AB8ED640025E851 /* WebKitMouseForceEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebKitMouseForceEvent.idl; sourceTree = "<group>"; };
    10685                 93D200F01AB8F81F0025E851 /* JSWebKitMouseForceEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitMouseForceEvent.cpp; sourceTree = "<group>"; };
    10686                 93D200F11AB8F81F0025E851 /* JSWebKitMouseForceEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitMouseForceEvent.h; sourceTree = "<group>"; };
    1068710678                93D3C1580F97A9D70053C013 /* DOMHTMLCanvasElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLCanvasElement.h; sourceTree = "<group>"; };
    1068810679                93D9D53B0DA27E180077216C /* RangeBoundaryPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RangeBoundaryPoint.h; sourceTree = "<group>"; };
     
    1973419725                                31C0FF390E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.cpp */,
    1973519726                                31C0FF3A0E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.h */,
    19736                                 93D200F01AB8F81F0025E851 /* JSWebKitMouseForceEvent.cpp */,
    19737                                 93D200F11AB8F81F0025E851 /* JSWebKitMouseForceEvent.h */,
    1973819727                                31C0FF3B0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp */,
    1973919728                                31C0FF3C0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h */,
     
    2320823197                                31C0FF1C0E4CEB6E007D6FE5 /* WebKitAnimationEvent.h */,
    2320923198                                31C0FF1D0E4CEB6E007D6FE5 /* WebKitAnimationEvent.idl */,
    23210                                 93D200EB1AB8ED090025E851 /* WebKitMouseForceEvent.cpp */,
    23211                                 93D200EC1AB8ED090025E851 /* WebKitMouseForceEvent.h */,
    23212                                 93D200EF1AB8ED640025E851 /* WebKitMouseForceEvent.idl */,
    2321323199                                D7613A4E1474F13F00DB8606 /* WebKitNamedFlow.cpp */,
    2321423200                                D7613A4D1474F13F00DB8606 /* WebKitNamedFlow.h */,
     
    2424924235                                BC1A37B6097C715F0019F3D8 /* DOMHTML.h in Headers */,
    2425024236                                319848081A1E6CB500A13318 /* DOMAnimationEvent.h in Headers */,
    24251                                 93D200F31AB8F8200025E851 /* JSWebKitMouseForceEvent.h in Headers */,
    2425224237                                85DF81270AA7787200486AD7 /* DOMHTMLAnchorElement.h in Headers */,
    2425324238                                85E7119B0AC5D5350053270F /* DOMHTMLAnchorElementInternal.h in Headers */,
     
    2661426599                                B2227A3C0D00BF220071B782 /* SVGLineElement.h in Headers */,
    2661526600                                0810764412828556007C63BA /* SVGListProperty.h in Headers */,
    26616                                 93D200EE1AB8ED090025E851 /* WebKitMouseForceEvent.h in Headers */,
    2661726601                                088A0E09126EF1DB00978F7A /* SVGListPropertyTearOff.h in Headers */,
    2661826602                                B2227A410D00BF220071B782 /* SVGLocatable.h in Headers */,
     
    2754527529                                2EDEF1F3121B0EFC00726DB2 /* BlobData.cpp in Sources */,
    2754627530                                E1D31CDC19196020001005A3 /* BlobDataFileReference.cpp in Sources */,
    27547                                 93D200ED1AB8ED090025E851 /* WebKitMouseForceEvent.cpp in Sources */,
    2754827531                                E164A2ED191AE6350010737D /* BlobDataFileReferenceMac.mm in Sources */,
    2754927532                                E14A94D716DFDF950068DE82 /* BlobRegistry.cpp in Sources */,
     
    2757427557                                4634592C1AC2271000ECB71C /* PowerObserverMac.cpp in Sources */,
    2757527558                                5081E3C33CE580C16EF8B48B /* CachedResourceRequest.cpp in Sources */,
    27576                                 93D200F21AB8F81F0025E851 /* JSWebKitMouseForceEvent.cpp in Sources */,
    2757727559                                6C638896A96CCEE50C8C946C /* CachedResourceRequestInitiators.cpp in Sources */,
    2757827560                                BCB16C230979C3BD00467741 /* CachedScript.cpp in Sources */,
  • trunk/Source/WebCore/dom/DOMAllInOne.cpp

    r182351 r182748  
    149149#include "VisitedLinkState.cpp"
    150150#include "WebKitAnimationEvent.cpp"
    151 #include "WebKitMouseForceEvent.cpp"
    152151#include "WebKitNamedFlow.cpp"
    153152#include "WebKitTransitionEvent.cpp"
  • trunk/Source/WebCore/dom/Element.cpp

    r182556 r182748  
    8080#include "TextIterator.h"
    8181#include "VoidCallback.h"
    82 #include "WebKitMouseForceEvent.h"
    8382#include "WheelEvent.h"
    8483#include "XLinkNames.h"
     
    22452244        return false;
    22462245
    2247     PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime());
    2248     RefPtr<Event> mouseForceWillBeginEvent =  WebKitMouseForceEvent::create(eventNames().webkitmouseforcewillbeginEvent, 0, platformMouseEvent, document().defaultView());
     2246    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtClick);
     2247    RefPtr<MouseEvent> mouseForceWillBeginEvent =  MouseEvent::create(eventNames().webkitmouseforcewillbeginEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
    22492248    mouseForceWillBeginEvent->setTarget(this);
    22502249    dispatchEvent(mouseForceWillBeginEvent);
     
    22552254}
    22562255
    2257 void Element::dispatchMouseForceChanged(float force, const PlatformMouseEvent& platformMouseEvent)
     2256void Element::dispatchMouseForceChanged(float force)
    22582257{
    22592258    if (!document().hasListenerType(Document::FORCECHANGED_LISTENER))
    22602259        return;
    22612260
    2262     RefPtr<WebKitMouseForceEvent> mouseForceChangedEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforcechangedEvent, force, platformMouseEvent, document().defaultView());
     2261    Frame* frame = document().frame();
     2262    if (!frame)
     2263        return;
     2264
     2265    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), force);
     2266    RefPtr<MouseEvent> mouseForceChangedEvent =  MouseEvent::create(eventNames().webkitmouseforcechangedEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
     2267
    22632268    mouseForceChangedEvent->setTarget(this);
    22642269    dispatchEvent(mouseForceChangedEvent);
    22652270}
    22662271
    2267 void Element::dispatchMouseForceDown(const PlatformMouseEvent& platformMouseEvent)
     2272void Element::dispatchMouseForceDown()
    22682273{
    22692274    if (!document().hasListenerType(Document::FORCEDOWN_LISTENER))
    22702275        return;
    22712276
    2272     RefPtr<Event> mouseForceDownEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforcedownEvent, 1, platformMouseEvent, document().defaultView());
     2277    Frame* frame = document().frame();
     2278    if (!frame)
     2279        return;
     2280
     2281    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtForceClick);
     2282    RefPtr<MouseEvent> mouseForceDownEvent =  MouseEvent::create(eventNames().webkitmouseforcedownEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
     2283
    22732284    mouseForceDownEvent->setTarget(this);
    22742285    dispatchEvent(mouseForceDownEvent);
    22752286}
    22762287
    2277 void Element::dispatchMouseForceUp(const PlatformMouseEvent& platformMouseEvent)
     2288void Element::dispatchMouseForceUp()
    22782289{
    22792290    if (!document().hasListenerType(Document::FORCEUP_LISTENER))
    22802291        return;
    22812292
    2282     RefPtr<Event> mouseForceUpEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforceupEvent, 1, platformMouseEvent, document().defaultView());
     2293    Frame* frame = document().frame();
     2294    if (!frame)
     2295        return;
     2296
     2297    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtForceClick);
     2298    RefPtr<MouseEvent> mouseForceUpEvent =  MouseEvent::create(eventNames().webkitmouseforceupEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
     2299
    22832300    mouseForceUpEvent->setTarget(this);
    22842301    dispatchEvent(mouseForceUpEvent);
    22852302}
    22862303
    2287 void Element::dispatchMouseForceClick(const PlatformMouseEvent& platformMouseEvent)
     2304void Element::dispatchMouseForceClick()
    22882305{
    22892306    if (!document().hasListenerType(Document::FORCECLICK_LISTENER))
    22902307        return;
    22912308
    2292     RefPtr<Event> mouseForceClickEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforceclickEvent, 1, platformMouseEvent, document().defaultView());
     2309    Frame* frame = document().frame();
     2310    if (!frame)
     2311        return;
     2312
     2313    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtForceClick);
     2314    RefPtr<MouseEvent> mouseForceClickEvent =  MouseEvent::create(eventNames().webkitmouseforceclickEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
     2315
    22932316    mouseForceClickEvent->setTarget(this);
    22942317    dispatchEvent(mouseForceClickEvent);
    22952318}
    22962319
    2297 void Element::dispatchMouseForceCancelled(const PlatformMouseEvent& platformMouseEvent)
     2320void Element::dispatchMouseForceCancelled()
    22982321{
    22992322    if (!document().hasListenerType(Document::FORCECANCELLED_LISTENER))
    23002323        return;
    23012324
    2302     RefPtr<Event> mouseForceCancelledEvent = WebKitMouseForceEvent::create(eventNames().webkitmouseforcecancelledEvent, 0, platformMouseEvent, document().defaultView());
     2325    Frame* frame = document().frame();
     2326    if (!frame)
     2327        return;
     2328
     2329    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), 0);
     2330    RefPtr<MouseEvent> mouseForceCancelledEvent =  MouseEvent::create(eventNames().webkitmouseforcecancelledEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
     2331
    23032332    mouseForceCancelledEvent->setTarget(this);
    23042333    dispatchEvent(mouseForceCancelledEvent);
     
    23122341}
    23132342
    2314 void Element::dispatchMouseForceChanged(float, const PlatformMouseEvent&)
    2315 {
    2316 }
    2317 
    2318 void Element::dispatchMouseForceDown(const PlatformMouseEvent&)
    2319 {
    2320 }
    2321 
    2322 void Element::dispatchMouseForceUp(const PlatformMouseEvent&)
    2323 {
    2324 }
    2325 
    2326 void Element::dispatchMouseForceClick(const PlatformMouseEvent&)
    2327 {
    2328 }
    2329 
    2330 void Element::dispatchMouseForceCancelled(const PlatformMouseEvent&)
     2343void Element::dispatchMouseForceChanged(float)
     2344{
     2345}
     2346
     2347void Element::dispatchMouseForceDown()
     2348{
     2349}
     2350
     2351void Element::dispatchMouseForceUp()
     2352{
     2353}
     2354
     2355void Element::dispatchMouseForceClick()
     2356{
     2357}
     2358
     2359void Element::dispatchMouseForceCancelled()
    23312360{
    23322361}
  • trunk/Source/WebCore/dom/Element.h

    r182215 r182748  
    470470
    471471    WEBCORE_EXPORT bool dispatchMouseForceWillBegin();
    472     WEBCORE_EXPORT void dispatchMouseForceChanged(float force, const PlatformMouseEvent&);
    473     WEBCORE_EXPORT void dispatchMouseForceDown(const PlatformMouseEvent&);
    474     WEBCORE_EXPORT void dispatchMouseForceUp(const PlatformMouseEvent&);
    475     WEBCORE_EXPORT void dispatchMouseForceClick(const PlatformMouseEvent&);
    476     WEBCORE_EXPORT void dispatchMouseForceCancelled(const PlatformMouseEvent&);
     472    WEBCORE_EXPORT void dispatchMouseForceChanged(float force);
     473    WEBCORE_EXPORT void dispatchMouseForceDown();
     474    WEBCORE_EXPORT void dispatchMouseForceUp();
     475    WEBCORE_EXPORT void dispatchMouseForceClick();
     476    WEBCORE_EXPORT void dispatchMouseForceCancelled();
    477477
    478478    virtual bool willRecalcStyle(Style::Change);
  • trunk/Source/WebCore/dom/EventNames.in

    r181907 r182748  
    2929UIEvents interfaceName=UIEvent
    3030WebKitAnimationEvent
    31 WebKitMouseForceEvent
    3231WebKitTransitionEvent
    3332WheelEvent
  • trunk/Source/WebCore/dom/MouseEvent.cpp

    r177264 r182748  
    6767#endif
    6868        event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.button(),
    69         relatedTarget);
     69        relatedTarget, event.force());
    7070}
    7171
     
    7676#endif
    7777    bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
    78     PassRefPtr<EventTarget> relatedTarget)
     78    PassRefPtr<EventTarget> relatedTarget, double force)
    7979
    8080{
     
    8484        movementX, movementY,
    8585#endif
    86         ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, 0, false);
     86        ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, force, 0, false);
    8787}
    8888
     
    9393#endif
    9494    bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
    95     PassRefPtr<EventTarget> relatedTarget, PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
     95    PassRefPtr<EventTarget> relatedTarget, double force, PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
    9696{
    9797    return adoptRef(*new MouseEvent(type, canBubble, cancelable, timestamp, view,
     
    100100        movementX, movementY,
    101101#endif
    102         ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, dataTransfer, isSimulated));
     102        ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, force, dataTransfer, isSimulated));
    103103}
    104104
     
    115115#endif
    116116                       bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
    117                        unsigned short button, PassRefPtr<EventTarget> relatedTarget,
     117                       unsigned short button, PassRefPtr<EventTarget> relatedTarget, double force,
    118118                       PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
    119119    : MouseRelatedEvent(eventType, canBubble, cancelable, timestamp, view, detail, IntPoint(screenX, screenY),
     
    126126    , m_buttonDown(button != (unsigned short)-1)
    127127    , m_relatedTarget(relatedTarget)
     128    , m_force(force)
    128129    , m_dataTransfer(dataTransfer)
    129130{
     
    255256        // Nullifies relatedTarget.
    256257        0);
     258    clonedMouseEvent->setForce(force());
    257259    return clonedMouseEvent.release();
    258260}
     
    272274                 0, 0,
    273275#endif
    274                  false, false, false, false, 0, 0, 0, true)
     276                 false, false, false, false, 0, 0, 0, 0, true)
    275277{
    276278    if (UIEventWithKeyState* keyStateEvent = findEventWithKeyState(underlyingEvent.get())) {
  • trunk/Source/WebCore/dom/MouseEvent.h

    r177739 r182748  
    6060#endif
    6161        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
    62         PassRefPtr<EventTarget> relatedTarget);
     62        PassRefPtr<EventTarget> relatedTarget, double force);
    6363
    6464    WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView>,
     
    6868#endif
    6969        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
    70         PassRefPtr<EventTarget> relatedTarget, PassRefPtr<DataTransfer>, bool isSimulated = false);
     70        PassRefPtr<EventTarget> relatedTarget, double force, PassRefPtr<DataTransfer>, bool isSimulated = false);
    7171
    7272    WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& eventType, PassRefPtr<AbstractView>, const PlatformMouseEvent&, int detail, PassRefPtr<Node> relatedTarget);
     
    8787    virtual EventTarget* relatedTarget() const override final { return m_relatedTarget.get(); }
    8888    void setRelatedTarget(PassRefPtr<EventTarget> relatedTarget) { m_relatedTarget = relatedTarget; }
    89 
     89    double force() const { return m_force; }
     90    void setForce(double force) { m_force = force; }
    9091
    9192    Node* toElement() const;
     
    113114#endif
    114115        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
    115         PassRefPtr<EventTarget> relatedTarget, PassRefPtr<DataTransfer>, bool isSimulated);
     116        PassRefPtr<EventTarget> relatedTarget, double force, PassRefPtr<DataTransfer>, bool isSimulated);
    116117
    117118    MouseEvent(const AtomicString& type, const MouseEventInit&);
     
    123124    bool m_buttonDown;
    124125    RefPtr<EventTarget> m_relatedTarget;
     126    double m_force { 0 };
    125127    RefPtr<DataTransfer> m_dataTransfer;
    126128};
  • trunk/Source/WebCore/dom/MouseEvent.idl

    r170585 r182748  
    11/*
    2  * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006, 2007, 2015 Apple Inc. All rights reserved.
    33 *
    44 * This library is free software; you can redistribute it and/or
     
    3434    [Conditional=POINTER_LOCK]      readonly attribute long             movementX;
    3535    [Conditional=POINTER_LOCK]      readonly attribute long             movementY;
     36    [Conditional=MOUSE_FORCE_EVENTS]readonly attribute double           force;
    3637   
    3738    [ObjCLegacyUnnamedParameters] void initMouseEvent([Default=Undefined] optional DOMString type,
  • trunk/Source/WebCore/dom/WheelEvent.cpp

    r171685 r182748  
    7171                , 0, 0
    7272#endif
    73                 , event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 0, 0, 0, false)
     73                , event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 0, 0, 0, 0, false)
    7474    , m_wheelDelta(event.wheelTicksX() * TickMultiplier, event.wheelTicksY() * TickMultiplier)
    7575    , m_deltaX(-event.deltaX())
  • trunk/Source/WebCore/page/ContextMenuController.cpp

    r182573 r182748  
    14341434   
    14351435    // Simulate a click in the middle of the accessibility object.
    1436     PlatformMouseEvent mouseEvent(clickPoint, clickPoint, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime());
     1436    PlatformMouseEvent mouseEvent(clickPoint, clickPoint, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), ForceAtClick);
    14371437    frame->eventHandler().handleMousePressEvent(mouseEvent);
    14381438    bool handled = frame->eventHandler().sendContextMenuEvent(mouseEvent);
  • trunk/Source/WebCore/page/DragController.cpp

    r181760 r182748  
    9494    return PlatformMouseEvent(dragData.clientPosition(), dragData.globalPosition(),
    9595                              LeftButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey,
    96                               metaKey, currentTime());
     96                              metaKey, currentTime(), ForceAtClick);
    9797}
    9898
  • trunk/Source/WebCore/page/EventHandler.cpp

    r182334 r182748  
    21602160#endif
    21612161        event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(),
    2162         0, 0, dataTransfer);
     2162        0, 0, event.force(), dataTransfer);
    21632163
    21642164    dragTarget.dispatchEvent(me.get(), IGNORE_EXCEPTION);
     
    28502850#endif
    28512851
    2852     PlatformMouseEvent platformMouseEvent(position, globalPosition, RightButton, eventType, 1, false, false, false, false, WTF::currentTime());
     2852    PlatformMouseEvent platformMouseEvent(position, globalPosition, RightButton, eventType, 1, false, false, false, false, WTF::currentTime(), ForceAtClick);
    28532853
    28542854    return !dispatchMouseEvent(eventNames().contextmenuEvent, targetNode, true, 0, platformMouseEvent, false);
     
    29372937    bool metaKey;
    29382938    PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey);
    2939     PlatformMouseEvent fakeMouseMoveEvent(m_lastKnownMousePosition, m_lastKnownMouseGlobalPosition, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, currentTime());
     2939    PlatformMouseEvent fakeMouseMoveEvent(m_lastKnownMousePosition, m_lastKnownMouseGlobalPosition, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, currentTime(), 0);
    29402940    mouseMoved(fakeMouseMoveEvent);
    29412941}
     
    40214021}
    40224022
    4023 const PlatformMouseEvent& EventHandler::lastMouseDownEvent() const
    4024 {
    4025     return m_mouseDown;
    4026 }
    4027 
    40284023void EventHandler::setImmediateActionStage(ImmediateActionStage stage)
    40294024{
  • trunk/Source/WebCore/page/EventHandler.h

    r182334 r182748  
    313313
    314314    WEBCORE_EXPORT void setImmediateActionStage(ImmediateActionStage stage);
    315     WEBCORE_EXPORT const PlatformMouseEvent& lastMouseDownEvent() const;
    316315
    317316private:
  • trunk/Source/WebCore/platform/PlatformMouseEvent.h

    r182581 r182748  
    4343
    4444namespace WebCore {
    45    
     45
     46const double ForceAtClick = 0;
     47const double ForceAtForceClick = 1;
     48
    4649    // These button numbers match the ones used in the DOM API, 0 through 2, except for NoButton which isn't specified.
    4750    enum MouseButton : int8_t { NoButton = -1, LeftButton, MiddleButton, RightButton };
     
    6467
    6568        PlatformMouseEvent(const IntPoint& position, const IntPoint& globalPosition, MouseButton button, PlatformEvent::Type type,
    66                            int clickCount, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, double timestamp)
     69                           int clickCount, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, double timestamp, double force)
    6770            : PlatformEvent(type, shiftKey, ctrlKey, altKey, metaKey, timestamp)
    6871            , m_position(position)
     
    7174            , m_clickCount(clickCount)
    7275            , m_modifierFlags(0)
     76            , m_force(force)
    7377#if PLATFORM(MAC)
    7478            , m_eventNumber(0)
     
    8993        int clickCount() const { return m_clickCount; }
    9094        unsigned modifierFlags() const { return m_modifierFlags; }
     95        double force() const { return m_force; }
    9196       
    9297
     
    124129        int m_clickCount;
    125130        unsigned m_modifierFlags;
     131        double m_force { 0 };
    126132
    127133#if PLATFORM(MAC)
  • trunk/Source/WebCore/replay/SerializationMethods.cpp

    r181562 r182748  
    315315    ENCODE_TYPE_WITH_KEY(encodedValue, bool, metaKey, input.metaKey());
    316316    ENCODE_TYPE_WITH_KEY(encodedValue, int, timestamp, input.timestamp());
     317    ENCODE_TYPE_WITH_KEY(encodedValue, double, force, input.force());
    317318
    318319    return encodedValue;
     
    333334    DECODE_TYPE_WITH_KEY(encodedValue, bool, metaKey);
    334335    DECODE_TYPE_WITH_KEY(encodedValue, int, timestamp);
     336    DECODE_TYPE_WITH_KEY(encodedValue, double, force);
    335337
    336338    input = std::make_unique<PlatformMouseEvent>(IntPoint(positionX, positionY),
    337339        IntPoint(globalPositionX, globalPositionY),
    338340        button, type, clickCount,
    339         shiftKey, ctrlKey, altKey, metaKey, timestamp);
     341        shiftKey, ctrlKey, altKey, metaKey, timestamp, force);
    340342    return true;
    341343}
  • trunk/Source/WebKit/ios/ChangeLog

    r182207 r182748  
     12015-04-13  Beth Dakin  <bdakin@apple.com>
     2
     3        Add force property to MouseEvents
     4        https://bugs.webkit.org/show_bug.cgi?id=143569
     5        -and corresponding-
     6        rdar://problem/20472954
     7
     8        Reviewed by Darin Adler.
     9
     10        Send the appropriate force with this simulated click event.
     11        * WebView/WebPDFViewPlaceholder.mm:
     12        (-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]):
     13
    1142015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
    215
  • trunk/Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm

    r180110 r182748  
    472472        0, 0,
    473473#endif
    474         false, false, false, false, 0, 0, 0, true);
     474        false, false, false, false, 0, 0, 0, 0, true);
    475475
    476476    // Call to the frame loader because this is where our security checks are made.
  • trunk/Source/WebKit/mac/ChangeLog

    r182735 r182748  
     12015-04-13  Beth Dakin  <bdakin@apple.com>
     2
     3        Add force property to MouseEvents
     4        https://bugs.webkit.org/show_bug.cgi?id=143569
     5        -and corresponding-
     6        rdar://problem/20472954
     7
     8        Reviewed by Darin Adler.
     9
     10        PlatformMouseEvent and MouseEvent now take force parameters.
     11        * WebView/WebFrame.mm:
     12        (-[WebFrame _dragSourceEndedAt:operation:]):
     13        * WebView/WebPDFView.mm:
     14        (-[WebPDFView PDFViewWillClickOnLink:withURL:]):
     15
    1162015-04-12  Darin Adler  <darin@apple.com>
    217
  • trunk/Source/WebKit/mac/WebView/WebFrame.mm

    r182544 r182748  
    967967    // FIXME: These are fake modifier keys here, but they should be real ones instead.
    968968    PlatformMouseEvent event(IntPoint(windowLoc), globalPoint(windowLoc, [view->platformWidget() window]),
    969         LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime());
     969        LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), WebCore::ForceAtClick);
    970970    _private->coreFrame->eventHandler().dragSourceEndedAt(event, (DragOperation)operation);
    971971}
  • trunk/Source/WebKit/mac/WebView/WebPDFView.mm

    r180110 r182748  
    10281028            [nsEvent modifierFlags] & NSShiftKeyMask,
    10291029            [nsEvent modifierFlags] & NSCommandKeyMask,
    1030             button, 0, 0, true);
     1030            button, 0, WebCore::ForceAtClick, 0, true);
    10311031    }
    10321032
  • trunk/Source/WebKit/win/ChangeLog

    r182736 r182748  
     12015-04-13  Beth Dakin  <bdakin@apple.com>
     2
     3        Add force property to MouseEvents
     4        https://bugs.webkit.org/show_bug.cgi?id=143569
     5        -and corresponding-
     6        rdar://problem/20472954
     7
     8        Reviewed by Darin Adler.
     9
     10        PlatformMouseEvent takes a force parameter.
     11        * WebDropSource.cpp:
     12        (generateMouseEvent):
     13
    1142015-04-13  Per Arne Vollan  <peavo@outlook.com>
    215
  • trunk/Source/WebKit/win/WebDropSource.cpp

    r176892 r182748  
    102102        ::ScreenToClient(viewWindow, reinterpret_cast<LPPOINT>(&localpt));
    103103    return PlatformMouseEvent(IntPoint(localpt.x, localpt.y), IntPoint(pt.x, pt.y),
    104         isDrag ? LeftButton : NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime());
     104        isDrag ? LeftButton : NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), 0);
    105105}
    106106
  • trunk/Source/WebKit2/ChangeLog

    r182747 r182748  
     12015-04-13  Beth Dakin  <bdakin@apple.com>
     2
     3        Add force property to MouseEvents
     4        https://bugs.webkit.org/show_bug.cgi?id=143569
     5        -and corresponding-
     6        rdar://problem/20472954
     7
     8        Reviewed by Darin Adler.
     9
     10        In order to accommodate adding force to all PlatformMouseEvents, we have to add it
     11        to pass a caches pressure event to NativeWebMouseEvent and add force to
     12        WebMouseEvent.
     13
     14        NativeWebMouseEvent now requires a second NSEvent for the pressureEvent.
     15        * Shared/NativeWebMouseEvent.h:
     16
     17        WebMouseEvent takes a force parameter.
     18        * Shared/WebEvent.h:
     19        (WebKit::WebMouseEvent::force):
     20        * Shared/WebEventConversion.cpp:
     21        (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
     22        * Shared/WebMouseEvent.cpp:
     23        (WebKit::WebMouseEvent::WebMouseEvent):
     24        (WebKit::WebMouseEvent::encode):
     25        (WebKit::WebMouseEvent::decode):
     26        * Shared/mac/NativeWebMouseEventMac.mm:
     27        (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
     28        * Shared/mac/WebEventFactory.h:
     29        * Shared/mac/WebEventFactory.mm:
     30        (WebKit::WebEventFactory::createWebMouseEvent):
     31
     32        Cache the most recent pressureEvent in _data so that it can be sent along to the
     33        NativeWebMouseEvent constructor.
     34        * UIProcess/API/mac/WKView.mm:
     35        (-[WKView pressureChangeWithEvent:]):
     36        (-[WKView acceptsFirstMouse:]):
     37        (-[WKView shouldDelayWindowOrderingForEvent:]):
     38        (-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]):
     39        (-[WKView initWithFrame:processPool:configuration:webView:]):
     40
     41        WebMouseEvent takes a force parameter.
     42        * WebProcess/Plugins/PDF/PDFPlugin.mm:
     43        (WebKit::PDFPlugin::showContextMenuAtPoint):
     44        * WebProcess/Plugins/PluginView.cpp:
     45        (WebKit::PluginView::createWebEvent):
     46
     47        MouseEvent and PlatformMouseEvent both take force parameters too.
     48        * WebProcess/WebPage/WebPage.cpp:
     49        (WebKit::WebPage::navigateToURLWithSimulatedClick):
     50        (WebKit::WebPage::contextMenuAtPointInWindow):
     51        (WebKit::WebPage::dragEnded):
     52        (WebKit::WebPage::simulateMouseDown):
     53        (WebKit::WebPage::simulateMouseUp):
     54        (WebKit::WebPage::simulateMouseMotion):
     55
     56        The functions that dispatch the force events no longer take a PlatformMouseEvent
     57        as a parameter.
     58        * WebProcess/WebPage/mac/WebPageMac.mm:
     59        (WebKit::WebPage::inputDeviceForceDidChange):
     60        (WebKit::WebPage::immediateActionDidCancel):
     61
    1622015-04-13  Andreas Kling  <akling@apple.com>
    263
  • trunk/Source/WebKit2/Shared/NativeWebMouseEvent.h

    r166763 r182748  
    5050public:
    5151#if USE(APPKIT)
    52     NativeWebMouseEvent(NSEvent *, NSView *);
     52    NativeWebMouseEvent(NSEvent *, NSEvent *pressureEvent, NSView *);
    5353#elif PLATFORM(GTK)
    5454    NativeWebMouseEvent(const NativeWebMouseEvent&);
  • trunk/Source/WebKit2/Shared/WebEvent.h

    r182581 r182748  
    125125
    126126#if PLATFORM(MAC)
    127     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);
     127    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);
    128128#else
    129     WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp);
     129    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);
    130130#endif
    131131
     
    141141    int32_t menuTypeForEvent() const { return m_menuTypeForEvent; }
    142142#endif
     143    double force() const { return m_force; }
    143144
    144145    void encode(IPC::ArgumentEncoder&) const;
     
    159160    int32_t m_menuTypeForEvent;
    160161#endif
     162    double m_force { 0 };
    161163};
    162164
  • trunk/Source/WebKit2/Shared/WebEventConversion.cpp

    r182581 r182748  
    3939        case WebEvent::MouseDown:
    4040            m_type = WebCore::PlatformEvent::MousePressed;
     41            m_force = WebCore::ForceAtClick;
    4142            break;
    4243        case WebEvent::MouseUp:
    4344            m_type = WebCore::PlatformEvent::MouseReleased;
     45            m_force = WebCore::ForceAtClick;
    4446            break;
    4547        case WebEvent::MouseMove:
    4648            m_type = WebCore::PlatformEvent::MouseMoved;
     49            m_force = webEvent.force();
    4750            break;
    4851        default:
  • trunk/Source/WebKit2/Shared/WebMouseEvent.cpp

    r182581 r182748  
    4949
    5050#if PLATFORM(MAC)
    51 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)
     51WebMouseEvent::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)
    5252#else
    53 WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp)
     53WebMouseEvent::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)
    5454#endif
    5555    : WebEvent(type, modifiers, timestamp)
     
    6565    , m_menuTypeForEvent(menuType)
    6666#endif
     67    , m_force(force)
    6768{
    6869    ASSERT(isMouseEventType(type));
     
    8485    encoder << m_menuTypeForEvent;
    8586#endif
     87    encoder << m_force;
    8688}
    8789
     
    111113        return false;
    112114#endif
     115    if (!decoder.decode(result.m_force))
     116        return false;
    113117
    114118    return true;
  • trunk/Source/WebKit2/Shared/mac/NativeWebMouseEventMac.mm

    r119349 r182748  
    3333namespace WebKit {
    3434
    35 NativeWebMouseEvent::NativeWebMouseEvent(NSEvent* event, NSView* view)
    36     : WebMouseEvent(WebEventFactory::createWebMouseEvent(event, view))
     35NativeWebMouseEvent::NativeWebMouseEvent(NSEvent *event, NSEvent *pressureEvent, NSView *view)
     36    : WebMouseEvent(WebEventFactory::createWebMouseEvent(event, pressureEvent, view))
    3737    , m_nativeEvent(event)
    3838{
  • trunk/Source/WebKit2/Shared/mac/WebEventFactory.h

    r182581 r182748  
    4343public:
    4444#if USE(APPKIT)
    45     static WebMouseEvent createWebMouseEvent(NSEvent *, NSView *windowView);
     45    static WebMouseEvent createWebMouseEvent(NSEvent *, NSEvent *pressureEvent, NSView *windowView);
    4646    static WebWheelEvent createWebWheelEvent(NSEvent *, NSView *windowView);
    4747    static WebKeyboardEvent createWebKeyboardEvent(NSEvent *, bool handledByInputMethod, const Vector<WebCore::KeypressCommand>&);
  • trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm

    r182589 r182748  
    359359}
    360360
    361 WebMouseEvent WebEventFactory::createWebMouseEvent(NSEvent *event, NSView *windowView)
     361WebMouseEvent WebEventFactory::createWebMouseEvent(NSEvent *event, NSEvent *pressureEvent, NSView *windowView)
    362362{
    363363    NSPoint position = pointForEvent(event, windowView);
     
    375375    int menuTypeForEvent                    = typeForEvent(event);
    376376
    377     return WebMouseEvent(type, button, IntPoint(position), IntPoint(globalPosition), deltaX, deltaY, deltaZ, clickCount, modifiers, timestamp, eventNumber, menuTypeForEvent);
     377    double force = 0;
     378#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101003
     379    force = pressureEvent.stage < 1 ? pressureEvent.pressure : pressureEvent.pressure + pressureEvent.stage - 1;
     380#endif
     381
     382    return WebMouseEvent(type, button, IntPoint(position), IntPoint(globalPosition), deltaX, deltaY, deltaZ, clickCount, modifiers, timestamp, force, eventNumber, menuTypeForEvent);
    378383}
    379384
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r182640 r182748  
    225225    BOOL _willBecomeFirstResponderAgain;
    226226    NSEvent *_mouseDownEvent;
     227    NSEvent *_pressureEvent;
    227228    BOOL _ignoringMouseDraggedEvents;
    228229
     
    12501251                    LOG(TextInput, "%s was handled by text input context", String(#Selector).substring(0, String(#Selector).find("Internal")).ascii().data()); \
    12511252                else { \
    1252                     NativeWebMouseEvent webEvent(theEvent, self); \
     1253                    NativeWebMouseEvent webEvent(theEvent, _data->_pressureEvent, self); \
    12531254                    _data->_page->handleMouseEvent(webEvent); \
    12541255                } \
     
    12601261            return; \
    12611262        } \
    1262         NativeWebMouseEvent webEvent(theEvent, self); \
     1263        NativeWebMouseEvent webEvent(theEvent, _data->_pressureEvent, self); \
    12631264        _data->_page->handleMouseEvent(webEvent); \
    12641265    }
     
    12731274                    LOG(TextInput, "%s was handled by text input context", String(#Selector).substring(0, String(#Selector).find("Internal")).ascii().data()); \
    12741275                else { \
    1275                     NativeWebMouseEvent webEvent(theEvent, self); \
     1276                    NativeWebMouseEvent webEvent(theEvent, _data->_pressureEvent, self); \
    12761277                    _data->_page->handleMouseEvent(webEvent); \
    12771278                } \
     
    12791280            return; \
    12801281        } \
    1281         NativeWebMouseEvent webEvent(theEvent, self); \
     1282        NativeWebMouseEvent webEvent(theEvent, _data->_pressureEvent, self); \
    12821283        _data->_page->handleMouseEvent(webEvent); \
    12831284    }
     
    12961297            return; \
    12971298        } \
    1298         NativeWebMouseEvent webEvent(theEvent, self); \
     1299        NativeWebMouseEvent webEvent(theEvent, _data->_pressureEvent, self); \
    12991300        _data->_page->handleMouseEvent(webEvent); \
    13001301    }
     
    13081309            return; \
    13091310        } \
    1310         NativeWebMouseEvent webEvent(theEvent, self); \
     1311        NativeWebMouseEvent webEvent(theEvent, _data->_pressureEvent, self); \
    13111312        _data->_page->handleMouseEvent(webEvent); \
    13121313    }
     
    14181419{
    14191420#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101003
    1420     if (event.phase == NSEventPhaseChanged || event.phase == NSEventPhaseBegan || event.phase == NSEventPhaseEnded)
    1421         _data->_page->inputDeviceForceDidChange(event.pressure, event.stage);
     1421    if (event == _data->_pressureEvent)
     1422        return;
     1423
     1424    if (event.phase != NSEventPhaseChanged && event.phase != NSEventPhaseBegan && event.phase != NSEventPhaseEnded)
     1425        return;
     1426
     1427    [_data->_pressureEvent release];
     1428    _data->_pressureEvent = [event retain];
     1429
     1430    _data->_page->inputDeviceForceDidChange(event.pressure, event.stage);
    14221431#endif
    14231432}
     
    14341443   
    14351444    [self _setMouseDownEvent:event];
    1436     bool result = _data->_page->acceptsFirstMouse([event eventNumber], WebEventFactory::createWebMouseEvent(event, self));
     1445    bool result = _data->_page->acceptsFirstMouse([event eventNumber], WebEventFactory::createWebMouseEvent(event, _data->_pressureEvent, self));
    14371446    [self _setMouseDownEvent:nil];
    14381447    return result;
     
    14551464   
    14561465    [self _setMouseDownEvent:event];
    1457     bool result = _data->_page->shouldDelayWindowOrderingForEvent(WebEventFactory::createWebMouseEvent(event, self));
     1466    bool result = _data->_page->shouldDelayWindowOrderingForEvent(WebEventFactory::createWebMouseEvent(event, _data->_pressureEvent, self));
    14581467    [self _setMouseDownEvent:nil];
    14591468    return result;
     
    29712980        modifierFlags:[flagsChangedEvent modifierFlags] timestamp:[flagsChangedEvent timestamp] windowNumber:[flagsChangedEvent windowNumber]
    29722981        context:[flagsChangedEvent context] eventNumber:0 clickCount:0 pressure:0];
    2973     NativeWebMouseEvent webEvent(fakeEvent, self);
     2982    NativeWebMouseEvent webEvent(fakeEvent, _data->_pressureEvent, self);
    29742983    _data->_page->handleMouseEvent(webEvent);
    29752984}
     
    37763785
    37773786    _data->_mouseDownEvent = nil;
     3787    _data->_pressureEvent = nil;
    37783788    _data->_ignoringMouseDraggedEvents = NO;
    37793789    _data->_clipsToVisibleRect = NO;
  • trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm

    r182746 r182748  
    14591459    FrameView* frameView = webFrame()->coreFrame()->view();
    14601460    IntPoint contentsPoint = frameView->contentsToRootView(point);
    1461     WebMouseEvent event(WebEvent::MouseDown, WebMouseEvent::RightButton, contentsPoint, contentsPoint, 0, 0, 0, 1, static_cast<WebEvent::Modifiers>(0), monotonicallyIncreasingTime());
     1461    WebMouseEvent event(WebEvent::MouseDown, WebMouseEvent::RightButton, contentsPoint, contentsPoint, 0, 0, 0, 1, static_cast<WebEvent::Modifiers>(0), monotonicallyIncreasingTime(), WebCore::ForceAtClick);
    14621462    return handleContextMenuEvent(event);
    14631463}
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp

    r182271 r182748  
    888888        modifiers |= WebEvent::MetaKey;
    889889
    890     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);
     890    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);
    891891}
    892892
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r182623 r182748  
    10911091
    10921092    const int singleClick = 1;
    1093     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);
     1093    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);
    10941094    mainFrame->loader().urlSelected(mainFrameDocument->completeURL(url), emptyString(), mouseEvent.release(), LockHistory::No, LockBackForwardList::No, ShouldSendReferrer::MaybeSendReferrer);
    10951095}
     
    17831783   
    17841784    // Simulate a mouse click to generate the correct menu.
    1785     PlatformMouseEvent mouseEvent(point, point, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime());
     1785    PlatformMouseEvent mouseEvent(point, point, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick);
    17861786    bool handled = corePage()->userInputBridge().handleContextMenuEvent(mouseEvent, &corePage()->mainFrame());
    17871787    if (!handled)
     
    30883088        return;
    30893089    // FIXME: These are fake modifier keys here, but they should be real ones instead.
    3090     PlatformMouseEvent event(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime());
     3090    PlatformMouseEvent event(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), 0);
    30913091    m_page->mainFrame().eventHandler().dragSourceEndedAt(event, (DragOperation)operation);
    30923092}
     
    40174017void WebPage::simulateMouseDown(int button, WebCore::IntPoint position, int clickCount, WKEventModifiers modifiers, double time)
    40184018{
    4019     mouseEvent(WebMouseEvent(WebMouseEvent::MouseDown, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time));
     4019    mouseEvent(WebMouseEvent(WebMouseEvent::MouseDown, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time, WebCore::ForceAtClick));
    40204020}
    40214021
    40224022void WebPage::simulateMouseUp(int button, WebCore::IntPoint position, int clickCount, WKEventModifiers modifiers, double time)
    40234023{
    4024     mouseEvent(WebMouseEvent(WebMouseEvent::MouseUp, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time));
     4024    mouseEvent(WebMouseEvent(WebMouseEvent::MouseUp, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time, WebCore::ForceAtClick));
    40254025}
    40264026
    40274027void WebPage::simulateMouseMotion(WebCore::IntPoint position, double time)
    40284028{
    4029     mouseEvent(WebMouseEvent(WebMouseEvent::MouseMove, WebMouseEvent::NoButton, position, position, 0, 0, 0, 0, WebMouseEvent::Modifiers(), time));
     4029    mouseEvent(WebMouseEvent(WebMouseEvent::MouseMove, WebMouseEvent::NoButton, position, position, 0, 0, 0, 0, WebMouseEvent::Modifiers(), time, 0));
    40304030}
    40314031
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r182603 r182748  
    523523    WKBeginObservingContentChanges(true);
    524524
    525     mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0));
     525    mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0, WebCore::ForceAtClick));
    526526    mainframe.document()->updateStyleIfNeeded();
    527527
     
    570570    bool tapWasHandled = false;
    571571    m_lastInteractionLocation = roundedAdjustedPoint;
    572     tapWasHandled |= mainframe.eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, 0));
    573     tapWasHandled |= mainframe.eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, false, false, false, false, 0));
     572    tapWasHandled |= mainframe.eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, 0, WebCore::ForceAtClick));
     573    tapWasHandled |= mainframe.eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, false, false, false, false, 0, WebCore::ForceAtClick));
    574574
    575575    RefPtr<Frame> newFocusedFrame = m_page->focusController().focusedFrame();
     
    686686    Frame& mainframe = m_page->mainFrame();
    687687
    688     mainframe.eventHandler().mouseMoved(PlatformMouseEvent(adjustedPoint, adjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0));
     688    mainframe.eventHandler().mouseMoved(PlatformMouseEvent(adjustedPoint, adjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0, 0));
    689689    mainframe.document()->updateStyleIfNeeded();
    690690}
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

    r182674 r182748  
    11491149
    11501150    float overallForce = stage < 1 ? force : force + stage - 1;
    1151     element->dispatchMouseForceChanged(overallForce, m_page->mainFrame().eventHandler().lastMouseDownEvent());
     1151    element->dispatchMouseForceChanged(overallForce);
    11521152
    11531153    if (m_lastForceStage == 1 && stage == 2)
    1154         element->dispatchMouseForceDown(m_page->mainFrame().eventHandler().lastMouseDownEvent());
     1154        element->dispatchMouseForceDown();
    11551155    else if (m_lastForceStage == 2 && stage == 1) {
    1156         element->dispatchMouseForceUp(m_page->mainFrame().eventHandler().lastMouseDownEvent());
    1157         element->dispatchMouseForceClick(m_page->mainFrame().eventHandler().lastMouseDownEvent());
     1156        element->dispatchMouseForceUp();
     1157        element->dispatchMouseForceClick();
    11581158    }
    11591159
     
    11741174        return;
    11751175
    1176     element->dispatchMouseForceCancelled(m_page->mainFrame().eventHandler().lastMouseDownEvent());
     1176    element->dispatchMouseForceCancelled();
    11771177}
    11781178
Note: See TracChangeset for help on using the changeset viewer.