Changeset 215790 in webkit


Ignore:
Timestamp:
Apr 25, 2017, 9:27:53 PM (8 years ago)
Author:
achristensen@apple.com
Message:

REGRESSION(206450): WebKit2PlatformMouseEvent m_modifierFlags not set
https://bugs.webkit.org/show_bug.cgi?id=171297
<rdar://problem/31530719>

Reviewed by Geoffrey Garen.

Source/WebKit2:

  • Shared/WebEventConversion.cpp:

(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):

Tools:

  • TestWebKitAPI/PlatformWebView.h:
  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKit2/EventModifiers.cpp: Added.

(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::mouseDidMoveOverElement):
(TestWebKitAPI::setClients):
(TestWebKitAPI::TEST):

  • TestWebKitAPI/mac/PlatformWebViewMac.mm:

(TestWebKitAPI::PlatformWebView::simulateRightClick):
(TestWebKitAPI::PlatformWebView::simulateMouseMove):

Location:
trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r215786 r215790  
     12017-04-25  Alex Christensen  <achristensen@webkit.org>
     2
     3        REGRESSION(206450): WebKit2PlatformMouseEvent m_modifierFlags not set
     4        https://bugs.webkit.org/show_bug.cgi?id=171297
     5        <rdar://problem/31530719>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        * Shared/WebEventConversion.cpp:
     10        (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
     11
    1122017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
    213
  • trunk/Source/WebKit2/Shared/WebEventConversion.cpp

    r207689 r215790  
    110110        m_menuTypeForEvent = webEvent.menuTypeForEvent();
    111111#endif
     112        m_modifierFlags = 0;
     113        if (webEvent.shiftKey())
     114            m_modifierFlags |= WebEvent::ShiftKey;
     115        if (webEvent.controlKey())
     116            m_modifierFlags |= WebEvent::ControlKey;
     117        if (webEvent.altKey())
     118            m_modifierFlags |= WebEvent::AltKey;
     119        if (webEvent.metaKey())
     120            m_modifierFlags |= WebEvent::MetaKey;
    112121    }
    113122};
  • trunk/Tools/ChangeLog

    r215785 r215790  
     12017-04-25  Alex Christensen  <achristensen@webkit.org>
     2
     3        REGRESSION(206450): WebKit2PlatformMouseEvent m_modifierFlags not set
     4        https://bugs.webkit.org/show_bug.cgi?id=171297
     5        <rdar://problem/31530719>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        * TestWebKitAPI/PlatformWebView.h:
     10        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     11        * TestWebKitAPI/Tests/WebKit2/EventModifiers.cpp: Added.
     12        (TestWebKitAPI::didFinishLoadForFrame):
     13        (TestWebKitAPI::mouseDidMoveOverElement):
     14        (TestWebKitAPI::setClients):
     15        (TestWebKitAPI::TEST):
     16        * TestWebKitAPI/mac/PlatformWebViewMac.mm:
     17        (TestWebKitAPI::PlatformWebView::simulateRightClick):
     18        (TestWebKitAPI::PlatformWebView::simulateMouseMove):
     19
    1202017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
    221
  • trunk/Tools/TestWebKitAPI/PlatformWebView.h

    r215758 r215790  
    7070    void simulateAltKeyPress();
    7171    void simulateRightClick(unsigned x, unsigned y);
    72     void simulateMouseMove(unsigned x, unsigned y);
     72    void simulateMouseMove(unsigned x, unsigned y, WKEventModifiers = 0);
    7373#if PLATFORM(MAC)
    7474    void simulateButtonClick(WKEventMouseButton, unsigned x, unsigned y, WKEventModifiers);
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r215784 r215790  
    197197                5C6E65441D5CEFD400F7862E /* URLParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C6E65411D5CEF8500F7862E /* URLParser.cpp */; };
    198198                5C726D6F1D3EE06E00C5E1A1 /* InstanceMethodSwizzler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C726D6E1D3EE06800C5E1A1 /* InstanceMethodSwizzler.mm */; };
     199                5C7964101EB0278D0075D74C /* EventModifiers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C79640F1EB0269B0075D74C /* EventModifiers.cpp */; };
    199200                5C838F7F1DB04F900082858F /* LoadInvalidURLRequest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 57901FAE1CAF137100ED64F9 /* LoadInvalidURLRequest.mm */; };
    200201                5C9E56851DF9145400C9EE33 /* WebsitePolicies.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C9E56841DF9143D00C9EE33 /* WebsitePolicies.mm */; };
     
    11461147                5C726D6D1D3EE06800C5E1A1 /* InstanceMethodSwizzler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstanceMethodSwizzler.h; path = cocoa/InstanceMethodSwizzler.h; sourceTree = "<group>"; };
    11471148                5C726D6E1D3EE06800C5E1A1 /* InstanceMethodSwizzler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = InstanceMethodSwizzler.mm; path = cocoa/InstanceMethodSwizzler.mm; sourceTree = "<group>"; };
     1149                5C79640F1EB0269B0075D74C /* EventModifiers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventModifiers.cpp; sourceTree = "<group>"; };
    11481150                5C9E56841DF9143D00C9EE33 /* WebsitePolicies.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebsitePolicies.mm; sourceTree = "<group>"; };
    11491151                5C9E56861DF9148E00C9EE33 /* contentBlockerCheck.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = contentBlockerCheck.html; sourceTree = "<group>"; };
     
    20442046                                75F3133F18C171B70041CAEC /* EphemeralSessionPushStateNoHistoryCallback.cpp */,
    20452047                                1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */,
     2048                                5C79640F1EB0269B0075D74C /* EventModifiers.cpp */,
    20462049                                BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */,
    20472050                                1A02C84E125D4A8400E3F4BD /* Find.cpp */,
     
    30493052                                7CCE7F221A411AE600447C4C /* WKString.cpp in Sources */,
    30503053                                7CCE7F1E1A411AE600447C4C /* WKStringJSString.cpp in Sources */,
     3054                                5C7964101EB0278D0075D74C /* EventModifiers.cpp in Sources */,
    30513055                                2D4CF8BD1D8360CC0001CE8D /* WKThumbnailView.mm in Sources */,
    30523056                                5CE354D91E70DA5C00BEFE3B /* WKUserContentExtensionStore.mm in Sources */,
  • trunk/Tools/TestWebKitAPI/gtk/PlatformWebViewGtk.cpp

    r191783 r215790  
    149149}
    150150
    151 void PlatformWebView::simulateMouseMove(unsigned x, unsigned y)
     151void PlatformWebView::simulateMouseMove(unsigned x, unsigned y, WKEventModifiers)
    152152{
    153153    GUniquePtr<GdkEvent> event(gdk_event_new(GDK_MOTION_NOTIFY));
  • trunk/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm

    r208455 r215790  
    178178
    179179}
    180    
    181 void PlatformWebView::simulateMouseMove(unsigned x, unsigned y)
    182 {   
    183     NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeMouseMoved
    184                                location:NSMakePoint(x, y)
    185                           modifierFlags:0
    186                               timestamp:GetCurrentEventTime()
    187                            windowNumber:[m_window windowNumber]
    188                                 context:[NSGraphicsContext currentContext]
    189                             eventNumber:0
    190                              clickCount:0
    191                                pressure:0];
    192    
    193     [m_view mouseMoved:event];
    194    
    195 }
    196180
    197181static NSEventType eventTypeForButton(WKEventMouseButton button)
     
    227211    return returnVal;
    228212}
    229    
     213
     214void PlatformWebView::simulateMouseMove(unsigned x, unsigned y, WKEventModifiers modifiers)
     215{
     216    NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeMouseMoved location:NSMakePoint(x, y) modifierFlags:modifierFlagsForWKModifiers(modifiers) timestamp:GetCurrentEventTime() windowNumber:[m_window windowNumber] context:[NSGraphicsContext currentContext] eventNumber:0 clickCount:0 pressure:0];
     217    [m_view mouseMoved:event];
     218}
     219
    230220void PlatformWebView::simulateButtonClick(WKEventMouseButton button, unsigned x, unsigned y, WKEventModifiers modifiers)
    231221{
Note: See TracChangeset for help on using the changeset viewer.