Title: [289104] trunk/Source
Revision
289104
Author
rn...@webkit.org
Date
2022-02-03 22:37:14 -0800 (Thu, 03 Feb 2022)

Log Message

Delete SelectionAcrossShadowBoundariesEnabled
https://bugs.webkit.org/show_bug.cgi?id=235993

Reviewed by Darin Adler.

Source/WebCore:

Delete this runtime flag which has always been enabled for a while.

* editing/Editor.cpp:
(WebCore::Editor::selectedText const):
(WebCore::Editor::selectedTextForDataTransfer const):
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::selectionInHTMLFormat):
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::writeSelectionToPasteboard):
* editing/libwpe/EditorLibWPE.cpp:
(WebCore::Editor::writeSelectionToPasteboard):
* editing/mac/EditorMac.mm:
(WebCore::Editor::writeImageToPasteboard):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::createFromSelection):

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences keygenElementEnabled]):
(-[WebPreferences selectionAcrossShadowBoundariesEnabled]):
(-[WebPreferences setSelectionAcrossShadowBoundariesEnabled:]):
(-[WebPreferences isXSSAuditorEnabled]):
* WebView/WebPreferencesPrivate.h:

Source/WTF:

* Scripts/Preferences/WebPreferencesInternal.yaml:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (289103 => 289104)


--- trunk/Source/WTF/ChangeLog	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WTF/ChangeLog	2022-02-04 06:37:14 UTC (rev 289104)
@@ -1,3 +1,12 @@
+2022-02-03  Ryosuke Niwa  <rn...@webkit.org>
+
+        Delete SelectionAcrossShadowBoundariesEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=235993
+
+        Reviewed by Darin Adler.
+
+        * Scripts/Preferences/WebPreferencesInternal.yaml:
+
 2022-02-03  Robert Jenner  <jen...@apple.com>
 
         Unreviewed, reverting r288902.

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml (289103 => 289104)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2022-02-04 06:37:14 UTC (rev 289104)
@@ -760,18 +760,6 @@
     WebKit:
       default: true
 
-SelectionAcrossShadowBoundariesEnabled:
-  type: bool
-  humanReadableName: "Selection across shadow DOM"
-  humanReadableDescription: "Allow user-initiated selection across shadow DOM boundaries"
-  defaultValue:
-    WebKitLegacy:
-      default: true
-    WebKit:
-      default: true
-    WebCore:
-      default: true
-      
 SelectionFlippingEnabled:
   type: bool
   humanReadableName: "Selection Flipping"

Modified: trunk/Source/WebCore/ChangeLog (289103 => 289104)


--- trunk/Source/WebCore/ChangeLog	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WebCore/ChangeLog	2022-02-04 06:37:14 UTC (rev 289104)
@@ -1,3 +1,28 @@
+2022-02-03  Ryosuke Niwa  <rn...@webkit.org>
+
+        Delete SelectionAcrossShadowBoundariesEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=235993
+
+        Reviewed by Darin Adler.
+
+        Delete this runtime flag which has always been enabled for a while.
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::selectedText const):
+        (WebCore::Editor::selectedTextForDataTransfer const):
+        * editing/VisibleSelection.cpp:
+        (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries):
+        * editing/cocoa/EditorCocoa.mm:
+        (WebCore::Editor::selectionInHTMLFormat):
+        * editing/gtk/EditorGtk.cpp:
+        (WebCore::Editor::writeSelectionToPasteboard):
+        * editing/libwpe/EditorLibWPE.cpp:
+        (WebCore::Editor::writeSelectionToPasteboard):
+        * editing/mac/EditorMac.mm:
+        (WebCore::Editor::writeImageToPasteboard):
+        * loader/archive/cf/LegacyWebArchive.cpp:
+        (WebCore::LegacyWebArchive::createFromSelection):
+
 2022-02-03  Megan Gardner  <megan_gard...@apple.com>
 
         Add pen type for HitTestRequest.

Modified: trunk/Source/WebCore/editing/Editor.cpp (289103 => 289104)


--- trunk/Source/WebCore/editing/Editor.cpp	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WebCore/editing/Editor.cpp	2022-02-04 06:37:14 UTC (rev 289104)
@@ -3305,18 +3305,12 @@
 
 String Editor::selectedText() const
 {
-    TextIteratorBehaviors behaviors;
-    if (m_document.settings().selectionAcrossShadowBoundariesEnabled())
-        behaviors.add(TextIteratorBehavior::TraversesFlatTree);
-    return selectedText(behaviors);
+    return selectedText(TextIteratorBehavior::TraversesFlatTree);
 }
 
 String Editor::selectedTextForDataTransfer() const
 {
-    TextIteratorBehaviors behaviors { TextIteratorBehavior::EmitsImageAltText };
-    if (m_document.settings().selectionAcrossShadowBoundariesEnabled())
-        behaviors.add(TextIteratorBehavior::TraversesFlatTree);
-    return selectedText(behaviors);
+    return selectedText(OptionSet { TextIteratorBehavior::EmitsImageAltText, TextIteratorBehavior::TraversesFlatTree });
 }
 
 String Editor::selectedText(TextIteratorBehaviors behaviors) const

Modified: trunk/Source/WebCore/editing/VisibleSelection.cpp (289103 => 289104)


--- trunk/Source/WebCore/editing/VisibleSelection.cpp	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WebCore/editing/VisibleSelection.cpp	2022-02-04 06:37:14 UTC (rev 289104)
@@ -531,11 +531,9 @@
     if (&startNode->treeScope() == &endNode->treeScope())
         return;
 
-    if (startNode->document().settings().selectionAcrossShadowBoundariesEnabled()) {
-        if (!isInUserAgentShadowRootOrHasEditableShadowAncestor(startNode)
-            && !isInUserAgentShadowRootOrHasEditableShadowAncestor(endNode))
-            return;
-    }
+    if (!isInUserAgentShadowRootOrHasEditableShadowAncestor(startNode)
+        && !isInUserAgentShadowRootOrHasEditableShadowAncestor(endNode))
+        return;
 
     // Correct the focus if necessary.
     if (m_anchorIsFirst) {

Modified: trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm (289103 => 289104)


--- trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm	2022-02-04 06:37:14 UTC (rev 289104)
@@ -75,8 +75,7 @@
 
 String Editor::selectionInHTMLFormat()
 {
-    return serializePreservingVisualAppearance(m_document.selection().selection(), ResolveURLs::YesExcludingLocalFileURLsForPrivacy,
-        m_document.settings().selectionAcrossShadowBoundariesEnabled() ? SerializeComposedTree::Yes : SerializeComposedTree::No);
+    return serializePreservingVisualAppearance(m_document.selection().selection(), ResolveURLs::YesExcludingLocalFileURLsForPrivacy, SerializeComposedTree::Yes);
 }
 
 #if ENABLE(ATTACHMENT_ELEMENT)

Modified: trunk/Source/WebCore/editing/gtk/EditorGtk.cpp (289103 => 289104)


--- trunk/Source/WebCore/editing/gtk/EditorGtk.cpp	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WebCore/editing/gtk/EditorGtk.cpp	2022-02-04 06:37:14 UTC (rev 289104)
@@ -117,8 +117,7 @@
     PasteboardWebContent pasteboardContent;
     pasteboardContent.canSmartCopyOrDelete = canSmartCopyOrDelete();
     pasteboardContent.text = selectedTextForDataTransfer();
-    pasteboardContent.markup = serializePreservingVisualAppearance(m_document.selection().selection(), ResolveURLs::YesExcludingLocalFileURLsForPrivacy,
-        m_document.settings().selectionAcrossShadowBoundariesEnabled() ? SerializeComposedTree::Yes : SerializeComposedTree::No);
+    pasteboardContent.markup = serializePreservingVisualAppearance(m_document.selection().selection(), ResolveURLs::YesExcludingLocalFileURLsForPrivacy, SerializeComposedTree::Yes);
     pasteboardContent.contentOrigin = m_document.originIdentifierForPasteboard();
     pasteboard.write(pasteboardContent);
 }

Modified: trunk/Source/WebCore/editing/libwpe/EditorLibWPE.cpp (289103 => 289104)


--- trunk/Source/WebCore/editing/libwpe/EditorLibWPE.cpp	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WebCore/editing/libwpe/EditorLibWPE.cpp	2022-02-04 06:37:14 UTC (rev 289104)
@@ -65,8 +65,7 @@
 {
     PasteboardWebContent pasteboardContent;
     pasteboardContent.text = selectedTextForDataTransfer();
-    pasteboardContent.markup = serializePreservingVisualAppearance(m_document.selection().selection(), ResolveURLs::YesExcludingLocalFileURLsForPrivacy,
-        m_document.settings().selectionAcrossShadowBoundariesEnabled() ? SerializeComposedTree::Yes : SerializeComposedTree::No);
+    pasteboardContent.markup = serializePreservingVisualAppearance(m_document.selection().selection(), ResolveURLs::YesExcludingLocalFileURLsForPrivacy, SerializeComposedTree::Yes);
     pasteboard.write(pasteboardContent);
 }
 

Modified: trunk/Source/WebCore/editing/mac/EditorMac.mm (289103 => 289104)


--- trunk/Source/WebCore/editing/mac/EditorMac.mm	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm	2022-02-04 06:37:14 UTC (rev 289104)
@@ -338,10 +338,8 @@
     if (!pasteboard.isStatic())
         pasteboardImage.dataInWebArchiveFormat = imageInWebArchiveFormat(imageElement);
 
-    if (auto imageRange = makeRangeSelectingNode(imageElement)) {
-        auto serializeComposedTree = m_document.settings().selectionAcrossShadowBoundariesEnabled() ? SerializeComposedTree::Yes : SerializeComposedTree::No;
-        pasteboardImage.dataInHTMLFormat = serializePreservingVisualAppearance(VisibleSelection { *imageRange }, ResolveURLs::YesExcludingLocalFileURLsForPrivacy, serializeComposedTree);
-    }
+    if (auto imageRange = makeRangeSelectingNode(imageElement))
+        pasteboardImage.dataInHTMLFormat = serializePreservingVisualAppearance(VisibleSelection { *imageRange }, ResolveURLs::YesExcludingLocalFileURLsForPrivacy, SerializeComposedTree::Yes);
 
     pasteboardImage.url.url = ""
     pasteboardImage.url.title = title;

Modified: trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp (289103 => 289104)


--- trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp	2022-02-04 06:37:14 UTC (rev 289104)
@@ -596,8 +596,7 @@
     builder.append(documentTypeString(*document));
 
     Vector<Node*> nodeList;
-    auto serializeComposedTree = frame->settings().selectionAcrossShadowBoundariesEnabled() ? SerializeComposedTree::Yes : SerializeComposedTree::No;
-    builder.append(serializePreservingVisualAppearance(frame->selection().selection(), ResolveURLs::No, serializeComposedTree, &nodeList));
+    builder.append(serializePreservingVisualAppearance(frame->selection().selection(), ResolveURLs::No, SerializeComposedTree::Yes, &nodeList));
 
     auto archive = create(builder.toString(), *frame, nodeList, nullptr);
     if (!archive)

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (289103 => 289104)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2022-02-04 06:37:14 UTC (rev 289104)
@@ -1,3 +1,18 @@
+2022-02-03  Ryosuke Niwa  <rn...@webkit.org>
+
+        Delete SelectionAcrossShadowBoundariesEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=235993
+
+        Reviewed by Darin Adler.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (-[WebPreferences keygenElementEnabled]):
+        (-[WebPreferences selectionAcrossShadowBoundariesEnabled]):
+        (-[WebPreferences setSelectionAcrossShadowBoundariesEnabled:]):
+        (-[WebPreferences isXSSAuditorEnabled]):
+        * WebView/WebPreferencesPrivate.h:
+
 2022-02-03  Michael Saboff  <msab...@apple.com>
 
         WebKit projects have incorrect install name for the frameworks for Catalyst builds with the system content path

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h (289103 => 289104)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2022-02-04 06:37:14 UTC (rev 289104)
@@ -241,7 +241,6 @@
 #define WebKitInspectorAdditionsEnabledPreferenceKey @"WebKitInspectorAdditionsEnabled"
 #define WebKitAriaReflectionEnabledPreferenceKey @"WebKitAriaReflectionEnabled"
 #define WebKitMediaCapabilitiesEnabledPreferenceKey @"WebKitMediaCapabilitiesEnabled"
-#define WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey @"WebKitSelectionAcrossShadowBoundariesEnabled"
 #define WebKitCSSLogicalEnabledPreferenceKey @"WebKitCSSLogicalEnabled"
 #define WebKitLineHeightUnitsEnabledPreferenceKey @"WebKitLineHeightUnitsEnabled"
 #define WebKitDebugInAppBrowserPrivacyEnabledPreferenceKey @"WebKitDebugInAppBrowserPrivacyEnabled"

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (289103 => 289104)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2022-02-04 06:37:14 UTC (rev 289104)
@@ -2880,16 +2880,6 @@
     [self _setBoolValue:flag forKey:WebKitMediaCapabilitiesEnabledPreferenceKey];
 }
 
-- (BOOL)selectionAcrossShadowBoundariesEnabled
-{
-    return [self _boolValueForKey:WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey];
-}
-
-- (void)setSelectionAcrossShadowBoundariesEnabled:(BOOL)flag
-{
-    [self _setBoolValue:flag forKey:WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey];
-}
-
 - (BOOL)cssLogicalEnabled
 {
     return [self _boolValueForKey:WebKitCSSLogicalEnabledPreferenceKey];
@@ -3430,7 +3420,7 @@
 
 - (BOOL)keygenElementEnabled
 {
-    return false;
+    return NO;
 }
 
 - (void)setKeygenElementEnabled:(BOOL)flag
@@ -3477,9 +3467,18 @@
     return NO;
 }
 
+- (BOOL)selectionAcrossShadowBoundariesEnabled
+{
+    return YES;
+}
+
+- (void)setSelectionAcrossShadowBoundariesEnabled:(BOOL)flag
+{
+}
+
 - (BOOL)isXSSAuditorEnabled
 {
-    return FALSE;
+    return NO;
 }
 
 - (void)setXSSAuditorEnabled:(BOOL)flag

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h (289103 => 289104)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2022-02-04 06:35:43 UTC (rev 289103)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2022-02-04 06:37:14 UTC (rev 289104)
@@ -225,7 +225,6 @@
 @property (nonatomic) BOOL cacheAPIEnabled;
 @property (nonatomic) BOOL downloadAttributeEnabled;
 @property (nonatomic) BOOL directoryUploadEnabled;
-@property (nonatomic) BOOL selectionAcrossShadowBoundariesEnabled;
 @property (nonatomic, getter=cssLogicalEnabled) BOOL CSSLogicalEnabled;
 @property (nonatomic) BOOL lineHeightUnitsEnabled;
 @property (nonatomic) BOOL layoutFormattingContextIntegrationEnabled;
@@ -374,6 +373,7 @@
 @property (nonatomic, getter=isHixie76WebSocketProtocolEnabled) BOOL hixie76WebSocketProtocolEnabled;
 @property (nonatomic) BOOL accelerated2dCanvasEnabled;
 @property (nonatomic) BOOL experimentalNotificationsEnabled;
+@property (nonatomic) BOOL selectionAcrossShadowBoundariesEnabled;
 @property (nonatomic, getter=isXSSAuditorEnabled) BOOL XSSAuditorEnabled;
 
 - (void)setDiskImageCacheEnabled:(BOOL)enabled;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to