Title: [204972] trunk/Source/WebCore
Revision
204972
Author
[email protected]
Date
2016-08-25 10:37:09 -0700 (Thu, 25 Aug 2016)

Log Message

Simplify createMouseEvent in DragController
https://bugs.webkit.org/show_bug.cgi?id=161168

Reviewed by Dan Bernstein.

* page/DragController.cpp:
(WebCore::createMouseEvent):
* platform/DragData.cpp:
(WebCore::DragData::modifierKeyState): Deleted.
* platform/DragData.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (204971 => 204972)


--- trunk/Source/WebCore/ChangeLog	2016-08-25 17:19:16 UTC (rev 204971)
+++ trunk/Source/WebCore/ChangeLog	2016-08-25 17:37:09 UTC (rev 204972)
@@ -1,3 +1,16 @@
+2016-08-24  Anders Carlsson  <[email protected]>
+
+        Simplify createMouseEvent in DragController
+        https://bugs.webkit.org/show_bug.cgi?id=161168
+
+        Reviewed by Dan Bernstein.
+
+        * page/DragController.cpp:
+        (WebCore::createMouseEvent):
+        * platform/DragData.cpp:
+        (WebCore::DragData::modifierKeyState): Deleted.
+        * platform/DragData.h:
+
 2016-08-25  Chris Dumez  <[email protected]>
 
         DOMTokenList.value should be a stringifier attribute

Modified: trunk/Source/WebCore/page/DragController.cpp (204971 => 204972)


--- trunk/Source/WebCore/page/DragController.cpp	2016-08-25 17:19:16 UTC (rev 204971)
+++ trunk/Source/WebCore/page/DragController.cpp	2016-08-25 17:37:09 UTC (rev 204972)
@@ -97,12 +97,13 @@
     
 static PlatformMouseEvent createMouseEvent(DragData& dragData)
 {
-    int keyState = dragData.modifierKeyState();
-    bool shiftKey = static_cast<bool>(keyState & PlatformEvent::ShiftKey);
-    bool ctrlKey = static_cast<bool>(keyState & PlatformEvent::CtrlKey);
-    bool altKey = static_cast<bool>(keyState & PlatformEvent::AltKey);
-    bool metaKey = static_cast<bool>(keyState & PlatformEvent::MetaKey);
+    bool shiftKey = false;
+    bool ctrlKey = false;
+    bool altKey = false;
+    bool metaKey = false;
 
+    PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey);
+
     return PlatformMouseEvent(dragData.clientPosition(), dragData.globalPosition(),
                               LeftButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey,
                               metaKey, currentTime(), ForceAtClick, NoTap);

Modified: trunk/Source/WebCore/platform/DragData.cpp (204971 => 204972)


--- trunk/Source/WebCore/platform/DragData.cpp	2016-08-25 17:19:16 UTC (rev 204971)
+++ trunk/Source/WebCore/platform/DragData.cpp	2016-08-25 17:37:09 UTC (rev 204972)
@@ -53,24 +53,6 @@
 }
 #endif
 
-int DragData::modifierKeyState() const
-{
-    bool shiftKey, ctrlKey, altKey, metaKey;
-    shiftKey = ctrlKey = altKey = metaKey = false;
-    PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey);
-    int keyState = 0;
-    if (shiftKey)
-        keyState = keyState | PlatformEvent::ShiftKey;
-    if (ctrlKey)
-        keyState = keyState | PlatformEvent::CtrlKey;
-    if (altKey)
-        keyState = keyState | PlatformEvent::AltKey;
-    if (metaKey)
-        keyState = keyState | PlatformEvent::MetaKey;
-    return keyState;
-}
-
 } // namespace WebCore
 
-
 #endif // ENABLE(DRAG_SUPPORT)

Modified: trunk/Source/WebCore/platform/DragData.h (204971 => 204972)


--- trunk/Source/WebCore/platform/DragData.h	2016-08-25 17:19:16 UTC (rev 204971)
+++ trunk/Source/WebCore/platform/DragData.h	2016-08-25 17:37:09 UTC (rev 204972)
@@ -102,7 +102,6 @@
     bool containsColor() const;
     bool containsFiles() const;
     unsigned numberOfFiles() const;
-    int modifierKeyState() const;
 #if PLATFORM(MAC)
     const String& pasteboardName() const { return m_pasteboardName; }
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to