Title: [181741] tags/Safari-601.1.23.3/Source

Diff

Modified: tags/Safari-601.1.23.3/Source/WebCore/ChangeLog (181740 => 181741)


--- tags/Safari-601.1.23.3/Source/WebCore/ChangeLog	2015-03-19 08:55:00 UTC (rev 181740)
+++ tags/Safari-601.1.23.3/Source/WebCore/ChangeLog	2015-03-19 08:57:43 UTC (rev 181741)
@@ -1,5 +1,20 @@
 2015-03-19  Babak Shafiei  <[email protected]>
 
+        Merge r181668.
+
+    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-19  Babak Shafiei  <[email protected]>
+
         Merge r181703.
 
     2015-03-18  Myles C. Maxfield  <[email protected]>

Modified: tags/Safari-601.1.23.3/Source/WebCore/platform/spi/mac/NSMenuSPI.h (181740 => 181741)


--- tags/Safari-601.1.23.3/Source/WebCore/platform/spi/mac/NSMenuSPI.h	2015-03-19 08:55:00 UTC (rev 181740)
+++ tags/Safari-601.1.23.3/Source/WebCore/platform/spi/mac/NSMenuSPI.h	2015-03-19 08:57:43 UTC (rev 181741)
@@ -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: tags/Safari-601.1.23.3/Source/WebKit/mac/ChangeLog (181740 => 181741)


--- tags/Safari-601.1.23.3/Source/WebKit/mac/ChangeLog	2015-03-19 08:55:00 UTC (rev 181740)
+++ tags/Safari-601.1.23.3/Source/WebKit/mac/ChangeLog	2015-03-19 08:57:43 UTC (rev 181741)
@@ -1,3 +1,19 @@
+2015-03-19  Babak Shafiei  <[email protected]>
+
+        Merge r181668.
+
+    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-14  Dean Jackson  <[email protected]>
 
         Feature flag for Animations Level 2

Modified: tags/Safari-601.1.23.3/Source/WebKit/mac/WebView/WebHTMLView.mm (181740 => 181741)


--- tags/Safari-601.1.23.3/Source/WebKit/mac/WebView/WebHTMLView.mm	2015-03-19 08:55:00 UTC (rev 181740)
+++ tags/Safari-601.1.23.3/Source/WebKit/mac/WebView/WebHTMLView.mm	2015-03-19 08:57:43 UTC (rev 181741)
@@ -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: tags/Safari-601.1.23.3/Source/WebKit2/ChangeLog (181740 => 181741)


--- tags/Safari-601.1.23.3/Source/WebKit2/ChangeLog	2015-03-19 08:55:00 UTC (rev 181740)
+++ tags/Safari-601.1.23.3/Source/WebKit2/ChangeLog	2015-03-19 08:57:43 UTC (rev 181741)
@@ -1,3 +1,21 @@
+2015-03-19  Babak Shafiei  <[email protected]>
+
+        Merge r181668.
+
+    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-16  Przemyslaw Piorkowski  <[email protected]>
 
         [EFL][WK2] REGRESSION(r178526): test_ewk2_storage_manager has been failed for a long time

Modified: tags/Safari-601.1.23.3/Source/WebKit2/UIProcess/API/mac/WKView.mm (181740 => 181741)


--- tags/Safari-601.1.23.3/Source/WebKit2/UIProcess/API/mac/WKView.mm	2015-03-19 08:55:00 UTC (rev 181740)
+++ tags/Safari-601.1.23.3/Source/WebKit2/UIProcess/API/mac/WKView.mm	2015-03-19 08:57:43 UTC (rev 181741)
@@ -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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to