[iOS] Add a quirk to synthesize mouse events when modifying the selection
[WebKit-https.git] / Source / WebCore / ChangeLog
index 14147c5..e7cc55d 100644 (file)
@@ -1,3 +1,48 @@
+2019-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [iOS] Add a quirk to synthesize mouse events when modifying the selection
+        https://bugs.webkit.org/show_bug.cgi?id=197683
+        <rdar://problem/48003980>
+
+        Reviewed by Tim Horton.
+
+        See WebKit ChangeLog for more details.
+
+        Test: editing/selection/ios/dispatch-mouse-events-when-modifying-selection-quirk.html
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMousePressEvent):
+        (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const):
+
+        Add some platform hooks to prevent mousemove events from updating the selection on iOS.
+
+        (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const):
+
+        Add some platform hooks to prevent drag and drop from kicking in when sending synthetic mousemove events to the
+        page on iOS (drag and drop is instead triggered by EventHandler::tryToBeginDragAtPoint).
+
+        (WebCore::EventHandler::updateSelectionForMouseDrag):
+        * page/EventHandler.h:
+        * page/Quirks.cpp:
+        (WebCore::Quirks::shouldDispatchSyntheticMouseEventsWhenModifyingSelection const):
+        * page/Quirks.h:
+
+        Add the new site-specific quirk.
+
+        * page/Settings.yaml:
+        * page/ios/EventHandlerIOS.mm:
+        (WebCore::EventHandler::tryToBeginDragAtPoint):
+        (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const):
+        (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const):
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::Backup::Backup):
+        (WebCore::InternalSettings::Backup::restoreTo):
+        (WebCore::InternalSettings::setShouldDispatchSyntheticMouseEventsWhenModifyingSelection):
+        * testing/InternalSettings.h:
+        * testing/InternalSettings.idl:
+
+        Add an internal settings hook to opt into this quirk, for use in layout tests.
+
 2019-05-08  Simon Fraser  <simon.fraser@apple.com>
 
         Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer