- Revision
- 181668
- Author
- [email protected]
- Date
- 2015-03-17 15:48:07 -0700 (Tue, 17 Mar 2015)
Log Message
Cannot invoke action menus anymore
https://bugs.webkit.org/show_bug.cgi?id=142797
<rdar://problem/20032670>
Reviewed by Beth Dakin.
* UIProcess/API/mac/WKView.mm:
Don't process mouse events that would make an action menu; call super
and let AppKit take care of it. We have to duplicate the macro so that
we can avoid calling super for the internal-only methods.
Also, otherMouseMoved is simply not a thing, so remove it.
* WebView/WebHTMLView.mm:
(-[WebHTMLView otherMouseDown:]):
Don't override otherMouseDown: if the event would make an action menu.
* platform/spi/mac/NSMenuSPI.h:
Add additional NSMenu SPI.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (181667 => 181668)
--- trunk/Source/WebCore/ChangeLog 2015-03-17 22:20:30 UTC (rev 181667)
+++ trunk/Source/WebCore/ChangeLog 2015-03-17 22:48:07 UTC (rev 181668)
@@ -1,3 +1,14 @@
+2015-03-17 Tim Horton <[email protected]>
+
+ Cannot invoke action menus anymore
+ https://bugs.webkit.org/show_bug.cgi?id=142797
+ <rdar://problem/20032670>
+
+ Reviewed by Beth Dakin.
+
+ * platform/spi/mac/NSMenuSPI.h:
+ Add additional NSMenu SPI.
+
2015-03-17 Zalan Bujtas <[email protected]>
Simple line layout: Split fragments on renderer boundary on the fly.
Modified: trunk/Source/WebCore/platform/spi/mac/NSMenuSPI.h (181667 => 181668)
--- trunk/Source/WebCore/platform/spi/mac/NSMenuSPI.h 2015-03-17 22:20:30 UTC (rev 181667)
+++ trunk/Source/WebCore/platform/spi/mac/NSMenuSPI.h 2015-03-17 22:48:07 UTC (rev 181668)
@@ -27,6 +27,16 @@
// FIXME: We should just include the appropriate internal headers.
+typedef NS_ENUM(NSInteger, NSMenuType) {
+ NSMenuTypeNone = 0,
+ NSMenuTypeContextMenu,
+ NSMenuTypeActionMenu,
+};
+
+@interface NSMenu (Private)
++ (NSMenuType)menuTypeForEvent:(NSEvent *)event;
+@end
+
@interface NSMenuItem (Private)
+ (QLPreviewMenuItem *)standardQuickLookMenuItem;
@end
Modified: trunk/Source/WebKit/mac/ChangeLog (181667 => 181668)
--- trunk/Source/WebKit/mac/ChangeLog 2015-03-17 22:20:30 UTC (rev 181667)
+++ trunk/Source/WebKit/mac/ChangeLog 2015-03-17 22:48:07 UTC (rev 181668)
@@ -1,3 +1,15 @@
+2015-03-17 Tim Horton <[email protected]>
+
+ Cannot invoke action menus anymore
+ https://bugs.webkit.org/show_bug.cgi?id=142797
+ <rdar://problem/20032670>
+
+ Reviewed by Beth Dakin.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView otherMouseDown:]):
+ Don't override otherMouseDown: if the event would make an action menu.
+
2015-03-16 Ryosuke Niwa <[email protected]>
Enable ES6 classes by default
Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (181667 => 181668)
--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm 2015-03-17 22:20:30 UTC (rev 181667)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm 2015-03-17 22:48:07 UTC (rev 181668)
@@ -106,6 +106,7 @@
#import <WebCore/LegacyWebArchive.h>
#import <WebCore/MIMETypeRegistry.h>
#import <WebCore/MainFrame.h>
+#import <WebCore/NSMenuSPI.h>
#import <WebCore/NSURLFileTypeMappingsSPI.h>
#import <WebCore/Page.h>
#import <WebCore/Range.h>
@@ -5387,10 +5388,12 @@
#if !PLATFORM(IOS)
- (void)otherMouseDown:(NSEvent *)event
{
- if ([event buttonNumber] == 2)
- [self mouseDown:event];
- else
+ if ([event buttonNumber] != 2 || [NSMenu menuTypeForEvent:event] == NSMenuTypeActionMenu) {
[super otherMouseDown:event];
+ return;
+ }
+
+ [self mouseDown:event];
}
- (void)otherMouseDragged:(NSEvent *)event
Modified: trunk/Source/WebKit2/ChangeLog (181667 => 181668)
--- trunk/Source/WebKit2/ChangeLog 2015-03-17 22:20:30 UTC (rev 181667)
+++ trunk/Source/WebKit2/ChangeLog 2015-03-17 22:48:07 UTC (rev 181668)
@@ -1,3 +1,17 @@
+2015-03-17 Tim Horton <[email protected]>
+
+ Cannot invoke action menus anymore
+ https://bugs.webkit.org/show_bug.cgi?id=142797
+ <rdar://problem/20032670>
+
+ Reviewed by Beth Dakin.
+
+ * UIProcess/API/mac/WKView.mm:
+ Don't process mouse events that would make an action menu; call super
+ and let AppKit take care of it. We have to duplicate the macro so that
+ we can avoid calling super for the internal-only methods.
+ Also, otherMouseMoved is simply not a thing, so remove it.
+
2015-03-17 Beth Dakin <[email protected]>
DOM mouse events have weird timing for force clickable elements in Safari 8.0.3 on
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (181667 => 181668)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2015-03-17 22:20:30 UTC (rev 181667)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2015-03-17 22:48:07 UTC (rev 181668)
@@ -91,6 +91,7 @@
#import <WebCore/LocalizedStrings.h>
#import <WebCore/LookupSPI.h>
#import <WebCore/NSImmediateActionGestureRecognizerSPI.h>
+#import <WebCore/NSMenuSPI.h>
#import <WebCore/NSViewSPI.h>
#import <WebCore/PlatformEventFactoryMac.h>
#import <WebCore/PlatformScreen.h>
@@ -1176,9 +1177,32 @@
}]; \
return; \
} \
+ if ([NSMenu menuTypeForEvent:theEvent] == NSMenuTypeActionMenu) { \
+ [super Selector:theEvent]; \
+ return; \
+ } \
NativeWebMouseEvent webEvent(theEvent, self); \
_data->_page->handleMouseEvent(webEvent); \
}
+#define NATIVE_MOUSE_EVENT_HANDLER_INTERNAL(Selector) \
+ - (void)Selector:(NSEvent *)theEvent \
+ { \
+ if (_data->_ignoresNonWheelEvents) \
+ return; \
+ if (NSTextInputContext *context = [self inputContext]) { \
+ [context handleEvent:theEvent completionHandler:^(BOOL handled) { \
+ if (handled) \
+ LOG(TextInput, "%s was handled by text input context", String(#Selector).substring(0, String(#Selector).find("Internal")).ascii().data()); \
+ else { \
+ NativeWebMouseEvent webEvent(theEvent, self); \
+ _data->_page->handleMouseEvent(webEvent); \
+ } \
+ }]; \
+ return; \
+ } \
+ NativeWebMouseEvent webEvent(theEvent, self); \
+ _data->_page->handleMouseEvent(webEvent); \
+ }
#else
#define NATIVE_MOUSE_EVENT_HANDLER(Selector) \
- (void)Selector:(NSEvent *)theEvent \
@@ -1189,25 +1213,41 @@
LOG(TextInput, "%s was handled by text input context", String(#Selector).substring(0, String(#Selector).find("Internal")).ascii().data()); \
return; \
} \
+ if ([NSMenu menuTypeForEvent:theEvent] == NSMenuTypeActionMenu) { \
+ [super Selector:theEvent]; \
+ return; \
+ } \
NativeWebMouseEvent webEvent(theEvent, self); \
_data->_page->handleMouseEvent(webEvent); \
}
+#define NATIVE_MOUSE_EVENT_HANDLER_INTERNAL(Selector) \
+ - (void)Selector:(NSEvent *)theEvent \
+ { \
+ 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()); \
+ return; \
+ } \
+ NativeWebMouseEvent webEvent(theEvent, self); \
+ _data->_page->handleMouseEvent(webEvent); \
+ }
#endif
NATIVE_MOUSE_EVENT_HANDLER(mouseEntered)
NATIVE_MOUSE_EVENT_HANDLER(mouseExited)
-NATIVE_MOUSE_EVENT_HANDLER(mouseMovedInternal)
-NATIVE_MOUSE_EVENT_HANDLER(mouseDownInternal)
-NATIVE_MOUSE_EVENT_HANDLER(mouseUpInternal)
-NATIVE_MOUSE_EVENT_HANDLER(mouseDraggedInternal)
NATIVE_MOUSE_EVENT_HANDLER(otherMouseDown)
NATIVE_MOUSE_EVENT_HANDLER(otherMouseDragged)
-NATIVE_MOUSE_EVENT_HANDLER(otherMouseMoved)
NATIVE_MOUSE_EVENT_HANDLER(otherMouseUp)
NATIVE_MOUSE_EVENT_HANDLER(rightMouseDown)
NATIVE_MOUSE_EVENT_HANDLER(rightMouseDragged)
NATIVE_MOUSE_EVENT_HANDLER(rightMouseUp)
+NATIVE_MOUSE_EVENT_HANDLER_INTERNAL(mouseMovedInternal)
+NATIVE_MOUSE_EVENT_HANDLER_INTERNAL(mouseDownInternal)
+NATIVE_MOUSE_EVENT_HANDLER_INTERNAL(mouseUpInternal)
+NATIVE_MOUSE_EVENT_HANDLER_INTERNAL(mouseDraggedInternal)
+
#undef NATIVE_MOUSE_EVENT_HANDLER
- (void)_ensureGestureController