Title: [278767] trunk
Revision
278767
Author
megan_gard...@apple.com
Date
2021-06-11 10:46:08 -0700 (Fri, 11 Jun 2021)

Log Message

Rename AppHighlight group to QuickNote to correctly reflect feature.
https://bugs.webkit.org/show_bug.cgi?id=226888

Reviewed by Tim Horton.

Source/WebCore:

Rename only, no behavior change.

* Modules/highlight/AppHighlight.h:
(WebCore::AppHighlight::encode const):
(WebCore::AppHighlight::decode):
* Modules/highlight/AppHighlightStorage.cpp:
(WebCore::AppHighlightStorage::storeAppHighlight):
* Modules/highlight/AppHighlightStorage.h:
* en.lproj/Localizable.strings:
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::populate):
(WebCore::ContextMenuController::checkOrEnableIfNeeded const):
* platform/ContextMenuItem.cpp:
(WebCore::isValidContextMenuAction):
* platform/ContextMenuItem.h:
* platform/LocalizedStrings.h:
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::contextMenuItemTagAddHighlightToQuickNote):
(WebCore::contextMenuItemTagAddHighlightToNewQuickNote):
(WebCore::contextMenuItemTagAddHighlightToCurrentGroup): Deleted.
(WebCore::contextMenuItemTagAddHighlightToNewGroup): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::appHighlightContextMenuItemTitles const):

Source/WebKit:

* Scripts/webkit/messages.py:
(headers_for_type):
* Shared/API/c/WKContextMenuItemTypes.h:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
(WebKit::toImpl):
* UIProcess/API/Cocoa/WKMenuItemIdentifiers.mm:
* UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _storeAppHighlight:]):
(-[WKWebView _addAppHighlightInNewGroup:originatedInApp:]):
(-[WKWebView _addAppHighlightInNewQuickNote:originatedInApp:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKAppHighlightDelegate.h:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::createAppHighlightInSelectedRange):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::contextMenuItemSelected):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView targetForAction:withSender:]):
(-[WKContentView setUpAppHighlightMenusIfNeeded]):
(-[WKContentView createHighlightForCurrentQuickNoteWithRange:]):
(-[WKContentView createHighlightForNewQuickNoteWithRange:]):
(-[WKContentView createHighlightInCurrentGroupWithRange:]): Deleted.
(-[WKContentView createHighlightInNewGroupWithRange:]): Deleted.
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::menuItemIdentifier):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::storeAppHighlight const):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createAppHighlightInSelectedRange):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::highlightIsNewQuickNote const):
(WebKit::WebPage::highlightIsNewGroup const): Deleted.
* WebProcess/WebPage/WebPage.messages.in:

Source/WebKitLegacy/mac:

* WebView/WebHTMLView.mm:
(toTag):
* WebView/WebUIDelegatePrivate.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKContentViewEditingActions.mm:
(TEST):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (278766 => 278767)


--- trunk/Source/WebCore/ChangeLog	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebCore/ChangeLog	2021-06-11 17:46:08 UTC (rev 278767)
@@ -1,3 +1,35 @@
+2021-06-11  Megan Gardner  <megan_gard...@apple.com>
+
+        Rename AppHighlight group to QuickNote to correctly reflect feature.
+        https://bugs.webkit.org/show_bug.cgi?id=226888
+
+        Reviewed by Tim Horton.
+
+        Rename only, no behavior change.
+
+        * Modules/highlight/AppHighlight.h:
+        (WebCore::AppHighlight::encode const):
+        (WebCore::AppHighlight::decode):
+        * Modules/highlight/AppHighlightStorage.cpp:
+        (WebCore::AppHighlightStorage::storeAppHighlight):
+        * Modules/highlight/AppHighlightStorage.h:
+        * en.lproj/Localizable.strings:
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::contextMenuItemSelected):
+        (WebCore::ContextMenuController::populate):
+        (WebCore::ContextMenuController::checkOrEnableIfNeeded const):
+        * platform/ContextMenuItem.cpp:
+        (WebCore::isValidContextMenuAction):
+        * platform/ContextMenuItem.h:
+        * platform/LocalizedStrings.h:
+        * platform/cocoa/LocalizedStringsCocoa.mm:
+        (WebCore::contextMenuItemTagAddHighlightToQuickNote):
+        (WebCore::contextMenuItemTagAddHighlightToNewQuickNote):
+        (WebCore::contextMenuItemTagAddHighlightToCurrentGroup): Deleted.
+        (WebCore::contextMenuItemTagAddHighlightToNewGroup): Deleted.
+        * testing/Internals.cpp:
+        (WebCore::Internals::appHighlightContextMenuItemTitles const):
+
 2021-06-11  Cathie Chen  <cathiec...@igalia.com>
 
         Use HTMLDimension to parse different HTML attribute length values

Modified: trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.h (278766 => 278767)


--- trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.h	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.h	2021-06-11 17:46:08 UTC (rev 278767)
@@ -25,6 +25,7 @@
 
 #pragma once
 
+#include "AppHighlight.h"
 #include "AppHighlightRangeData.h"
 #include <wtf/Forward.h>
 #include <wtf/MonotonicTime.h>
@@ -42,8 +43,6 @@
 class StaticRange;
 class Highlight;
 
-enum class CreateNewGroupForHighlight : bool;
-
 enum class RestoreWithTextSearch : bool { No, Yes };
 
 enum class ScrollToHighlight : bool { No, Yes };

Modified: trunk/Source/WebCore/en.lproj/Localizable.strings (278766 => 278767)


--- trunk/Source/WebCore/en.lproj/Localizable.strings	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebCore/en.lproj/Localizable.strings	2021-06-11 17:46:08 UTC (rev 278767)
@@ -130,6 +130,9 @@
 /* WKErrorJavaScriptExceptionOccurred description */
 "A _javascript_ exception occurred" = "A _javascript_ exception occurred";
 
+/* Add to Quick Note context menu item. */
+"Add to Quick Note" = "Add to Quick Note";
+
 /* Label for the add money with Apple Pay button. */
 "Add money with Apple Pay" = "Add money with Apple Pay";
 
@@ -625,6 +628,9 @@
 /* Media Mute context menu item */
 "Mute" = "Mute";
 
+/* New Quick Note context menu item. */
+"New Quick Note" = "New Quick Note";
+
 /* No Guesses Found context menu item */
 "No Guesses Found" = "No Guesses Found";
 

Modified: trunk/Source/WebCore/page/ContextMenuController.cpp (278766 => 278767)


--- trunk/Source/WebCore/page/ContextMenuController.cpp	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebCore/page/ContextMenuController.cpp	2021-06-11 17:46:08 UTC (rev 278767)
@@ -441,12 +441,6 @@
     case ContextMenuItemTagTextDirectionRightToLeft:
         frame->editor().command("MakeTextWritingDirectionRightToLeft").execute();
         break;
-    case ContextMenuItemTagAddHighlightToCurrentGroup:
-        // FIXME: Add Highlight Logic
-        break;
-    case ContextMenuItemTagAddHighlightToNewGroup:
-        // FIXME: Add Highlight Logic
-        break;
 #if PLATFORM(COCOA)
     case ContextMenuItemTagSearchInSpotlight:
         m_client.searchWithSpotlight();
@@ -801,8 +795,8 @@
         contextMenuItemTagSearchInSpotlight());
 #endif
 #if ENABLE(APP_HIGHLIGHTS)
-    ContextMenuItem AddHighlightItem(ActionType, ContextMenuItemTagAddHighlightToCurrentGroup, contextMenuItemTagAddHighlightToCurrentGroup());
-    ContextMenuItem AddHighlightToNewGroupItem(ActionType, ContextMenuItemTagAddHighlightToNewGroup, contextMenuItemTagAddHighlightToNewGroup());
+    ContextMenuItem AddHighlightItem(ActionType, ContextMenuItemTagAddHighlightToCurrentQuickNote, contextMenuItemTagAddHighlightToCurrentQuickNote());
+    ContextMenuItem AddHighlightToNewQuickNoteItem(ActionType, ContextMenuItemTagAddHighlightToNewQuickNote, contextMenuItemTagAddHighlightToNewQuickNote());
 #endif
 #if !PLATFORM(GTK)
     ContextMenuItem SearchWebItem(ActionType, ContextMenuItemTagSearchWeb, contextMenuItemTagSearchWeb());
@@ -968,7 +962,7 @@
 #if ENABLE(APP_HIGHLIGHTS)
                 if (auto* page = frame->page()) {
                     if (page->settings().appHighlightsEnabled() && !selectionIsInsideImageOverlay) {
-                        appendItem(AddHighlightToNewGroupItem, m_contextMenu.get());
+                        appendItem(AddHighlightToNewQuickNoteItem, m_contextMenu.get());
                         appendItem(AddHighlightItem, m_contextMenu.get());
                         appendItem(*separatorItem(), m_contextMenu.get());
                     }
@@ -1319,10 +1313,10 @@
         case ContextMenuItemTagCheckSpellingWhileTyping:
             shouldCheck = frame->editor().isContinuousSpellCheckingEnabled();
             break;
-        case ContextMenuItemTagAddHighlightToCurrentGroup:
+        case ContextMenuItemTagAddHighlightToCurrentQuickNote:
             shouldEnable = frame->selection().isRange();
             break;
-        case ContextMenuItemTagAddHighlightToNewGroup:
+        case ContextMenuItemTagAddHighlightToNewQuickNote:
             shouldEnable = frame->selection().isRange();
             break;
 #if PLATFORM(COCOA)

Modified: trunk/Source/WebCore/platform/ContextMenuItem.cpp (278766 => 278767)


--- trunk/Source/WebCore/platform/ContextMenuItem.cpp	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebCore/platform/ContextMenuItem.cpp	2021-06-11 17:46:08 UTC (rev 278767)
@@ -229,8 +229,8 @@
     case ContextMenuAction::ContextMenuItemTagTextDirectionDefault:
     case ContextMenuAction::ContextMenuItemTagTextDirectionLeftToRight:
     case ContextMenuAction::ContextMenuItemTagTextDirectionRightToLeft:
-    case ContextMenuAction::ContextMenuItemTagAddHighlightToCurrentGroup:
-    case ContextMenuAction::ContextMenuItemTagAddHighlightToNewGroup:
+    case ContextMenuAction::ContextMenuItemTagAddHighlightToCurrentQuickNote:
+    case ContextMenuAction::ContextMenuItemTagAddHighlightToNewQuickNote:
 #if PLATFORM(COCOA)
     case ContextMenuAction::ContextMenuItemTagCorrectSpellingAutomatically:
     case ContextMenuAction::ContextMenuItemTagSubstitutionsMenu:

Modified: trunk/Source/WebCore/platform/ContextMenuItem.h (278766 => 278767)


--- trunk/Source/WebCore/platform/ContextMenuItem.h	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebCore/platform/ContextMenuItem.h	2021-06-11 17:46:08 UTC (rev 278767)
@@ -145,8 +145,8 @@
     ContextMenuItemTagToggleVideoFullscreen,
     ContextMenuItemTagShareMenu,
     ContextMenuItemTagToggleVideoEnhancedFullscreen,
-    ContextMenuItemTagAddHighlightToCurrentGroup,
-    ContextMenuItemTagAddHighlightToNewGroup,
+    ContextMenuItemTagAddHighlightToCurrentQuickNote,
+    ContextMenuItemTagAddHighlightToNewQuickNote,
     ContextMenuItemTagLookUpImage,
     ContextMenuItemTagTranslate,
     ContextMenuItemBaseCustomTag = 5000,

Modified: trunk/Source/WebCore/platform/LocalizedStrings.h (278766 => 278767)


--- trunk/Source/WebCore/platform/LocalizedStrings.h	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebCore/platform/LocalizedStrings.h	2021-06-11 17:46:08 UTC (rev 278767)
@@ -51,8 +51,8 @@
     String copyImageUnknownFileLabel();
 #endif
 #if ENABLE(APP_HIGHLIGHTS)
-    WEBCORE_EXPORT String contextMenuItemTagAddHighlightToCurrentGroup();
-    WEBCORE_EXPORT String contextMenuItemTagAddHighlightToNewGroup();
+    WEBCORE_EXPORT String contextMenuItemTagAddHighlightToCurrentQuickNote();
+    WEBCORE_EXPORT String contextMenuItemTagAddHighlightToNewQuickNote();
 #endif
 
 #if ENABLE(CONTEXT_MENUS)

Modified: trunk/Source/WebCore/platform/cocoa/LocalizedStringsCocoa.mm (278766 => 278767)


--- trunk/Source/WebCore/platform/cocoa/LocalizedStringsCocoa.mm	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebCore/platform/cocoa/LocalizedStringsCocoa.mm	2021-06-11 17:46:08 UTC (rev 278767)
@@ -58,14 +58,14 @@
     return WEB_UI_STRING("unknown", "Unknown filename");
 }
 #if ENABLE(APP_HIGHLIGHTS)
-String contextMenuItemTagAddHighlightToCurrentGroup()
+String contextMenuItemTagAddHighlightToCurrentQuickNote()
 {
-    return localizedNSString(@"Add Highlight To Current Group");
+    return localizedNSString(@"Add to Quick Note");
 }
 
-String contextMenuItemTagAddHighlightToNewGroup()
+String contextMenuItemTagAddHighlightToNewQuickNote()
 {
-    return localizedNSString(@"Add Highlight To New Group");
+    return localizedNSString(@"New Quick Note");
 }
 #endif
 

Modified: trunk/Source/WebCore/testing/Internals.cpp (278766 => 278767)


--- trunk/Source/WebCore/testing/Internals.cpp	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebCore/testing/Internals.cpp	2021-06-11 17:46:08 UTC (rev 278767)
@@ -6091,8 +6091,8 @@
 Vector<String> Internals::appHighlightContextMenuItemTitles() const
 {
     return {{
-        contextMenuItemTagAddHighlightToCurrentGroup(),
-        contextMenuItemTagAddHighlightToNewGroup(),
+        contextMenuItemTagAddHighlightToCurrentQuickNote(),
+        contextMenuItemTagAddHighlightToNewQuickNote(),
     }};
 }
 

Modified: trunk/Source/WebKit/ChangeLog (278766 => 278767)


--- trunk/Source/WebKit/ChangeLog	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebKit/ChangeLog	2021-06-11 17:46:08 UTC (rev 278767)
@@ -1,3 +1,47 @@
+2021-06-11  Megan Gardner  <megan_gard...@apple.com>
+
+        Rename AppHighlight group to QuickNote to correctly reflect feature.
+        https://bugs.webkit.org/show_bug.cgi?id=226888
+
+        Reviewed by Tim Horton.
+
+        * Scripts/webkit/messages.py:
+        (headers_for_type):
+        * Shared/API/c/WKContextMenuItemTypes.h:
+        * Shared/API/c/WKSharedAPICast.h:
+        (WebKit::toAPI):
+        (WebKit::toImpl):
+        * UIProcess/API/Cocoa/WKMenuItemIdentifiers.mm:
+        * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _storeAppHighlight:]):
+        (-[WKWebView _addAppHighlightInNewGroup:originatedInApp:]):
+        (-[WKWebView _addAppHighlightInNewQuickNote:originatedInApp:]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        * UIProcess/API/Cocoa/_WKAppHighlightDelegate.h:
+        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+        (WebKit::WebPageProxy::createAppHighlightInSelectedRange):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::contextMenuItemSelected):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView targetForAction:withSender:]):
+        (-[WKContentView setUpAppHighlightMenusIfNeeded]):
+        (-[WKContentView createHighlightForCurrentQuickNoteWithRange:]):
+        (-[WKContentView createHighlightForNewQuickNoteWithRange:]):
+        (-[WKContentView createHighlightInCurrentGroupWithRange:]): Deleted.
+        (-[WKContentView createHighlightInNewGroupWithRange:]): Deleted.
+        * UIProcess/mac/WebContextMenuProxyMac.mm:
+        (WebKit::menuItemIdentifier):
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::storeAppHighlight const):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::createAppHighlightInSelectedRange):
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::highlightIsNewQuickNote const):
+        (WebKit::WebPage::highlightIsNewGroup const): Deleted.
+        * WebProcess/WebPage/WebPage.messages.in:
+
 2021-06-11  Michael Catanzaro  <mcatanz...@gnome.org>
 
         [GTK] Crash when dragging an account node above WebView

Modified: trunk/Source/WebKit/Shared/API/c/WKContextMenuItemTypes.h (278766 => 278767)


--- trunk/Source/WebKit/Shared/API/c/WKContextMenuItemTypes.h	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebKit/Shared/API/c/WKContextMenuItemTypes.h	2021-06-11 17:46:08 UTC (rev 278767)
@@ -123,8 +123,8 @@
     kWKContextMenuItemTagToggleVideoFullscreen,
     kWKContextMenuItemTagShareMenu,
     kWKContextMenuItemTagToggleVideoEnhancedFullscreen,
-    kWKContextMenuItemTagAddHighlightToCurrentGroup,
-    kWKContextMenuItemTagAddHighlightToNewGroup,
+    kWKContextMenuItemTagAddHighlightToCurrentQuickNote,
+    kWKContextMenuItemTagAddHighlightToNewQuickNote,
     kWKContextMenuItemTagRevealImage,
     kWKContextMenuItemTagTranslate,
     kWKContextMenuItemBaseApplicationTag = 10000

Modified: trunk/Source/WebKit/Shared/API/c/WKSharedAPICast.h (278766 => 278767)


--- trunk/Source/WebKit/Shared/API/c/WKSharedAPICast.h	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebKit/Shared/API/c/WKSharedAPICast.h	2021-06-11 17:46:08 UTC (rev 278767)
@@ -509,10 +509,10 @@
         return kWKContextMenuItemTagMediaPlayPause;
     case WebCore::ContextMenuItemTagMediaMute:
         return kWKContextMenuItemTagMediaMute;
-    case WebCore::ContextMenuItemTagAddHighlightToCurrentGroup:
-        return kWKContextMenuItemTagAddHighlightToCurrentGroup;
-    case WebCore::ContextMenuItemTagAddHighlightToNewGroup:
-        return kWKContextMenuItemTagAddHighlightToNewGroup;
+    case WebCore::ContextMenuItemTagAddHighlightToCurrentQuickNote:
+        return kWKContextMenuItemTagAddHighlightToCurrentQuickNote;
+    case WebCore::ContextMenuItemTagAddHighlightToNewQuickNote:
+        return kWKContextMenuItemTagAddHighlightToNewQuickNote;
 #if PLATFORM(COCOA)
     case WebCore::ContextMenuItemTagCorrectSpellingAutomatically:
         return kWKContextMenuItemTagCorrectSpellingAutomatically;
@@ -711,10 +711,10 @@
         return WebCore::ContextMenuItemTagMediaPlayPause;
     case kWKContextMenuItemTagMediaMute:
         return WebCore::ContextMenuItemTagMediaMute;
-    case kWKContextMenuItemTagAddHighlightToCurrentGroup:
-        return WebCore::ContextMenuItemTagAddHighlightToCurrentGroup;
-    case kWKContextMenuItemTagAddHighlightToNewGroup:
-        return WebCore::ContextMenuItemTagAddHighlightToNewGroup;
+    case kWKContextMenuItemTagAddHighlightToCurrentQuickNote:
+        return WebCore::ContextMenuItemTagAddHighlightToCurrentQuickNote;
+    case kWKContextMenuItemTagAddHighlightToNewQuickNote:
+        return WebCore::ContextMenuItemTagAddHighlightToNewQuickNote;
 #if PLATFORM(COCOA)
     case kWKContextMenuItemTagCorrectSpellingAutomatically:
         return WebCore::ContextMenuItemTagCorrectSpellingAutomatically;

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKMenuItemIdentifiers.mm (278766 => 278767)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKMenuItemIdentifiers.mm	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKMenuItemIdentifiers.mm	2021-06-11 17:46:08 UTC (rev 278767)
@@ -37,6 +37,9 @@
 NSString * const _WKMenuItemIdentifierGoForward = @"WKMenuItemIdentifierGoForward";
 NSString * const _WKMenuItemIdentifierInspectElement = @"WKMenuItemIdentifierInspectElement";
 NSString * const _WKMenuItemIdentifierLookUp = @"WKMenuItemIdentifierLookUp";
+NSString * const _WKMenuItemIdentifierAddHighlightToCurrentQuickNote = @"WKMenuItemIdentifierAddHighlightToCurrentQuickNote";
+NSString * const _WKMenuItemIdentifierAddHighlightToNewQuickNote = @"WKMenuItemIdentifierAddHighlightToNewQuickNote";
+// FIXME: Remove below after staging complete
 NSString * const _WKMenuItemIdentifierAddHighlightToCurrentGroup = @"WKMenuItemIdentifierAddHighlightToCurrentGroup";
 NSString * const _WKMenuItemIdentifierAddHighlightToNewGroup = @"WKMenuItemIdentifierAddHighlightToNewGroup";
 

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h (278766 => 278767)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h	2021-06-11 17:46:08 UTC (rev 278767)
@@ -55,6 +55,10 @@
 WK_EXPORT extern NSString * const _WKMenuItemIdentifierShareMenu WK_API_AVAILABLE(macos(10.12), ios(10.0));
 WK_EXPORT extern NSString * const _WKMenuItemIdentifierSpeechMenu WK_API_AVAILABLE(macos(10.12), ios(10.0));
 
+WK_EXPORT extern NSString * const _WKMenuItemIdentifierAddHighlightToCurrentQuickNote WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
+WK_EXPORT extern NSString * const _WKMenuItemIdentifierAddHighlightToNewQuickNote WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
+
+// FIXME: remove below after staging complete.
 WK_EXPORT extern NSString * const _WKMenuItemIdentifierAddHighlightToCurrentGroup WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 WK_EXPORT extern NSString * const _WKMenuItemIdentifierAddHighlightToNewGroup WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (278766 => 278767)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2021-06-11 17:46:08 UTC (rev 278767)
@@ -1564,7 +1564,8 @@
 
     auto wkHighlight = adoptNS([[_WKAppHighlight alloc] initWithHighlight:highlight.highlight->createNSData().get() text:text image:nil]);
 
-    [delegate _webView:self storeAppHighlight:wkHighlight.get() inNewGroup:highlight.isNewGroup == WebCore::CreateNewGroupForHighlight::Yes requestOriginatedInApp:highlight.requestOriginatedInApp == WebCore::HighlightRequestOriginatedInApp::Yes];
+    if ([delegate respondsToSelector:@selector(_webView:storeAppHighlight:inNewGroup:requestOriginatedInApp:)])
+        [delegate _webView:self storeAppHighlight:wkHighlight.get() inNewGroup:highlight.isNewGroup == WebCore::CreateNewGroupForHighlight::Yes requestOriginatedInApp:highlight.requestOriginatedInApp == WebCore::HighlightRequestOriginatedInApp::Yes];
 }
 #endif
 

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (278766 => 278767)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2021-06-11 17:46:08 UTC (rev 278767)
@@ -6879,13 +6879,13 @@
         TextChecker::toggleSpellingUIIsShowing();
         return;
 
-    case ContextMenuItemTagAddHighlightToNewGroup:
+    case ContextMenuItemTagAddHighlightToNewQuickNote:
 #if ENABLE(APP_HIGHLIGHTS)
         createAppHighlightInSelectedRange(CreateNewGroupForHighlight::Yes, HighlightRequestOriginatedInApp::No);
 #endif
         return;
 
-    case ContextMenuItemTagAddHighlightToCurrentGroup:
+    case ContextMenuItemTagAddHighlightToCurrentQuickNote:
 #if ENABLE(APP_HIGHLIGHTS)
         createAppHighlightInSelectedRange(CreateNewGroupForHighlight::No, HighlightRequestOriginatedInApp::No);
 #endif

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (278766 => 278767)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2021-06-11 17:46:08 UTC (rev 278767)
@@ -3860,9 +3860,9 @@
 - (id)targetForAction:(SEL)action withSender:(id)sender
 {
 #if ENABLE(APP_HIGHLIGHTS)
-    if (action == @selector(createHighlightInCurrentGroupWithRange:))
+    if (action == @selector(createHighlightForCurrentQuickNoteWithRange:))
         return self.shouldAllowAppHighlightCreation && _page->appHighlightsVisibility() ? self : nil;
-    if (action == @selector(createHighlightInNewGroupWithRange:))
+    if (action == @selector(createHighlightForNewQuickNoteWithRange:))
         return self.shouldAllowAppHighlightCreation && !_page->appHighlightsVisibility() ? self : nil;
 #endif
     return [_webView targetForAction:action withSender:sender];
@@ -9329,21 +9329,21 @@
         return;
     
     for (UIMenuItem *menuItem in [[UIMenuController sharedMenuController] menuItems]) {
-        if ([menuItem action] == @selector(createHighlightInCurrentGroupWithRange:) || [menuItem action] == @selector(createHighlightInNewGroupWithRange:))
+        if ([menuItem action] == @selector(createHighlightForCurrentQuickNoteWithRange:) || [menuItem action] == @selector(createHighlightForNewQuickNoteWithRange:))
             return;
     }
     
-    auto addHighlightCurrentGroupItem = adoptNS([[UIMenuItem alloc] initWithTitle:WebCore::contextMenuItemTagAddHighlightToCurrentGroup() action:@selector(createHighlightInCurrentGroupWithRange:)]);
-    auto addHighlightNewGroupItem = adoptNS([[UIMenuItem alloc] initWithTitle:WebCore::contextMenuItemTagAddHighlightToNewGroup() action:@selector(createHighlightInNewGroupWithRange:)]);
-    [[UIMenuController sharedMenuController] setMenuItems:@[ addHighlightCurrentGroupItem.get(), addHighlightNewGroupItem.get() ]];
+    auto addHighlightCurrentQuickNoteItem = adoptNS([[UIMenuItem alloc] initWithTitle:WebCore::contextMenuItemTagAddHighlightToCurrentQuickNote() action:@selector(createHighlightForCurrentQuickNoteWithRange:)]);
+    auto addHighlightNewQuickNoteItem = adoptNS([[UIMenuItem alloc] initWithTitle:WebCore::contextMenuItemTagAddHighlightToNewQuickNote() action:@selector(createHighlightForNewQuickNoteWithRange:)]);
+    [[UIMenuController sharedMenuController] setMenuItems:@[ addHighlightCurrentQuickNoteItem.get(), addHighlightNewQuickNoteItem.get() ]];
 }
 
-- (void)createHighlightInCurrentGroupWithRange:(id)sender
+- (void)createHighlightForCurrentQuickNoteWithRange:(id)sender
 {
     _page->createAppHighlightInSelectedRange(WebCore::CreateNewGroupForHighlight::No, WebCore::HighlightRequestOriginatedInApp::No);
 }
 
-- (void)createHighlightInNewGroupWithRange:(id)sender
+- (void)createHighlightForNewQuickNoteWithRange:(id)sender
 {
     _page->createAppHighlightInSelectedRange(WebCore::CreateNewGroupForHighlight::Yes, WebCore::HighlightRequestOriginatedInApp::No);
 }

Modified: trunk/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm (278766 => 278767)


--- trunk/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm	2021-06-11 17:46:08 UTC (rev 278767)
@@ -409,11 +409,11 @@
     case ContextMenuItemTagLookUpInDictionary:
         return _WKMenuItemIdentifierLookUp;
 
-    case ContextMenuItemTagAddHighlightToCurrentGroup:
-        return _WKMenuItemIdentifierAddHighlightToCurrentGroup;
+    case ContextMenuItemTagAddHighlightToCurrentQuickNote:
+        return _WKMenuItemIdentifierAddHighlightToCurrentQuickNote;
         
-    case ContextMenuItemTagAddHighlightToNewGroup:
-        return _WKMenuItemIdentifierAddHighlightToNewGroup;
+    case ContextMenuItemTagAddHighlightToNewQuickNote:
+        return _WKMenuItemIdentifierAddHighlightToNewQuickNote;
 
     case ContextMenuItemTagOpenFrameInNewWindow:
         return _WKMenuItemIdentifierOpenFrameInNewWindow;

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (278766 => 278767)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2021-06-11 17:46:08 UTC (rev 278767)
@@ -1,3 +1,14 @@
+2021-06-11  Megan Gardner  <megan_gard...@apple.com>
+
+        Rename AppHighlight group to QuickNote to correctly reflect feature.
+        https://bugs.webkit.org/show_bug.cgi?id=226888
+
+        Reviewed by Tim Horton.
+
+        * WebView/WebHTMLView.mm:
+        (toTag):
+        * WebView/WebUIDelegatePrivate.h:
+
 2021-06-10  Alex Christensen  <achristen...@webkit.org>
 
         Re-enable legacy WebView plug-ins (but not NPAPI)

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (278766 => 278767)


--- trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm	2021-06-11 17:46:08 UTC (rev 278767)
@@ -607,8 +607,8 @@
         return WebMenuItemTagDictationAlternative;
     case ContextMenuItemTagToggleVideoFullscreen:
         return WebMenuItemTagToggleVideoFullscreen;
-    case ContextMenuItemTagAddHighlightToCurrentGroup:
-    case ContextMenuItemTagAddHighlightToNewGroup:
+    case ContextMenuItemTagAddHighlightToCurrentQuickNote:
+    case ContextMenuItemTagAddHighlightToNewQuickNote:
         return std::nullopt;
     case ContextMenuItemTagShareMenu:
         return WebMenuItemTagShareMenu;

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebUIDelegatePrivate.h (278766 => 278767)


--- trunk/Source/WebKitLegacy/mac/WebView/WebUIDelegatePrivate.h	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebUIDelegatePrivate.h	2021-06-11 17:46:08 UTC (rev 278767)
@@ -107,8 +107,8 @@
     WebMenuItemTagToggleVideoFullscreen,
     WebMenuItemTagShareMenu,
     WebMenuItemTagToggleVideoEnhancedFullscreen,
-    WebMenuItemTagAddHighlightToCurrentGroup,
-    WebMenuItemTagAddHighlightToNewGroup,
+    WebMenuItemTagAddHighlightToCurrentQuickNote,
+    WebMenuItemTagAddHighlightToNewQuickNote,
     WebMenuItemTagRevealImage,
     WebMenuItemTagTranslate,
 };

Modified: trunk/Tools/ChangeLog (278766 => 278767)


--- trunk/Tools/ChangeLog	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Tools/ChangeLog	2021-06-11 17:46:08 UTC (rev 278767)
@@ -1,3 +1,13 @@
+2021-06-11  Megan Gardner  <megan_gard...@apple.com>
+
+        Rename AppHighlight group to QuickNote to correctly reflect feature.
+        https://bugs.webkit.org/show_bug.cgi?id=226888
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/WKContentViewEditingActions.mm:
+        (TEST):
+
 2021-06-11  Jonathan Bedard  <jbed...@apple.com>
 
         REGRESSION (r278454): [run-webkit-tests] worker is printed twice for each test in debug logging

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKContentViewEditingActions.mm (278766 => 278767)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKContentViewEditingActions.mm	2021-06-11 17:45:58 UTC (rev 278766)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKContentViewEditingActions.mm	2021-06-11 17:46:08 UTC (rev 278767)
@@ -85,18 +85,18 @@
     [webView stringByEvaluatingJavaScript:@"selectImageOverlay()"];
     [webView waitForNextPresentationUpdate];
 
-    auto createHighlightInCurrentGroupWithRangeSelector = NSSelectorFromString(@"createHighlightInCurrentGroupWithRange:");
-    auto createHighlightInNewGroupWithRangeSelector = NSSelectorFromString(@"createHighlightInNewGroupWithRange:");
+    auto createHighlightForCurrentQuickNoteWithRangeSelector = NSSelectorFromString(@"createHighlightForCurrentQuickNoteWithRange:");
+    auto createHighlightForNewQuickNoteWithRangeSelector = NSSelectorFromString(@"createHighlightForNewQuickNoteWithRange:");
 
     auto contentView = [webView textInputContentView];
-    EXPECT_NULL([contentView targetForAction:createHighlightInCurrentGroupWithRangeSelector withSender:nil]);
-    EXPECT_NULL([contentView targetForAction:createHighlightInNewGroupWithRangeSelector withSender:nil]);
+    EXPECT_NULL([contentView targetForAction:createHighlightForCurrentQuickNoteWithRangeSelector withSender:nil]);
+    EXPECT_NULL([contentView targetForAction:createHighlightForNewQuickNoteWithRangeSelector withSender:nil]);
 
     [webView synchronouslyLoadTestPageNamed:@"simple"];
     [webView selectAll:nil];
     [webView waitForNextPresentationUpdate];
-    EXPECT_EQ([contentView targetForAction:createHighlightInCurrentGroupWithRangeSelector withSender:nil], contentView);
-    EXPECT_EQ([contentView targetForAction:createHighlightInNewGroupWithRangeSelector withSender:nil], contentView);
+    EXPECT_EQ([contentView targetForAction:createHighlightForCurrentQuickNoteWithRangeSelector withSender:nil], contentView);
+    EXPECT_EQ([contentView targetForAction:createHighlightForNewQuickNoteWithRangeSelector withSender:nil], contentView);
 }
 
 #endif // ENABLE(IMAGE_ANALYSIS) && ENABLE(APP_HIGHLIGHTS)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to