Title: [270974] trunk/Source
Revision
270974
Author
[email protected]
Date
2020-12-18 10:25:31 -0800 (Fri, 18 Dec 2020)

Log Message

Gate all of the code associated with app highlights
https://bugs.webkit.org/show_bug.cgi?id=220003
Source/WebCore:

<rdar://problem/72451893>

Reviewed by Tim Horton.

Only gating code, no new tests needed.

* Modules/highlight/AppHighlightListData.cpp:
* Modules/highlight/AppHighlightListData.h:
* Modules/highlight/AppHighlightStorage.cpp:
* Modules/highlight/AppHighlightStorage.h:
* Modules/highlight/HighlightRegister.cpp:
* Modules/highlight/HighlightRegister.h:
* dom/Document.cpp:
(WebCore::Document::commonTeardown):
(WebCore::Document::updateHighlightPositions):
* dom/Document.h:
* 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:
* rendering/RenderTheme.h:

Source/WebKit:

<rdar://problem/72451893>

Reviewed by Tim Horton.

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
(WebKit::toImpl):
* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultAppHighlightsEnabled):
* Shared/WebPreferencesDefaultValues.h:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::menuItemIdentifier):

Source/WebKitLegacy/mac:

<rdar://problem/72451893>

Reviewed by Tim Horton.

* WebView/WebHTMLView.mm:
(toTag):

Source/WTF:

Reviewed by Tim Horton.

* Scripts/Preferences/WebPreferencesInternal.yaml:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (270973 => 270974)


--- trunk/Source/WTF/ChangeLog	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WTF/ChangeLog	2020-12-18 18:25:31 UTC (rev 270974)
@@ -1,3 +1,12 @@
+2020-12-18  Megan Gardner  <[email protected]>
+
+        Gate all of the code associated with app highlights
+        https://bugs.webkit.org/show_bug.cgi?id=220003
+
+        Reviewed by Tim Horton.
+
+        * Scripts/Preferences/WebPreferencesInternal.yaml:
+
 2020-12-18  Chris Dumez  <[email protected]>
 
         [iOS] Stop leaking an XPC boost message to XPC services

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml (270973 => 270974)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2020-12-18 18:25:31 UTC (rev 270974)
@@ -54,7 +54,8 @@
 AppHighlightsEnabled:
   type: bool
   humanReadableName: "App Highlights"
-  humanReadableDescription: "Enable persistant highlights for apps"
+  humanReadableDescription: "Enable persistent highlights for apps"
+  condition: ENABLE(APP_HIGHLIGHTS)
   exposed: [ WebKit ]
   defaultValue:
     WebKitLegacy:

Modified: trunk/Source/WebCore/ChangeLog (270973 => 270974)


--- trunk/Source/WebCore/ChangeLog	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/ChangeLog	2020-12-18 18:25:31 UTC (rev 270974)
@@ -1,3 +1,34 @@
+2020-12-18  Megan Gardner  <[email protected]>
+
+        Gate all of the code associated with app highlights
+        https://bugs.webkit.org/show_bug.cgi?id=220003
+        <rdar://problem/72451893>
+
+        Reviewed by Tim Horton.
+
+        Only gating code, no new tests needed.
+
+        * Modules/highlight/AppHighlightListData.cpp:
+        * Modules/highlight/AppHighlightListData.h:
+        * Modules/highlight/AppHighlightStorage.cpp:
+        * Modules/highlight/AppHighlightStorage.h:
+        * Modules/highlight/HighlightRegister.cpp:
+        * Modules/highlight/HighlightRegister.h:
+        * dom/Document.cpp:
+        (WebCore::Document::commonTeardown):
+        (WebCore::Document::updateHighlightPositions):
+        * dom/Document.h:
+        * 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:
+        * rendering/RenderTheme.h:
+
 2020-12-18  Lauro Moura  <[email protected]>
 
         [WPE] Unreviewed buildfix after r270964

Modified: trunk/Source/WebCore/Modules/highlight/AppHighlightListData.cpp (270973 => 270974)


--- trunk/Source/WebCore/Modules/highlight/AppHighlightListData.cpp	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/Modules/highlight/AppHighlightListData.cpp	2020-12-18 18:25:31 UTC (rev 270974)
@@ -39,6 +39,8 @@
 
 namespace WebCore {
 
+#if ENABLE(APP_HIGHLIGHTS)
+
 AppHighlightListData AppHighlightListData::create(const SharedBuffer& buffer)
 {
     auto decoder = buffer.decoder();
@@ -54,4 +56,6 @@
     return SharedBuffer::create(encoder.buffer(), encoder.bufferSize());
 }
 
+#endif
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/Modules/highlight/AppHighlightListData.h (270973 => 270974)


--- trunk/Source/WebCore/Modules/highlight/AppHighlightListData.h	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/Modules/highlight/AppHighlightListData.h	2020-12-18 18:25:31 UTC (rev 270974)
@@ -32,6 +32,8 @@
 
 namespace WebCore {
 
+#if ENABLE(APP_HIGHLIGHTS)
+
 class SharedBuffer;
 
 class AppHighlightRangeData {
@@ -234,4 +236,6 @@
     return {{ WTFMove(*annotationRanges) }};
 }
 
+#endif
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.cpp (270973 => 270974)


--- trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.cpp	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.cpp	2020-12-18 18:25:31 UTC (rev 270974)
@@ -42,6 +42,8 @@
 
 namespace WebCore {
 
+#if ENABLE(APP_HIGHLIGHTS)
+
 static RefPtr<Node> findNodeByPathIndex(const Node& parent, unsigned pathIndex, const String& nodeName)
 {
     if (!is<ContainerNode>(parent))
@@ -248,4 +250,6 @@
     return unrestoredRanges;
 }
 
+#endif
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.h (270973 => 270974)


--- trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.h	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.h	2020-12-18 18:25:31 UTC (rev 270974)
@@ -34,6 +34,8 @@
 
 namespace WebCore {
 
+#if ENABLE(APP_HIGHLIGHTS)
+
 class AppHighlightListData;
 class AppHighlightRangeData;
 class Document;
@@ -51,4 +53,6 @@
     WeakPtr<Document> m_document;
 };
 
+#endif
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/Modules/highlight/HighlightRegister.cpp (270973 => 270974)


--- trunk/Source/WebCore/Modules/highlight/HighlightRegister.cpp	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/Modules/highlight/HighlightRegister.cpp	2020-12-18 18:25:31 UTC (rev 270974)
@@ -52,7 +52,7 @@
 {
     return m_map.remove(key);
 }
-
+#if ENABLE(APP_HIGHLIGHTS)
 ASCIILiteral HighlightRegister::appHighlightKey()
 {
     return "appHighlightKey"_s;
@@ -65,5 +65,5 @@
     else
         setFromMapLike(appHighlightKey(), Highlight::create(WTFMove(value)));
 }
-
+#endif
 }

Modified: trunk/Source/WebCore/Modules/highlight/HighlightRegister.h (270973 => 270974)


--- trunk/Source/WebCore/Modules/highlight/HighlightRegister.h	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/Modules/highlight/HighlightRegister.h	2020-12-18 18:25:31 UTC (rev 270974)
@@ -44,10 +44,10 @@
     void setFromMapLike(String&&, Ref<Highlight>&&);
     void clear();
     bool remove(const String&);
-
+#if ENABLE(APP_HIGHLIGHTS)
     WEBCORE_EXPORT void addAppHighlight(Ref<StaticRange>&&);
     static ASCIILiteral appHighlightKey();
-    
+#endif
     const HashMap<String, Ref<Highlight>>& map() const { return m_map; }
     
 private:

Modified: trunk/Source/WebCore/dom/Document.cpp (270973 => 270974)


--- trunk/Source/WebCore/dom/Document.cpp	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/dom/Document.cpp	2020-12-18 18:25:31 UTC (rev 270974)
@@ -29,8 +29,6 @@
 #include "Document.h"
 
 #include "AXObjectCache.h"
-#include "AppHighlightListData.h"
-#include "AppHighlightStorage.h"
 #include "Attr.h"
 #include "BeforeUnloadEvent.h"
 #include "CDATASection.h"
@@ -262,6 +260,11 @@
 #include <wtf/text/StringBuffer.h>
 #include <wtf/text/TextStream.h>
 
+#if ENABLE(APP_HIGHLIGHTS)
+#include "AppHighlightListData.h"
+#include "AppHighlightStorage.h"
+#endif
+
 #if ENABLE(DEVICE_ORIENTATION)
 #include "DeviceMotionEvent.h"
 #include "DeviceOrientationAndMotionAccessController.h"
@@ -796,10 +799,10 @@
     
     if (m_highlightRegister)
         m_highlightRegister->clear();
-
+#if ENABLE(APP_HIGHLIGHTS)
     if (m_appHighlightRegister)
         m_appHighlightRegister->clear();
-
+#endif
     m_pendingScrollEventTargetList = nullptr;
 
     if (m_timelinesController)
@@ -2780,7 +2783,7 @@
         m_highlightRegister = HighlightRegister::create();
     return *m_highlightRegister;
 }
-
+#if ENABLE(APP_HIGHLIGHTS)
 HighlightRegister& Document::appHighlightRegister()
 {
     if (!m_appHighlightRegister)
@@ -2794,7 +2797,7 @@
         m_appHighlightStorage = makeUnique<AppHighlightStorage>(*this);
     return *m_appHighlightStorage;
 }
-
+#endif
 void Document::collectRangeDataFromRegister(Vector<WeakPtr<HighlightRangeData>>& rangesData, const HighlightRegister& highlightRegister)
 {
     for (auto& highlight : highlightRegister.map()) {
@@ -2813,8 +2816,10 @@
     Vector<WeakPtr<HighlightRangeData>> rangesData;
     if (m_highlightRegister)
         collectRangeDataFromRegister(rangesData, *m_highlightRegister.get());
+#if ENABLE(APP_HIGHLIGHTS)
     if (m_appHighlightRegister)
         collectRangeDataFromRegister(rangesData, *m_appHighlightRegister.get());
+#endif
 
     for (auto& weakRangeData : rangesData) {
         if (auto* rangeData = weakRangeData.get()) {

Modified: trunk/Source/WebCore/dom/Document.h (270973 => 270974)


--- trunk/Source/WebCore/dom/Document.h	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/dom/Document.h	2020-12-18 18:25:31 UTC (rev 270974)
@@ -1579,12 +1579,14 @@
 
     HighlightRegister* highlightRegisterIfExists() { return m_highlightRegister.get(); }
     HighlightRegister& highlightRegister();
+        void updateHighlightPositions();
+#if ENABLE(APP_HIGHLIGHTS)
     HighlightRegister* appHighlightRegisterIfExists() { return m_appHighlightRegister.get(); }
     WEBCORE_EXPORT HighlightRegister& appHighlightRegister();
-    void updateHighlightPositions();
 
     AppHighlightStorage& appHighlightStorage();
     AppHighlightStorage* appHighlightStorageIfExists() const { return m_appHighlightStorage.get(); };
+#endif
 
     bool allowsContentJavaScript() const;
 
@@ -1943,9 +1945,10 @@
 #endif
         
     RefPtr<HighlightRegister> m_highlightRegister;
+#if ENABLE(APP_HIGHLIGHTS)
     RefPtr<HighlightRegister> m_appHighlightRegister;
-
     std::unique_ptr<AppHighlightStorage> m_appHighlightStorage;
+#endif
 
     Timer m_visualUpdatesSuppressionTimer;
 

Modified: trunk/Source/WebCore/page/ContextMenuController.cpp (270973 => 270974)


--- trunk/Source/WebCore/page/ContextMenuController.cpp	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/page/ContextMenuController.cpp	2020-12-18 18:25:31 UTC (rev 270974)
@@ -460,7 +460,7 @@
     case ContextMenuItemTagTextDirectionRightToLeft:
         frame->editor().command("MakeTextWritingDirectionRightToLeft").execute();
         break;
-#if PLATFORM(COCOA)
+#if ENABLE(APP_HIGHLIGHTS)
     case ContextMenuItemTagAddHighlightToCurrentGroup:
         // FIXME: Add Highlight Logic
         break;
@@ -467,6 +467,8 @@
     case ContextMenuItemTagAddHighlightToNewGroup:
         // FIXME: Add Highlight Logic
         break;
+#endif
+#if PLATFORM(COCOA)
     case ContextMenuItemTagSearchInSpotlight:
         m_client.searchWithSpotlight();
         break;
@@ -802,6 +804,8 @@
 #if PLATFORM(COCOA)
     ContextMenuItem SearchSpotlightItem(ActionType, ContextMenuItemTagSearchInSpotlight, 
         contextMenuItemTagSearchInSpotlight());
+#endif
+#if ENABLE(APP_HIGHLIGHTS)
     ContextMenuItem AddHighlightItem(ActionType, ContextMenuItemTagAddHighlightToCurrentGroup, contextMenuItemTagAddHighlightToCurrentGroup());
     ContextMenuItem AddHighlightToNewGroupItem(ActionType, ContextMenuItemTagAddHighlightToNewGroup, contextMenuItemTagAddHighlightToNewGroup());
 #endif
@@ -927,7 +931,8 @@
                 appendItem(CopyItem, m_contextMenu.get());
 #if PLATFORM(COCOA)
                 appendItem(*separatorItem(), m_contextMenu.get());
-                
+
+#if ENABLE(APP_HIGHLIGHTS)
                 if (auto* page = frame->page()) {
                     if (page->settings().appHighlightsEnabled()) {
                         appendItem(AddHighlightToNewGroupItem, m_contextMenu.get());
@@ -935,6 +940,7 @@
                         appendItem(*separatorItem(), m_contextMenu.get());
                     }
                 }
+#endif
 
                 appendItem(ShareMenuItem, m_contextMenu.get());
                 appendItem(*separatorItem(), m_contextMenu.get());
@@ -1291,7 +1297,7 @@
         case ContextMenuItemTagCheckSpellingWhileTyping:
             shouldCheck = frame->editor().isContinuousSpellCheckingEnabled();
             break;
-#if PLATFORM(COCOA)
+#if ENABLE(APP_HIGHLIGHTS)
         case ContextMenuItemTagAddHighlightToCurrentGroup:
             shouldEnable = frame->selection().isRange();
             break;
@@ -1298,6 +1304,8 @@
         case ContextMenuItemTagAddHighlightToNewGroup:
             shouldEnable = frame->selection().isRange();
             break;
+#endif
+#if PLATFORM(COCOA)
         case ContextMenuItemTagSubstitutionsMenu:
         case ContextMenuItemTagTransformationsMenu:
             break;

Modified: trunk/Source/WebCore/platform/ContextMenuItem.cpp (270973 => 270974)


--- trunk/Source/WebCore/platform/ContextMenuItem.cpp	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/platform/ContextMenuItem.cpp	2020-12-18 18:25:31 UTC (rev 270974)
@@ -215,9 +215,11 @@
     case ContextMenuAction::ContextMenuItemTagTextDirectionDefault:
     case ContextMenuAction::ContextMenuItemTagTextDirectionLeftToRight:
     case ContextMenuAction::ContextMenuItemTagTextDirectionRightToLeft:
-#if PLATFORM(COCOA)
+#if ENABLE(APP_HIGHLIGHTS)
     case ContextMenuAction::ContextMenuItemTagAddHighlightToCurrentGroup:
     case ContextMenuAction::ContextMenuItemTagAddHighlightToNewGroup:
+#endif
+#if PLATFORM(COCOA)
     case ContextMenuAction::ContextMenuItemTagCorrectSpellingAutomatically:
     case ContextMenuAction::ContextMenuItemTagSubstitutionsMenu:
     case ContextMenuAction::ContextMenuItemTagShowSubstitutions:

Modified: trunk/Source/WebCore/platform/ContextMenuItem.h (270973 => 270974)


--- trunk/Source/WebCore/platform/ContextMenuItem.h	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/platform/ContextMenuItem.h	2020-12-18 18:25:31 UTC (rev 270974)
@@ -118,9 +118,11 @@
     ContextMenuItemTagTextDirectionDefault,
     ContextMenuItemTagTextDirectionLeftToRight,
     ContextMenuItemTagTextDirectionRightToLeft,
-#if PLATFORM(COCOA)
+#if ENABLE(APP_HIGHLIGHTS)
     ContextMenuItemTagAddHighlightToCurrentGroup,
     ContextMenuItemTagAddHighlightToNewGroup,
+#endif
+#if PLATFORM(COCOA)
     ContextMenuItemTagCorrectSpellingAutomatically,
     ContextMenuItemTagSubstitutionsMenu,
     ContextMenuItemTagShowSubstitutions,

Modified: trunk/Source/WebCore/platform/LocalizedStrings.h (270973 => 270974)


--- trunk/Source/WebCore/platform/LocalizedStrings.h	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/platform/LocalizedStrings.h	2020-12-18 18:25:31 UTC (rev 270974)
@@ -49,6 +49,8 @@
 
 #if PLATFORM(COCOA)
     String copyImageUnknownFileLabel();
+#endif
+#if ENABLE(APP_HIGHLIGHTS)
     WEBCORE_EXPORT String contextMenuItemTagAddHighlightToCurrentGroup();
     WEBCORE_EXPORT String contextMenuItemTagAddHighlightToNewGroup();
 #endif

Modified: trunk/Source/WebCore/platform/cocoa/LocalizedStringsCocoa.mm (270973 => 270974)


--- trunk/Source/WebCore/platform/cocoa/LocalizedStringsCocoa.mm	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/platform/cocoa/LocalizedStringsCocoa.mm	2020-12-18 18:25:31 UTC (rev 270974)
@@ -57,7 +57,7 @@
 {
     return WEB_UI_STRING("unknown", "Unknown filename");
 }
-
+#if ENABLE(APP_HIGHLIGHTS)
 String contextMenuItemTagAddHighlightToCurrentGroup()
 {
     return localizedNSString(@"Add Highlight To Current Group");
@@ -67,6 +67,7 @@
 {
     return localizedNSString(@"Add Highlight To New Group");
 }
+#endif
 
 #if ENABLE(CONTEXT_MENUS)
 String contextMenuItemTagSearchInSpotlight()

Modified: trunk/Source/WebCore/rendering/RenderTheme.h (270973 => 270974)


--- trunk/Source/WebCore/rendering/RenderTheme.h	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebCore/rendering/RenderTheme.h	2020-12-18 18:25:31 UTC (rev 270974)
@@ -161,8 +161,10 @@
     // Highlighting color for search matches.
     Color textSearchHighlightColor(OptionSet<StyleColor::Options>) const;
 
+#if ENABLE(APP_HIGHLIGHTS)
     // Default highlighting color for app highlights.
     Color appHighlightColor(OptionSet<StyleColor::Options>) const;
+#endif
 
     Color datePlaceholderTextColor(const Color& textColor, const Color& backgroundColor) const;
 

Modified: trunk/Source/WebKit/ChangeLog (270973 => 270974)


--- trunk/Source/WebKit/ChangeLog	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebKit/ChangeLog	2020-12-18 18:25:31 UTC (rev 270974)
@@ -1,3 +1,20 @@
+2020-12-18  Megan Gardner  <[email protected]>
+
+        Gate all of the code associated with app highlights
+        https://bugs.webkit.org/show_bug.cgi?id=220003
+        <rdar://problem/72451893>
+
+        Reviewed by Tim Horton.
+
+        * Shared/API/c/WKSharedAPICast.h:
+        (WebKit::toAPI):
+        (WebKit::toImpl):
+        * Shared/WebPreferencesDefaultValues.cpp:
+        (WebKit::defaultAppHighlightsEnabled):
+        * Shared/WebPreferencesDefaultValues.h:
+        * UIProcess/mac/WebContextMenuProxyMac.mm:
+        (WebKit::menuItemIdentifier):
+
 2020-12-18  Chris Dumez  <[email protected]>
 
         [iOS] Stop leaking an XPC boost message to XPC services

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


--- trunk/Source/WebKit/Shared/API/c/WKSharedAPICast.h	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebKit/Shared/API/c/WKSharedAPICast.h	2020-12-18 18:25:31 UTC (rev 270974)
@@ -509,11 +509,13 @@
         return kWKContextMenuItemTagMediaPlayPause;
     case WebCore::ContextMenuItemTagMediaMute:
         return kWKContextMenuItemTagMediaMute;
-#if PLATFORM(COCOA)
+#if ENABLE(APP_HIGHLIGHTS)
     case WebCore::ContextMenuItemTagAddHighlightToCurrentGroup:
         return kWKContextMenuItemTagAddHighlightToCurrentGroup;
     case WebCore::ContextMenuItemTagAddHighlightToNewGroup:
         return kWKContextMenuItemTagAddHighlightToNewGroup;
+#endif
+#if PLATFORM(COCOA)
     case WebCore::ContextMenuItemTagCorrectSpellingAutomatically:
         return kWKContextMenuItemTagCorrectSpellingAutomatically;
     case WebCore::ContextMenuItemTagSubstitutionsMenu:
@@ -707,11 +709,13 @@
         return WebCore::ContextMenuItemTagMediaPlayPause;
     case kWKContextMenuItemTagMediaMute:
         return WebCore::ContextMenuItemTagMediaMute;
-#if PLATFORM(COCOA)
+#if ENABLE(APP_HIGHLIGHT)
     case kWKContextMenuItemTagAddHighlightToCurrentGroup:
         return WebCore::ContextMenuItemTagAddHighlightToCurrentGroup;
     case kWKContextMenuItemTagAddHighlightToNewGroup:
         return WebCore::ContextMenuItemTagAddHighlightToNewGroup;
+#endif
+#if PLATFORM(COCOA)
     case kWKContextMenuItemTagCorrectSpellingAutomatically:
         return WebCore::ContextMenuItemTagCorrectSpellingAutomatically;
     case kWKContextMenuItemTagSubstitutionsMenu:

Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp (270973 => 270974)


--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2020-12-18 18:25:31 UTC (rev 270974)
@@ -129,18 +129,15 @@
     return defaultAsyncFrameAndOverflowScrollingEnabled();
 }
 
+#if ENABLE(APP_HIGHLIGHTS)
 bool defaultAppHighlightsEnabled()
 {
 #if HAVE(SYSTEM_FEATURE_FLAGS)
     return isFeatureFlagEnabled("app_highlights");
 #endif
-
-#if ENABLE(APP_HIGHLIGHTS)
-    return true;
-#endif
-    
     return false;
 }
+#endif
 
 #if ENABLE(GPU_PROCESS)
 

Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h (270973 => 270974)


--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2020-12-18 18:25:31 UTC (rev 270974)
@@ -66,7 +66,10 @@
 
 bool defaultAsyncFrameScrollingEnabled();
 bool defaultAsyncOverflowScrollingEnabled();
+
+#if ENABLE(APP_HIGHLIGHTS)
 bool defaultAppHighlightsEnabled();
+#endif
 
 #if ENABLE(GPU_PROCESS)
 bool defaultUseGPUProcessForCanvasRenderingEnabled();

Modified: trunk/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm (270973 => 270974)


--- trunk/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm	2020-12-18 18:25:31 UTC (rev 270974)
@@ -417,13 +417,13 @@
 
     case ContextMenuItemTagLookUpInDictionary:
         return _WKMenuItemIdentifierLookUp;
-            
+#if ENABLE(APP_HIGHLIGHTS)
     case ContextMenuItemTagAddHighlightToCurrentGroup:
         return _WKMenuItemIdentifierAddHighlightToCurrentGroup;
         
     case ContextMenuItemTagAddHighlightToNewGroup:
         return _WKMenuItemIdentifierAddHighlightToNewGroup;
-
+#endif
     case ContextMenuItemTagOpenFrameInNewWindow:
         return _WKMenuItemIdentifierOpenFrameInNewWindow;
 

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (270973 => 270974)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-12-18 18:25:31 UTC (rev 270974)
@@ -1,3 +1,14 @@
+2020-12-18  Megan Gardner  <[email protected]>
+
+        Gate all of the code associated with app highlights
+        https://bugs.webkit.org/show_bug.cgi?id=220003
+        <rdar://problem/72451893>
+
+        Reviewed by Tim Horton.
+
+        * WebView/WebHTMLView.mm:
+        (toTag):
+
 2020-12-17  Rob Buis  <[email protected]>
 
         Make FontCascade::CodePath an enum class

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (270973 => 270974)


--- trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm	2020-12-18 18:23:34 UTC (rev 270973)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm	2020-12-18 18:25:31 UTC (rev 270974)
@@ -605,9 +605,11 @@
         return WebMenuItemTagDictationAlternative;
     case ContextMenuItemTagToggleVideoFullscreen:
         return WebMenuItemTagToggleVideoFullscreen;
+#if ENABLE(APP_HIGHLIGHTS)
     case ContextMenuItemTagAddHighlightToCurrentGroup:
     case ContextMenuItemTagAddHighlightToNewGroup:
         return WTF::nullopt;
+#endif
     case ContextMenuItemTagShareMenu:
         return WebMenuItemTagShareMenu;
     case ContextMenuItemTagToggleVideoEnhancedFullscreen:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to