Title: [294158] trunk
Revision
294158
Author
commit-qu...@webkit.org
Date
2022-05-13 09:02:55 -0700 (Fri, 13 May 2022)

Log Message

Unreviewed, reverting r294113.
https://bugs.webkit.org/show_bug.cgi?id=240381

This bug needs to be addressed using a different approach

Reverted changeset:

"Mail compose: right clicking an image attachment selects it"
https://bugs.webkit.org/show_bug.cgi?id=240315
https://commits.webkit.org/r294113

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (294157 => 294158)


--- trunk/Source/WTF/ChangeLog	2022-05-13 14:54:08 UTC (rev 294157)
+++ trunk/Source/WTF/ChangeLog	2022-05-13 16:02:55 UTC (rev 294158)
@@ -1,3 +1,16 @@
+2022-05-13  Commit Queue  <commit-qu...@webkit.org>
+
+        Unreviewed, reverting r294113.
+        https://bugs.webkit.org/show_bug.cgi?id=240381
+
+        This bug needs to be addressed using a different approach
+
+        Reverted changeset:
+
+        "Mail compose: right clicking an image attachment selects it"
+        https://bugs.webkit.org/show_bug.cgi?id=240315
+        https://commits.webkit.org/r294113
+
 2022-05-12  Michael Catanzaro  <mcatanz...@redhat.com>
 
         False positive warning when building RefCounter test with GCC 12

Modified: trunk/Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h (294157 => 294158)


--- trunk/Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h	2022-05-13 14:54:08 UTC (rev 294157)
+++ trunk/Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h	2022-05-13 16:02:55 UTC (rev 294158)
@@ -72,7 +72,6 @@
     NullOriginForNonSpecialSchemedURLs,
     ObservesClassProperty,
     PictureInPictureMediaPlayback,
-    PreventImageSelectionOnContextualMenuClickInEditablePage,
     ProcessSwapOnCrossSiteNavigation,
     RequiresUserGestureToLoadVideo,
     RestrictsBaseURLSchemes,

Modified: trunk/Source/WebCore/ChangeLog (294157 => 294158)


--- trunk/Source/WebCore/ChangeLog	2022-05-13 14:54:08 UTC (rev 294157)
+++ trunk/Source/WebCore/ChangeLog	2022-05-13 16:02:55 UTC (rev 294158)
@@ -1,3 +1,16 @@
+2022-05-13  Commit Queue  <commit-qu...@webkit.org>
+
+        Unreviewed, reverting r294113.
+        https://bugs.webkit.org/show_bug.cgi?id=240381
+
+        This bug needs to be addressed using a different approach
+
+        Reverted changeset:
+
+        "Mail compose: right clicking an image attachment selects it"
+        https://bugs.webkit.org/show_bug.cgi?id=240315
+        https://commits.webkit.org/r294113
+
 2022-05-13  Alejandro G. Castro  <a...@igalia.com>
 
 

Modified: trunk/Source/WebCore/page/EventHandler.cpp (294157 => 294158)


--- trunk/Source/WebCore/page/EventHandler.cpp	2022-05-13 14:54:08 UTC (rev 294157)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2022-05-13 16:02:55 UTC (rev 294158)
@@ -127,10 +127,6 @@
 #include <wtf/SetForScope.h>
 #include <wtf/StdLibExtras.h>
 
-#if PLATFORM(COCOA)
-#include <wtf/cocoa/RuntimeApplicationChecksCocoa.h>
-#endif
-
 #if ENABLE(IOS_TOUCH_EVENTS)
 #include "PlatformTouchEventIOS.h"
 #endif
@@ -3281,17 +3277,8 @@
     if (mouseEvent.scrollbar() || view->scrollbarAtPoint(event.position()))
         return false;
 
-    bool allowSelection = true;
-#if PLATFORM(COCOA)
-    if (linkedOnOrAfterSDKWithBehavior(SDKAlignedBehavior::PreventImageSelectionOnContextualMenuClickInEditablePage)) {
-        auto* page = m_frame.page();
-        allowSelection = page && (!page->isEditable() || !is<HTMLImageElement>(mouseEvent.hitTestResult().targetElement()));
-    }
-#endif
-
     if (m_frame.editor().behavior().shouldSelectOnContextualMenuClick()
-        && !m_frame.selection().contains(viewportPos)
-        && allowSelection) {
+        && !m_frame.selection().contains(viewportPos)) {
         m_mouseDownMayStartSelect = true; // context menu events are always allowed to perform a selection
         selectClosestContextualWordOrLinkFromHitTestResult(mouseEvent.hitTestResult(), shouldAppendTrailingWhitespace(mouseEvent, m_frame));
     }

Modified: trunk/Tools/ChangeLog (294157 => 294158)


--- trunk/Tools/ChangeLog	2022-05-13 14:54:08 UTC (rev 294157)
+++ trunk/Tools/ChangeLog	2022-05-13 16:02:55 UTC (rev 294158)
@@ -1,3 +1,16 @@
+2022-05-13  Commit Queue  <commit-qu...@webkit.org>
+
+        Unreviewed, reverting r294113.
+        https://bugs.webkit.org/show_bug.cgi?id=240381
+
+        This bug needs to be addressed using a different approach
+
+        Reverted changeset:
+
+        "Mail compose: right clicking an image attachment selects it"
+        https://bugs.webkit.org/show_bug.cgi?id=240315
+        https://commits.webkit.org/r294113
+
 2022-05-12  Philippe Normand  <ph...@igalia.com>
 
         [Flatpak SDK] Sandbox access to pipewire socket

Modified: trunk/Tools/TestWebKitAPI/Tests/mac/ContextMenuTests.mm (294157 => 294158)


--- trunk/Tools/TestWebKitAPI/Tests/mac/ContextMenuTests.mm	2022-05-13 14:54:08 UTC (rev 294157)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/ContextMenuTests.mm	2022-05-13 16:02:55 UTC (rev 294158)
@@ -33,7 +33,6 @@
 #import "Utilities.h"
 #import <WebKit/WKMenuItemIdentifiersPrivate.h>
 #import <WebKit/WKUIDelegatePrivate.h>
-#import <WebKit/WKWebViewConfigurationPrivate.h>
 
 @interface NSMenu (ContextMenuTests)
 - (NSMenuItem *)itemWithIdentifier:(NSString *)identifier;
@@ -84,45 +83,6 @@
     EXPECT_NOT_NULL([spellingSubmenu itemWithIdentifier:_WKMenuItemIdentifierCheckGrammarWithSpelling]);
 }
 
-NSString *imageWithContextMenuHandler = @""
-    "<script>"
-    "    addEventListener('contextmenu', () => contextmenuSeen = true);"
-    "</script>"
-    "<img src=''>";
-
-static void rightClick(RetainPtr<TestWKWebView> webView)
-{
-    [webView mouseDownAtPoint:NSMakePoint(100, 100) simulatePressure:NO withFlags:0 eventType:NSEventTypeRightMouseDown];
-    [webView mouseUpAtPoint:NSMakePoint(100, 100) withFlags:0 eventType:NSEventTypeRightMouseUp];
-}
-
-TEST(ContextMenuTests, ContextMenuForEditableWebViewDoesNotSelectImage)
-{
-    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
-    [configuration _setAttachmentElementEnabled:YES];
-    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600) configuration:configuration.get()]);
-    [webView _setEditable:YES];
-
-    [webView synchronouslyLoadHTMLString:imageWithContextMenuHandler];
-
-    auto uiDelegate = adoptNS([[TestUIDelegate alloc] init]);
-    [webView setUIDelegate:uiDelegate.get()];
-
-    __block bool done = false;
-    [uiDelegate setGetContextMenuFromProposedMenu:^(NSMenu *menu, _WKContextMenuElementInfo *, id<NSSecureCoding>, void (^completion)(NSMenu *)) {
-        completion(nil);
-        done = true;
-    }];
-
-    rightClick(webView);
-    Util::run(&done);
-
-    rightClick(webView);
-    EXPECT_TRUE([[webView objectByEvaluatingJavaScript:@"window.contextmenuSeen"] boolValue]);
-    NSNumber *result = [webView objectByEvaluatingJavaScript:@"window.getSelection().isCollapsed"];
-    EXPECT_TRUE([result boolValue]);
-}
-
 } // namespace TestWebKitAPI
 
 #endif // PLATFORM(MAC)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to