Disable interaction with action menu page previews
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Nov 2014 20:09:26 +0000 (20:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Nov 2014 20:09:26 +0000 (20:09 +0000)
commita9a9862d35de5e796ff18c42fa482b0ee9adcd89
tree3128ec20f1668a04147a80be3b292279fc61181d
parent3aca0d6b61b61eeddead521e96bdb074fd60305e
Disable interaction with action menu page previews
https://bugs.webkit.org/show_bug.cgi?id=138400

Patch by Conrad Shultz <conrad_shultz@apple.com> on 2014-11-05
Reviewed by Tim Horton.

Expand on the existing -[WKView shouldIgnoreMouseEvents] by adding facilities to suppress handling
of all non-wheel events, effectively creating a scroll-only web view. Deploy this in
WKPagePreviewViewController.

* UIProcess/API/Cocoa/WKViewPrivate.h:
Declare the OS X-only ignoresNonWheelMouseEvents SPI.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _ignoresNonWheelMouseEvents]):
(-[WKWebView _setIgnoresNonWheelMouseEvents:]):
Wrap the underlying WKView methods.

* UIProcess/API/Cocoa/WKWebViewInternal.h:
Declare the OS X-only ignoresNonWheelMouseEvents property.

* UIProcess/API/mac/WKView.mm:
Add _ignoresNonWheelMouseEvents to WKViewData.
(-[WKView shouldIgnoreMouseEvents]):
Include a check for _ignoresNonWheelMouseEvents.
(-[WKView _setIgnoresNonWheelMouseEvents:]):
Set the ivar in WKViewData.
(-[WKView _ignoresNonWheelMouseEvents]):
Fetch the ivar in WKViewData.
(-[WKView _shouldIgnoreWheelEvents]):
Implement the old -shouldIgnoreMouseEvents behavior.
(-[WKView scrollWheel:]):
-shouldIgnoreMouseEvents -> -_shouldIgnoreWheelEvents.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKPagePreviewViewController loadView]):
Configure the WKWebView to ignore non-wheel mouse events; use RetainPtr for the WKWebView.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/mac/WKActionMenuController.mm