REGRESSION (r246103) [ Mojave+ WK1 ] Layout Test scrollbars/scrollbar-iframe-click...
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jun 2019 06:50:51 +0000 (06:50 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jun 2019 06:50:51 +0000 (06:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=198800
<rdar://problem/51679634>

Reviewed by Tim Horton.

Source/WebKitLegacy/mac:

Expose a private method that we need to use from DumpRenderTree.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _hitViewForEvent:]):
* WebView/WebHTMLViewPrivate.h:

Tools:

We didn't detect an NSScroller in a sub-frame due to WebHTMLView's implementation of -[NSView hitTest:]. We now use a private method
which lets us use the default implementation and correctly returns an NSScroller in a sub-frame.

* DumpRenderTree/mac/EventSendingController.mm:
(eventPressedMouseButtonsSwizzlerForViewAndEvent):
(-[EventSendingController mouseDown:withModifiers:]):
(-[EventSendingController mouseUp:withModifiers:]):
(-[EventSendingController mouseMoveToX:Y:]):

LayoutTests:

This test now passes reliably on WK1.

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246429 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk1/TestExpectations
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
Source/WebKitLegacy/mac/WebView/WebHTMLViewPrivate.h
Tools/ChangeLog
Tools/DumpRenderTree/mac/EventSendingController.mm

index d5193f2..a3cf515 100644 (file)
@@ -1,3 +1,15 @@
+2019-06-13  Antoine Quint  <graouts@apple.com>
+
+        REGRESSION (r246103) [ Mojave+ WK1 ] Layout Test scrollbars/scrollbar-iframe-click-does-not-blur-content.html is timing out
+        https://bugs.webkit.org/show_bug.cgi?id=198800
+        <rdar://problem/51679634>
+
+        Reviewed by Tim Horton.
+
+        This test now passes reliably on WK1.
+
+        * platform/mac-wk1/TestExpectations:
+
 2019-06-12  Myles C. Maxfield  <mmaxfield@apple.com>
 
         [WHLSL] Hook up compute
index 4f5ab12..d39f635 100644 (file)
@@ -739,5 +739,3 @@ webkit.org/b/198459 [ HighSierra Debug ] inspector/canvas/recording-2d-full.html
 webkit.org/b/198459 [ HighSierra Debug ] inspector/canvas/recording-webgl-full.html [ Slow ]
 
 webkit.org/b/196508 compositing/repaint/scroller-with-foreground-layer-repaints.html [ Pass Failure ]
-
-webkit.org/b/198800 [ Mojave+ ] scrollbars/scrollbar-iframe-click-does-not-blur-content.html [ Pass Timeout ]
index b95d7bb..28e6af4 100644 (file)
@@ -1,3 +1,17 @@
+2019-06-13  Antoine Quint  <graouts@apple.com>
+
+        REGRESSION (r246103) [ Mojave+ WK1 ] Layout Test scrollbars/scrollbar-iframe-click-does-not-blur-content.html is timing out
+        https://bugs.webkit.org/show_bug.cgi?id=198800
+        <rdar://problem/51679634>
+
+        Reviewed by Tim Horton.
+
+        Expose a private method that we need to use from DumpRenderTree.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _hitViewForEvent:]):
+        * WebView/WebHTMLViewPrivate.h:
+
 2019-06-10  Sam Weinig  <weinig@apple.com>
 
         Remove Dashboard support
index 9104112..f1bdcdb 100644 (file)
@@ -846,7 +846,6 @@ static void hardwareKeyboardAvailabilityChangedCallback(CFNotificationCenterRef,
 - (BOOL)_shouldReplaceSelectionWithText:(NSString *)text givenAction:(WebViewInsertAction)action;
 - (DOMRange *)_selectedRange;
 #if PLATFORM(MAC)
-- (NSView *)_hitViewForEvent:(NSEvent *)event;
 - (void)_writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard cachedAttributedString:(NSAttributedString *)attributedString;
 #endif
 - (DOMRange *)_documentRange;
@@ -1337,16 +1336,6 @@ static NSControlStateValue kit(TriState state)
 
 #if PLATFORM(MAC)
 
-- (NSView *)_hitViewForEvent:(NSEvent *)event
-{
-    // Usually, we hack AK's hitTest method to catch all events at the topmost WebHTMLView.  
-    // Callers of this method, however, want to query the deepest view instead.
-    forceNSViewHitTest = YES;
-    NSView *hitView = [(NSView *)[[self window] contentView] hitTest:[event locationInWindow]];
-    forceNSViewHitTest = NO;    
-    return hitView;
-}
-
 - (void)_writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard cachedAttributedString:(NSAttributedString *)attributedString
 {
     // Put HTML on the pasteboard.
@@ -2571,6 +2560,20 @@ ALLOW_DEPRECATED_DECLARATIONS_END
 
 #endif
 
+#if PLATFORM(MAC)
+
+- (NSView *)_hitViewForEvent:(NSEvent *)event
+{
+    // Usually, we hack AK's hitTest method to catch all events at the topmost WebHTMLView.
+    // Callers of this method, however, want to query the deepest view instead.
+    forceNSViewHitTest = YES;
+    NSView *hitView = [(NSView *)[[self window] contentView] hitTest:[event locationInWindow]];
+    forceNSViewHitTest = NO;
+    return hitView;
+}
+
+#endif
+
 @end
 
 @implementation NSView (WebHTMLViewFileInternal)
index 79ea272..f179329 100644 (file)
@@ -147,4 +147,8 @@ extern const float _WebHTMLViewPrintingMaximumShrinkFactor;
 - (id)accessibilityRootElement;
 #endif
 
+#if !TARGET_OS_IPHONE
+- (NSView *)_hitViewForEvent:(NSEvent *)event;
+#endif
+
 @end
index 3118e10..597593a 100644 (file)
@@ -1,3 +1,20 @@
+2019-06-13  Antoine Quint  <graouts@apple.com>
+
+        REGRESSION (r246103) [ Mojave+ WK1 ] Layout Test scrollbars/scrollbar-iframe-click-does-not-blur-content.html is timing out
+        https://bugs.webkit.org/show_bug.cgi?id=198800
+        <rdar://problem/51679634>
+
+        Reviewed by Tim Horton.
+
+        We didn't detect an NSScroller in a sub-frame due to WebHTMLView's implementation of -[NSView hitTest:]. We now use a private method
+        which lets us use the default implementation and correctly returns an NSScroller in a sub-frame.
+
+        * DumpRenderTree/mac/EventSendingController.mm:
+        (eventPressedMouseButtonsSwizzlerForViewAndEvent):
+        (-[EventSendingController mouseDown:withModifiers:]):
+        (-[EventSendingController mouseUp:withModifiers:]):
+        (-[EventSendingController mouseMoveToX:Y:]):
+
 2019-06-13  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         [WinCairo][WebKitTestRunner] pixel image dump outputs blank images
index 3e88d82..461bd3d 100644 (file)
@@ -47,6 +47,7 @@
 #if !PLATFORM(IOS_FAMILY)
 #import <Carbon/Carbon.h> // for GetCurrentEventTime()
 #import <WebKit/WebHTMLView.h>
+#import <WebKit/WebHTMLViewPrivate.h>
 #import <objc/runtime.h>
 #import <wtf/mac/AppKitCompatibilityDeclarations.h>
 #endif
@@ -563,6 +564,13 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
 }
 
 #if !PLATFORM(IOS_FAMILY)
+static std::unique_ptr<ClassMethodSwizzler> eventPressedMouseButtonsSwizzlerForViewAndEvent(NSView* view, NSEvent* event)
+{
+    if ([view isKindOfClass:[WebHTMLView class]])
+        view = [(WebHTMLView *)view _hitViewForEvent:event];
+    return ![view isKindOfClass:[NSScroller class]] ? std::make_unique<ClassMethodSwizzler>([NSEvent class], @selector(pressedMouseButtons), reinterpret_cast<IMP>(swizzledEventPressedMouseButtons)) : NULL;
+}
+
 static NSUInteger swizzledEventPressedMouseButtons()
 {
     return mouseButtonsCurrentlyDown;
@@ -600,7 +608,7 @@ static NSUInteger swizzledEventPressedMouseButtons()
 #endif
         {
 #if !PLATFORM(IOS_FAMILY)
-            auto eventPressedMouseButtonsSwizzler = ![subView isKindOfClass:[NSScroller class]] ? std::make_unique<ClassMethodSwizzler>([NSEvent class], @selector(pressedMouseButtons), reinterpret_cast<IMP>(swizzledEventPressedMouseButtons)) : NULL;
+            auto eventPressedMouseButtonsSwizzler = eventPressedMouseButtonsSwizzlerForViewAndEvent(subView, event);
 #endif
             [subView mouseDown:event];
         }
@@ -696,7 +704,7 @@ static NSUInteger swizzledEventPressedMouseButtons()
 #endif
     {
 #if !PLATFORM(IOS_FAMILY)
-        auto eventPressedMouseButtonsSwizzler = ![targetView isKindOfClass:[NSScroller class]] ? std::make_unique<ClassMethodSwizzler>([NSEvent class], @selector(pressedMouseButtons), reinterpret_cast<IMP>(swizzledEventPressedMouseButtons)) : NULL;
+        auto eventPressedMouseButtonsSwizzler = eventPressedMouseButtonsSwizzlerForViewAndEvent(targetView, event);
 #endif
         [targetView mouseUp:event];
     }
@@ -786,14 +794,14 @@ static NSUInteger swizzledEventPressedMouseButtons()
                 [[mainFrame webView] draggingUpdated:draggingInfo];
             } else {
 #if !PLATFORM(IOS_FAMILY)
-                auto eventPressedMouseButtonsSwizzler = ![subView isKindOfClass:[NSScroller class]] ? std::make_unique<ClassMethodSwizzler>([NSEvent class], @selector(pressedMouseButtons), reinterpret_cast<IMP>(swizzledEventPressedMouseButtons)) : NULL;
+                auto eventPressedMouseButtonsSwizzler = eventPressedMouseButtonsSwizzlerForViewAndEvent(subView, event);
 #endif
                 [subView mouseDragged:event];
             }
 #endif
         } else {
 #if !PLATFORM(IOS_FAMILY)
-            auto eventPressedMouseButtonsSwizzler = ![subView isKindOfClass:[NSScroller class]] ? std::make_unique<ClassMethodSwizzler>([NSEvent class], @selector(pressedMouseButtons), reinterpret_cast<IMP>(swizzledEventPressedMouseButtons)) : NULL;
+            auto eventPressedMouseButtonsSwizzler = eventPressedMouseButtonsSwizzlerForViewAndEvent(subView, event);
 #endif
             [subView mouseMoved:event];
         }