Title: [176792] branches/safari-600.3-branch/Source
Revision
176792
Author
[email protected]
Date
2014-12-04 07:54:45 -0800 (Thu, 04 Dec 2014)

Log Message

Merge r176753. rdar://problems/19052381

Modified Paths

Diff

Modified: branches/safari-600.3-branch/Source/WebCore/ChangeLog (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebCore/ChangeLog	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebCore/ChangeLog	2014-12-04 15:54:45 UTC (rev 176792)
@@ -1,5 +1,24 @@
 2014-12-03  Dana Burkart  <[email protected]>
 
+        Merge r176753. <rdar://problem/19052381>
+
+    2014-12-03  Tim Horton  <[email protected]>
+
+            Keyboard input should be disabled in the preview popover
+            https://bugs.webkit.org/show_bug.cgi?id=139219
+            <rdar://problem/19052381>
+
+            Reviewed by Anders Carlsson.
+
+            * page/ChromeClient.h:
+            (WebCore::ChromeClient::shouldDispatchFakeMouseMoveEvents):
+            * page/EventHandler.cpp:
+            (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
+            Allow ChromeClient to disable the dispatch of "fake" mouseMove events
+            that happens during scrolling.
+
+2014-12-03  Dana Burkart  <[email protected]>
+
         Merge r176694. <rdar://problem/18944696>
 
     2014-12-02  Beth Dakin  <[email protected]>

Modified: branches/safari-600.3-branch/Source/WebCore/page/ChromeClient.h (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebCore/page/ChromeClient.h	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebCore/page/ChromeClient.h	2014-12-04 15:54:45 UTC (rev 176792)
@@ -439,6 +439,8 @@
     virtual bool hasRelevantSelectionServices(bool /* isTextOnly */) const { return false; }
 #endif
 
+    virtual bool shouldDispatchFakeMouseMoveEvents() const { return true; }
+
 protected:
     virtual ~ChromeClient() { }
 };

Modified: branches/safari-600.3-branch/Source/WebCore/page/EventHandler.cpp (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebCore/page/EventHandler.cpp	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebCore/page/EventHandler.cpp	2014-12-04 15:54:45 UTC (rev 176792)
@@ -2796,6 +2796,11 @@
     if (!m_frame.settings().deviceSupportsMouse())
         return;
 
+    if (Page* page = m_frame.page()) {
+        if (!page->chrome().client().shouldDispatchFakeMouseMoveEvents())
+            return;
+    }
+
     // If the content has ever taken longer than fakeMouseMoveShortInterval we
     // reschedule the timer and use a longer time. This will cause the content
     // to receive these moves only after the user is done scrolling, reducing

Modified: branches/safari-600.3-branch/Source/WebKit2/ChangeLog (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/ChangeLog	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/ChangeLog	2014-12-04 15:54:45 UTC (rev 176792)
@@ -1,3 +1,91 @@
+2014-12-03  Dana Burkart  <[email protected]>
+
+        Merge r176753. <rdar://problem/19052381>
+
+    2014-12-03  Tim Horton  <[email protected]>
+
+            Keyboard input should be disabled in the preview popover
+            https://bugs.webkit.org/show_bug.cgi?id=139219
+            <rdar://problem/19052381>
+
+            Reviewed by Anders Carlsson.
+
+            Make sure that keyboard input, Quick Look, etc. are blocked in preview popovers
+            and WKThumbnailViews. Also block the fake mouseMove events that originate in
+            the Web process upon scrolling, because we were missing those despite blocking
+            ordinary mouseMove events.
+
+            * UIProcess/API/Cocoa/WKViewPrivate.h:
+            * UIProcess/API/mac/WKView.mm:
+            Rename _ignoresNonWheelMouseEvents to _ignoresNonWheelEvents, because it will
+            apply not only to mouse events but also key events, Quick Look events, menu
+            preparation events, swipe events, etc.
+
+            Add _ignoresAllEvents, which means the same thing as _ignoresNonWheelEvents
+            with the addition of ignoring scrollWheel events.
+
+            (-[WKView scrollWheel:]):
+            (-[WKView swipeWithEvent:]):
+            (-[WKView mouseMoved:]):
+            (-[WKView mouseDown:]):
+            (-[WKView mouseUp:]):
+            (-[WKView mouseDragged:]):
+            Adjust to the new name.
+
+            (-[WKView performKeyEquivalent:]):
+            (-[WKView keyUp:]):
+            (-[WKView keyDown:]):
+            (-[WKView flagsChanged:]):
+            (-[WKView quickLookWithEvent:]):
+            (-[WKView prepareForMenu:withEvent:]):
+            (-[WKView willOpenMenu:withEvent:]):
+            (-[WKView didCloseMenu:withEvent:]):
+            Block all of these events as well as those we were previously blocking.
+
+            (-[WKView _setIgnoresAllEvents:]):
+            (-[WKView _setIgnoresNonWheelMouseEvents:]):
+            (-[WKView _setIgnoresNonWheelEvents:]):
+            (-[WKView _ignoresNonWheelEvents]):
+            (-[WKView _ignoresAllEvents]):
+            * UIProcess/API/mac/WKViewInternal.h:
+            Adjust to the new names and the addition of ignoresAllEvents.
+
+            * UIProcess/mac/WKActionMenuController.mm:
+            (-[WKPagePreviewViewController loadView]):
+            Adjust to the new name.
+
+            (-[WKActionMenuController prepareForMenu:withEvent:]):
+            Move bailing from prepareForMenu: up to WKView.
+
+            * UIProcess/API/Cocoa/WKWebView.mm:
+            (-[WKWebView _ignoresNonWheelEvents]):
+            (-[WKWebView _setIgnoresNonWheelEvents:]):
+            (-[WKWebView _ignoresNonWheelMouseEvents]): Deleted.
+            (-[WKWebView _setIgnoresNonWheelMouseEvents:]): Deleted.
+            * UIProcess/API/Cocoa/WKWebViewInternal.h:
+            Adjust to the new name (without "mouse" in it).
+
+            * UIProcess/API/Cocoa/_WKThumbnailView.mm:
+            (-[_WKThumbnailView _viewWasUnparented]):
+            (-[_WKThumbnailView _viewWasParented]):
+            Explicitly tell WKView to disable event handling while thumbnailed,
+            instead of having WKView special-case thumbnail views internally.
+
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::setShouldDispatchFakeMouseMoveEvents):
+            * UIProcess/WebPageProxy.h:
+            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+            (WebKit::WebChromeClient::shouldDispatchFakeMouseMoveEvents):
+            * WebProcess/WebCoreSupport/WebChromeClient.h:
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::WebPage):
+            * WebProcess/WebPage/WebPage.h:
+            (WebKit::WebPage::shouldDispatchFakeMouseMoveEvents):
+            (WebKit::WebPage::setShouldDispatchFakeMouseMoveEvents):
+            * WebProcess/WebPage/WebPage.messages.in:
+            Plumb shouldDispatchFakeMouseMoveEvents from the UI process to the Web process
+            and through to WebKit2's ChromeClient implementation.
+
 2014-12-04  Dana Burkart  <[email protected]>
 
         Merge r176707. <rdar://problem/19037590>

Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h	2014-12-04 15:54:45 UTC (rev 176792)
@@ -81,7 +81,8 @@
 @property (readonly, getter=isUsingUISideCompositing) BOOL usingUISideCompositing;
 @property (readwrite) BOOL allowsMagnification;
 @property (readwrite) double magnification;
-@property (readwrite, setter=_setIgnoresNonWheelMouseEvents:) BOOL _ignoresNonWheelMouseEvents;
+@property (readwrite, setter=_setIgnoresNonWheelEvents:) BOOL _ignoresNonWheelEvents;
+@property (readwrite, setter=_setIgnoresAllEvents:) BOOL _ignoresAllEvents;
 @property (readwrite) BOOL allowsBackForwardNavigationGestures;
 @property (nonatomic, setter=_setTopContentInset:) CGFloat _topContentInset;
 

Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-12-04 15:54:45 UTC (rev 176792)
@@ -2404,14 +2404,14 @@
     [_wkView _setTopContentInset:contentInset];
 }
 
-- (BOOL)_ignoresNonWheelMouseEvents
+- (BOOL)_ignoresNonWheelEvents
 {
-    return [_wkView _ignoresNonWheelMouseEvents];
+    return [_wkView _ignoresNonWheelEvents];
 }
 
-- (void)_setIgnoresNonWheelMouseEvents:(BOOL)ignoresNonWheelMouseEvents
+- (void)_setIgnoresNonWheelEvents:(BOOL)ignoresNonWheelEvents 
 {
-    [_wkView _setIgnoresNonWheelMouseEvents:ignoresNonWheelMouseEvents];
+    [_wkView _setIgnoresNonWheelEvents:ignoresNonWheelEvents];
 }
 
 - (CGFloat)_topContentInset

Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h	2014-12-04 15:54:45 UTC (rev 176792)
@@ -97,7 +97,7 @@
 
 @property (nonatomic, readonly) UIEdgeInsets _computedContentInset;
 #else
-@property (nonatomic, setter=_setIgnoresNonWheelMouseEvents:) BOOL _ignoresNonWheelMouseEvents;
+@property (nonatomic, setter=_setIgnoresNonWheelEvents:) BOOL _ignoresNonWheelEvents;
 #endif
 
 @end

Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm	2014-12-04 15:54:45 UTC (rev 176792)
@@ -80,6 +80,7 @@
 - (void)_viewWasUnparented
 {
     [_wkView _setThumbnailView:nil];
+    [_wkView _setIgnoresAllEvents:NO];
 
     self.layer.contents = nil;
     _lastSnapshotScale = NAN;
@@ -97,6 +98,7 @@
 
     [self _requestSnapshotIfNeeded];
     [_wkView _setThumbnailView:self];
+    [_wkView _setIgnoresAllEvents:YES];
 }
 
 - (void)_requestSnapshotIfNeeded

Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-12-04 15:54:45 UTC (rev 176792)
@@ -247,7 +247,8 @@
 
     std::unique_ptr<ViewGestureController> _gestureController;
     BOOL _allowsMagnification;
-    BOOL _ignoresNonWheelMouseEvents;
+    BOOL _ignoresNonWheelEvents;
+    BOOL _ignoresAllEvents;
     BOOL _allowsBackForwardNavigationGestures;
 
     RetainPtr<CALayer> _rootLayer;
@@ -1104,29 +1105,6 @@
 
 // Events
 
-- (BOOL)_shouldIgnoreMouseEvents
-{
-    // FIXME: This check is surprisingly specific. Are there any other cases where we need to block mouse events?
-    // Do we actually need to in thumbnail view? And if we do, what about non-mouse events?
-#if WK_API_ENABLED
-    if (_data->_thumbnailView)
-        return YES;
-#endif
-
-    // -scrollWheel: uses -_shouldIgnoreWheelEvents, so for all other event types it is correct to use this.
-    return _data->_ignoresNonWheelMouseEvents;
-}
-
-- (BOOL)_shouldIgnoreWheelEvents
-{
-#if WK_API_ENABLED
-    if (_data->_thumbnailView)
-        return YES;
-#endif
-
-    return NO;
-}
-
 // Override this so that AppKit will send us arrow keys as key down events so we can
 // support them via the key bindings mechanism.
 - (BOOL)_wantsKeyDownForEvent:(NSEvent *)event
@@ -1149,7 +1127,7 @@
 #define NATIVE_MOUSE_EVENT_HANDLER(Selector) \
     - (void)Selector:(NSEvent *)theEvent \
     { \
-        if (self._shouldIgnoreMouseEvents) \
+        if (_data->_ignoresNonWheelEvents) \
             return; \
         if (NSTextInputContext *context = [self inputContext]) { \
             [context handleEvent:theEvent completionHandler:^(BOOL handled) { \
@@ -1169,7 +1147,7 @@
 #define NATIVE_MOUSE_EVENT_HANDLER(Selector) \
     - (void)Selector:(NSEvent *)theEvent \
     { \
-        if (self._shouldIgnoreMouseEvents) \
+        if (_data->_ignoresNonWheelEvents) \
             return; \
         if ([[self inputContext] handleEvent:theEvent]) { \
             LOG(TextInput, "%s was handled by text input context", String(#Selector).substring(0, String(#Selector).find("Internal")).ascii().data()); \
@@ -1206,7 +1184,7 @@
 
 - (void)scrollWheel:(NSEvent *)event
 {
-    if ([self _shouldIgnoreWheelEvents])
+    if (_data->_ignoresAllEvents)
         return;
 
     // Work around <rdar://problem/19086993> by always clearing the active text indicator on scroll.
@@ -1224,7 +1202,7 @@
 
 - (void)swipeWithEvent:(NSEvent *)event
 {
-    if (self._shouldIgnoreMouseEvents)
+    if (_data->_ignoresNonWheelEvents)
         return;
 
     if (!_data->_allowsBackForwardNavigationGestures) {
@@ -1242,7 +1220,7 @@
 
 - (void)mouseMoved:(NSEvent *)event
 {
-    if (self._shouldIgnoreMouseEvents)
+    if (_data->_ignoresNonWheelEvents)
         return;
 
     // When a view is first responder, it gets mouse moved events even when the mouse is outside its visible rect.
@@ -1254,7 +1232,7 @@
 
 - (void)mouseDown:(NSEvent *)event
 {
-    if (self._shouldIgnoreMouseEvents)
+    if (_data->_ignoresNonWheelEvents)
         return;
 
     [self _setMouseDownEvent:event];
@@ -1270,7 +1248,7 @@
 
 - (void)mouseUp:(NSEvent *)event
 {
-    if (self._shouldIgnoreMouseEvents)
+    if (_data->_ignoresNonWheelEvents)
         return;
 
     [self _setMouseDownEvent:nil];
@@ -1279,7 +1257,7 @@
 
 - (void)mouseDragged:(NSEvent *)event
 {
-    if (self._shouldIgnoreMouseEvents)
+    if (_data->_ignoresNonWheelEvents)
         return;
 
     if (_data->_ignoringMouseDraggedEvents)
@@ -2182,6 +2160,9 @@
 
 - (BOOL)performKeyEquivalent:(NSEvent *)event
 {
+    if (_data->_ignoresNonWheelEvents)
+        return NO;
+
     // There's a chance that responding to this event will run a nested event loop, and
     // fetching a new event might release the old one. Retaining and then autoreleasing
     // the current event prevents that from causing a problem inside WebKit or AppKit code.
@@ -2219,6 +2200,9 @@
 
 - (void)keyUp:(NSEvent *)theEvent
 {
+    if (_data->_ignoresNonWheelEvents)
+        return;
+
     LOG(TextInput, "keyUp:%p %@", theEvent, theEvent);
     // We don't interpret the keyUp event, as this breaks key bindings (see <https://bugs.webkit.org/show_bug.cgi?id=130100>).
     _data->_page->handleKeyboardEvent(NativeWebKeyboardEvent(theEvent, false, Vector<KeypressCommand>()));
@@ -2226,6 +2210,9 @@
 
 - (void)keyDown:(NSEvent *)theEvent
 {
+    if (_data->_ignoresNonWheelEvents)
+        return;
+
     LOG(TextInput, "keyDown:%p %@%s", theEvent, theEvent, (theEvent == _data->_keyDownEventBeingResent) ? " (re-sent)" : "");
 
     // There's a chance that responding to this event will run a nested event loop, and
@@ -2261,6 +2248,9 @@
 
 - (void)flagsChanged:(NSEvent *)theEvent
 {
+    if (_data->_ignoresNonWheelEvents)
+        return;
+
     LOG(TextInput, "flagsChanged:%p %@", theEvent, theEvent);
 
     // There's a chance that responding to this event will run a nested event loop, and
@@ -2833,6 +2823,9 @@
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
 - (void)quickLookWithEvent:(NSEvent *)event
 {
+    if (_data->_ignoresNonWheelEvents)
+        return;
+
     NSPoint locationInViewCoordinates = [self convertPoint:[event locationInWindow] fromView:nil];
     _data->_page->performDictionaryLookupAtLocation(FloatPoint(locationInViewCoordinates.x, locationInViewCoordinates.y));
 }
@@ -3698,16 +3691,31 @@
 
 - (void)prepareForMenu:(NSMenu *)menu withEvent:(NSEvent *)event
 {
+    if (_data->_ignoresNonWheelEvents) {
+        [menu cancelTracking];
+        return;
+    }
+
     [_data->_actionMenuController prepareForMenu:menu withEvent:event];
 }
 
 - (void)willOpenMenu:(NSMenu *)menu withEvent:(NSEvent *)event
 {
+    if (_data->_ignoresNonWheelEvents) {
+        [menu cancelTracking];
+        return;
+    }
+
     [_data->_actionMenuController willOpenMenu:menu withEvent:event];
 }
 
 - (void)didCloseMenu:(NSMenu *)menu withEvent:(NSEvent *)event
 {
+    if (_data->_ignoresNonWheelEvents) {
+        [menu cancelTracking];
+        return;
+    }
+
     [_data->_actionMenuController didCloseMenu:menu withEvent:event];
 }
 
@@ -4005,16 +4013,37 @@
     return _data->_allowsBackForwardNavigationGestures;
 }
 
+- (void)_setIgnoresAllEvents:(BOOL)ignoresAllEvents
+{
+    _data->_ignoresAllEvents = ignoresAllEvents;
+    [self _setIgnoresNonWheelEvents:ignoresAllEvents];
+}
+
+// Forward _setIgnoresNonWheelMouseEvents to _setIgnoresNonWheelEvents to avoid breaking existing clients.
 - (void)_setIgnoresNonWheelMouseEvents:(BOOL)ignoresNonWheelMouseEvents
 {
-    _data->_ignoresNonWheelMouseEvents = ignoresNonWheelMouseEvents;
+    [self _setIgnoresNonWheelEvents:ignoresNonWheelMouseEvents];
 }
 
-- (BOOL)_ignoresNonWheelMouseEvents
+- (void)_setIgnoresNonWheelEvents:(BOOL)ignoresNonWheelEvents
 {
-    return _data->_ignoresNonWheelMouseEvents;
+    if (_data->_ignoresNonWheelEvents == ignoresNonWheelEvents)
+        return;
+
+    _data->_ignoresNonWheelEvents = ignoresNonWheelEvents;
+    _data->_page->setShouldDispatchFakeMouseMoveEvents(!ignoresNonWheelEvents);
 }
 
+- (BOOL)_ignoresNonWheelEvents
+{
+    return _data->_ignoresNonWheelEvents;
+}
+
+- (BOOL)_ignoresAllEvents
+{
+    return _data->_ignoresAllEvents;
+}
+
 - (void)_dispatchSetTopContentInset
 {
     if (!_data->_didScheduleSetTopContentInset)

Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h	2014-12-04 15:54:45 UTC (rev 176792)
@@ -110,8 +110,6 @@
 - (void)_setSuppressVisibilityUpdates:(BOOL)suppressVisibilityUpdates;
 - (BOOL)_suppressVisibilityUpdates;
 
-- (BOOL)_shouldIgnoreMouseEvents;
-
 - (void)_didFirstVisuallyNonEmptyLayoutForMainFrame;
 - (void)_didFinishLoadForMainFrame;
 - (void)_didSameDocumentNavigationForMainFrame:(WebKit::SameDocumentNavigationType)type;

Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-12-04 15:54:45 UTC (rev 176792)
@@ -5227,4 +5227,9 @@
     m_pageClient.didPerformActionMenuHitTest(result, userData.get());
 }
 
+void WebPageProxy::setShouldDispatchFakeMouseMoveEvents(bool shouldDispatchFakeMouseMoveEvents)
+{
+    m_process->send(Messages::WebPage::SetShouldDispatchFakeMouseMoveEvents(shouldDispatchFakeMouseMoveEvents), m_pageID);
+}
+
 } // namespace WebKit

Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.h (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2014-12-04 15:54:45 UTC (rev 176792)
@@ -927,6 +927,8 @@
 #endif
     void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses);
 
+    void setShouldDispatchFakeMouseMoveEvents(bool);
+
 private:
     WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, const WebPageConfiguration&);
     void platformInitialize();

Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm	2014-12-04 15:54:45 UTC (rev 176792)
@@ -147,7 +147,7 @@
     _previewView = [_delegate pagePreviewViewController:self viewForPreviewingURL:_url.get() initialFrameSize:defaultFrame.size];
     if (!_previewView) {
         RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:defaultFrame]);
-        [webView _setIgnoresNonWheelMouseEvents:YES];
+        [webView _setIgnoresNonWheelEvents:YES];
         if (_url) {
             NSURLRequest *request = [NSURLRequest requestWithURL:_url.get()];
             [webView loadRequest:request];
@@ -253,11 +253,6 @@
     if (menu != _wkView.actionMenu)
         return;
 
-    if (_wkView._shouldIgnoreMouseEvents) {
-        [menu cancelTracking];
-        return;
-    }
-
     [self dismissActionMenuPopovers];
 
     _eventLocationInView = [_wkView convertPoint:event.locationInWindow fromView:nil];

Modified: branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2014-12-04 15:54:45 UTC (rev 176792)
@@ -1046,7 +1046,11 @@
 {
     return (isTextOnly && WebProcess::shared().hasSelectionServices()) || WebProcess::shared().hasRichContentServices();
 }
-
 #endif
 
+bool WebChromeClient::shouldDispatchFakeMouseMoveEvents() const
+{
+    return m_page->shouldDispatchFakeMouseMoveEvents();
+}
+
 } // namespace WebKit

Modified: branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h	2014-12-04 15:54:45 UTC (rev 176792)
@@ -305,6 +305,8 @@
     virtual bool hasRelevantSelectionServices(bool isTextOnly) const override;
 #endif
 
+    virtual bool shouldDispatchFakeMouseMoveEvents() const override;
+
     String m_cachedToolTip;
     mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
     mutable bool m_cachedMainFrameHasHorizontalScrollbar;

Modified: branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-12-04 15:54:45 UTC (rev 176792)
@@ -322,6 +322,7 @@
 #if ENABLE(WEBGL)
     , m_systemWebGLPolicy(WebGLAllowCreation)
 #endif
+    , m_shouldDispatchFakeMouseMoveEvents(true)
 {
     ASSERT(m_pageID);
     // FIXME: This is a non-ideal location for this Setting and

Modified: branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h	2014-12-04 15:54:45 UTC (rev 176792)
@@ -834,6 +834,7 @@
     void didChangeScrollOffsetForFrame(WebCore::Frame*);
 
     void willChangeCurrentHistoryItemForMainFrame();
+    bool shouldDispatchFakeMouseMoveEvents() const { return m_shouldDispatchFakeMouseMoveEvents; }
 
 private:
     WebPage(uint64_t pageID, const WebPageCreationParameters&);
@@ -1052,6 +1053,8 @@
     void dataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID);
 #endif
 
+    void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
+
     uint64_t m_pageID;
 
     std::unique_ptr<WebCore::Page> m_page;
@@ -1279,6 +1282,8 @@
     WebCore::HitTestResult m_lastActionMenuHitTestResult;
     RefPtr<WebPageOverlay> m_lastActionMenuHitPageOverlay;
 #endif
+
+    bool m_shouldDispatchFakeMouseMoveEvents;
 };
 
 } // namespace WebKit

Modified: branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (176791 => 176792)


--- branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2014-12-04 15:42:25 UTC (rev 176791)
+++ branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2014-12-04 15:54:45 UTC (rev 176792)
@@ -395,4 +395,6 @@
     DataDetectorsDidChangeUI(WebCore::PageOverlay::PageOverlayID pageOverlay)
     DataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID pageOverlay)
 #endif
+
+    SetShouldDispatchFakeMouseMoveEvents(bool shouldDispatchFakeMouseMoveEvents)
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to