Changeset 175630 in webkit
- Timestamp:
- Nov 5, 2014 12:09:26 PM (9 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r175626 r175630 1 2014-11-05 Conrad Shultz <conrad_shultz@apple.com> 2 3 Disable interaction with action menu page previews 4 https://bugs.webkit.org/show_bug.cgi?id=138400 5 6 Reviewed by Tim Horton. 7 8 Expand on the existing -[WKView shouldIgnoreMouseEvents] by adding facilities to suppress handling 9 of all non-wheel events, effectively creating a scroll-only web view. Deploy this in 10 WKPagePreviewViewController. 11 12 * UIProcess/API/Cocoa/WKViewPrivate.h: 13 Declare the OS X-only ignoresNonWheelMouseEvents SPI. 14 15 * UIProcess/API/Cocoa/WKWebView.mm: 16 (-[WKWebView _ignoresNonWheelMouseEvents]): 17 (-[WKWebView _setIgnoresNonWheelMouseEvents:]): 18 Wrap the underlying WKView methods. 19 20 * UIProcess/API/Cocoa/WKWebViewInternal.h: 21 Declare the OS X-only ignoresNonWheelMouseEvents property. 22 23 * UIProcess/API/mac/WKView.mm: 24 Add _ignoresNonWheelMouseEvents to WKViewData. 25 (-[WKView shouldIgnoreMouseEvents]): 26 Include a check for _ignoresNonWheelMouseEvents. 27 (-[WKView _setIgnoresNonWheelMouseEvents:]): 28 Set the ivar in WKViewData. 29 (-[WKView _ignoresNonWheelMouseEvents]): 30 Fetch the ivar in WKViewData. 31 (-[WKView _shouldIgnoreWheelEvents]): 32 Implement the old -shouldIgnoreMouseEvents behavior. 33 (-[WKView scrollWheel:]): 34 -shouldIgnoreMouseEvents -> -_shouldIgnoreWheelEvents. 35 36 * UIProcess/mac/WKActionMenuController.mm: 37 (-[WKPagePreviewViewController loadView]): 38 Configure the WKWebView to ignore non-wheel mouse events; use RetainPtr for the WKWebView. 39 1 40 2014-11-03 Dean Jackson <dino@apple.com> 2 41 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h
r175444 r175630 82 82 @property (readwrite) BOOL allowsMagnification; 83 83 @property (readwrite) double magnification; 84 @property (readwrite, setter=_setIgnoresNonWheelMouseEvents:) BOOL _ignoresNonWheelMouseEvents; 84 85 @property (readwrite) BOOL allowsBackForwardNavigationGestures; 85 86 @property (nonatomic, setter=_setTopContentInset:) CGFloat _topContentInset; -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r175081 r175630 2471 2471 } 2472 2472 2473 - (BOOL)_ignoresNonWheelMouseEvents 2474 { 2475 return [_wkView _ignoresNonWheelMouseEvents]; 2476 } 2477 2478 - (void)_setIgnoresNonWheelMouseEvents:(BOOL)ignoresNonWheelMouseEvents 2479 { 2480 [_wkView _setIgnoresNonWheelMouseEvents:ignoresNonWheelMouseEvents]; 2481 } 2482 2473 2483 - (CGFloat)_topContentInset 2474 2484 { -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h
r174232 r175630 100 100 101 101 @property (nonatomic, readonly) UIEdgeInsets _computedContentInset; 102 #else 103 @property (nonatomic, setter=_setIgnoresNonWheelMouseEvents:) BOOL _ignoresNonWheelMouseEvents; 102 104 #endif 105 103 106 @end 104 107 -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r175610 r175630 243 243 std::unique_ptr<ViewGestureController> _gestureController; 244 244 BOOL _allowsMagnification; 245 BOOL _ignoresNonWheelMouseEvents; 245 246 BOOL _allowsBackForwardNavigationGestures; 246 247 … … 1096 1097 // Events 1097 1098 1098 - (BOOL)shouldIgnoreMouseEvents1099 - (BOOL)shouldIgnoreMouseEvents 1099 1100 { 1100 1101 // FIXME: This check is surprisingly specific. Are there any other cases where we need to block mouse events? … … 1104 1105 return YES; 1105 1106 #endif 1107 1108 // -scrollWheel: uses -_shouldIgnoreWheelEvents, so for all other event types it is correct to use this. 1109 return _data->_ignoresNonWheelMouseEvents; 1110 } 1111 1112 - (void)_setIgnoresNonWheelMouseEvents:(BOOL)ignoresNonWheelMouseEvents 1113 { 1114 _data->_ignoresNonWheelMouseEvents = ignoresNonWheelMouseEvents; 1115 } 1116 1117 - (BOOL)_ignoresNonWheelMouseEvents 1118 { 1119 return _data->_ignoresNonWheelMouseEvents; 1120 } 1121 1122 - (BOOL)_shouldIgnoreWheelEvents 1123 { 1124 #if WK_API_ENABLED 1125 if (_data->_thumbnailView) 1126 return YES; 1127 #endif 1128 1106 1129 return NO; 1107 1130 } … … 1186 1209 - (void)scrollWheel:(NSEvent *)event 1187 1210 { 1188 if ([self shouldIgnoreMouseEvents])1211 if ([self _shouldIgnoreWheelEvents]) 1189 1212 return; 1190 1213 -
trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm
r175609 r175630 33 33 #import "WKViewInternal.h" 34 34 #import "WKWebView.h" 35 #import "WKWebViewInternal.h" 35 36 #import "WebContext.h" 36 37 #import "WebKitSystemInterface.h" … … 99 100 - (void)loadView 100 101 { 101 WKWebView *webView = [[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, _preferredSize.width, _preferredSize.height)]; 102 RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, _preferredSize.width, _preferredSize.height)]); 103 [webView _setIgnoresNonWheelMouseEvents:YES]; 102 104 if (_url) { 103 105 NSURLRequest *request = [NSURLRequest requestWithURL:_url.get()]; 104 106 [webView loadRequest:request]; 105 107 } 106 [self setView:webView];108 self.view = webView.get(); 107 109 } 108 110
Note: See TracChangeset
for help on using the changeset viewer.