Title: [246444] trunk/Source
Revision
246444
Author
[email protected]
Date
2019-06-14 14:00:13 -0700 (Fri, 14 Jun 2019)

Log Message

Move Synthetic Editing Commands to behind an experimental feature flag
https://bugs.webkit.org/show_bug.cgi?id=198842
<rdar://problem/50594700>

Reviewed by Simon Fraser.

Source/WebCore:

Moving from a quirk to a feature flag.

* page/Quirks.cpp:
(WebCore::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost): Deleted.
(WebCore::Quirks::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas const): Deleted.
* page/Quirks.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setSyntheticEditingCommandsEnabled):
(WebCore::RuntimeEnabledFeatures::syntheticEditingCommandsEnabled const):

Source/WebKit:

Add a feature flag to gate synthetic editing commands.

* Shared/WebPreferences.yaml:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):

Source/WebKitLegacy/mac:

Add plumbing for synthetic editing command feature flag.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences syntheticEditingCommandsEnabled]):
(-[WebPreferences setSyntheticEditingCommandsEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (246443 => 246444)


--- trunk/Source/WebCore/ChangeLog	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebCore/ChangeLog	2019-06-14 21:00:13 UTC (rev 246444)
@@ -1,3 +1,21 @@
+2019-06-14  Megan Gardner  <[email protected]>
+
+        Move Synthetic Editing Commands to behind an experimental feature flag
+        https://bugs.webkit.org/show_bug.cgi?id=198842
+        <rdar://problem/50594700>
+
+        Reviewed by Simon Fraser.
+
+        Moving from a quirk to a feature flag.
+
+        * page/Quirks.cpp:
+        (WebCore::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost): Deleted.
+        (WebCore::Quirks::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas const): Deleted.
+        * page/Quirks.h:
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setSyntheticEditingCommandsEnabled):
+        (WebCore::RuntimeEnabledFeatures::syntheticEditingCommandsEnabled const):
+
 2019-06-14  Jer Noble  <[email protected]>
 
         REGRESSION(244439): platform/mac/media/encrypted-media/fps-* tests are crashing

Modified: trunk/Source/WebCore/page/Quirks.cpp (246443 => 246444)


--- trunk/Source/WebCore/page/Quirks.cpp	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebCore/page/Quirks.cpp	2019-06-14 21:00:13 UTC (rev 246444)
@@ -242,16 +242,6 @@
 #endif
 }
 
-static bool shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost(const StringView& host)
-{
-#if PLATFORM(IOS_FAMILY)
-    return equalLettersIgnoringASCIICase(host, "docs.google.com");
-#else
-    UNUSED_PARAM(host);
-    return false;
-#endif
-}
-
 bool Quirks::shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const
 {
     if (m_document->settings().shouldDispatchSyntheticMouseEventsWhenModifyingSelection())
@@ -270,14 +260,6 @@
     return false;
 }
 
-bool Quirks::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas() const
-{
-    if (!needsQuirks())
-        return false;
-
-    return shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost(m_document->topDocument().url().host());
-}
-
 bool Quirks::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas() const
 {
     if (!needsQuirks())

Modified: trunk/Source/WebCore/page/Quirks.h (246443 => 246444)


--- trunk/Source/WebCore/page/Quirks.h	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebCore/page/Quirks.h	2019-06-14 21:00:13 UTC (rev 246444)
@@ -58,7 +58,6 @@
 
     WEBCORE_EXPORT bool shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const;
     WEBCORE_EXPORT bool shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas() const;
-    WEBCORE_EXPORT bool shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas() const;
     WEBCORE_EXPORT bool isTouchBarUpdateSupressedForHiddenContentEditable() const;
     WEBCORE_EXPORT bool isNeverRichlyEditableForTouchBar() const;
 

Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (246443 => 246444)


--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2019-06-14 21:00:13 UTC (rev 246444)
@@ -183,6 +183,9 @@
 
     void setPointerEventsEnabled(bool isEnabled) { m_pointerEventsEnabled = isEnabled; }
     bool pointerEventsEnabled() const { return m_pointerEventsEnabled; }
+    
+    void setSyntheticEditingCommandsEnabled(bool isEnabled) { m_syntheticEditingCommandsEnabled = isEnabled; }
+    bool syntheticEditingCommandsEnabled() const { return m_syntheticEditingCommandsEnabled; }
 
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     void setLayoutFormattingContextEnabled(bool isEnabled) { m_layoutFormattingContextEnabled = isEnabled; }
@@ -416,6 +419,7 @@
     bool m_webAPIStatisticsEnabled { false };
     bool m_CSSCustomPropertiesAndValuesEnabled { false };
     bool m_pointerEventsEnabled { true };
+    bool m_syntheticEditingCommandsEnabled { true };
     bool m_webSQLEnabled { true };
     bool m_pageAtRuleSupportEnabled { false };
 

Modified: trunk/Source/WebCore/page/Settings.yaml (246443 => 246444)


--- trunk/Source/WebCore/page/Settings.yaml	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebCore/page/Settings.yaml	2019-06-14 21:00:13 UTC (rev 246444)
@@ -586,6 +586,9 @@
 visualViewportAPIEnabled:
   initial: false
 
+syntheticEditingCommandsEnabled:
+  initial: true
+
 CSSOMViewScrollingAPIEnabled:
   initial: false
 

Modified: trunk/Source/WebKit/ChangeLog (246443 => 246444)


--- trunk/Source/WebKit/ChangeLog	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebKit/ChangeLog	2019-06-14 21:00:13 UTC (rev 246444)
@@ -1,3 +1,17 @@
+2019-06-14  Megan Gardner  <[email protected]>
+
+        Move Synthetic Editing Commands to behind an experimental feature flag
+        https://bugs.webkit.org/show_bug.cgi?id=198842
+        <rdar://problem/50594700>
+
+        Reviewed by Simon Fraser.
+
+        Add a feature flag to gate synthetic editing commands.
+
+        * Shared/WebPreferences.yaml:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getFocusedElementInformation):
+
 2019-06-13  Megan Gardner  <[email protected]>
 
         Fix selection hang in Mail

Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (246443 => 246444)


--- trunk/Source/WebKit/Shared/WebPreferences.yaml	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml	2019-06-14 21:00:13 UTC (rev 246444)
@@ -1254,6 +1254,13 @@
   webcoreBinding: RuntimeEnabledFeatures
   category: experimental
 
+SyntheticEditingCommandsEnabled:
+  type: bool
+  defaultValue: true
+  humanReadableName: "Synthetic Editing Commands"
+  humanReadableDescription: "Enable Synthetic Editing Commands"
+  category: experimental
+
 CSSOMViewScrollingAPIEnabled:
   type: bool
   defaultValue: true

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp (246443 => 246444)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2019-06-14 21:00:13 UTC (rev 246444)
@@ -1980,6 +1980,16 @@
     return toImpl(preferencesRef)->ariaReflectionEnabled();
 }
 
+void WKPreferencesSetSyntheticEditingCommandsEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)->setSyntheticEditingCommandsEnabled(flag);
+}
+
+bool WKPreferencesGetSyntheticEditingCommandsEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->syntheticEditingCommandsEnabled();
+}
+
 void WKPreferencesSetCSSOMViewScrollingAPIEnabled(WKPreferencesRef preferencesRef, bool flag)
 {
     toImpl(preferencesRef)->setCSSOMViewScrollingAPIEnabled(flag);

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h (246443 => 246444)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h	2019-06-14 21:00:13 UTC (rev 246444)
@@ -559,6 +559,10 @@
 WK_EXPORT void WKPreferencesSetAriaReflectionEnabled(WKPreferencesRef, bool flag);
 WK_EXPORT bool WKPreferencesGetAriaReflectionEnabled(WKPreferencesRef);
 
+// Defaults to true.
+WK_EXPORT void WKPreferencesSetSyntheticEditingCommandsEnabled(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetSyntheticEditingCommandsEnabled(WKPreferencesRef);
+    
 // Defaults to false.
 WK_EXPORT void WKPreferencesSetCSSOMViewScrollingAPIEnabled(WKPreferencesRef, bool);
 WK_EXPORT bool WKPreferencesGetCSSOMViewScrollingAPIEnabled(WKPreferencesRef);

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (246443 => 246444)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-06-14 21:00:13 UTC (rev 246444)
@@ -2943,7 +2943,7 @@
             information.isAutocorrect = focusedElement.shouldAutocorrect();
             information.autocapitalizeType = focusedElement.autocapitalizeType();
             information.inputMode = focusedElement.canonicalInputMode();
-            information.shouldSynthesizeKeyEventsForEditing = focusedElement.document().quirks().shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas();
+            information.shouldSynthesizeKeyEventsForEditing = focusedElement.document().settings().syntheticEditingCommandsEnabled();
         } else {
             information.isAutocorrect = true;
             information.autocapitalizeType = AutocapitalizeTypeDefault;

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (246443 => 246444)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2019-06-14 21:00:13 UTC (rev 246444)
@@ -1,3 +1,22 @@
+2019-06-14  Megan Gardner  <[email protected]>
+
+        Move Synthetic Editing Commands to behind an experimental feature flag
+        https://bugs.webkit.org/show_bug.cgi?id=198842
+        <rdar://problem/50594700>
+
+        Reviewed by Simon Fraser.
+
+        Add plumbing for synthetic editing command feature flag.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences syntheticEditingCommandsEnabled]):
+        (-[WebPreferences setSyntheticEditingCommandsEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2019-06-13  Antoine Quint  <[email protected]>
 
         REGRESSION (r246103) [ Mojave+ WK1 ] Layout Test scrollbars/scrollbar-iframe-click-does-not-blur-content.html is timing out

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h (246443 => 246444)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2019-06-14 21:00:13 UTC (rev 246444)
@@ -54,6 +54,7 @@
 #define WebKitJavaScriptMarkupEnabledPreferenceKey @"WebKitJavaScriptMarkupEnabled"
 #define WebKitWebAnimationsEnabledPreferenceKey @"WebKitWebAnimationsEnabled"
 #define WebKitPointerEventsEnabledPreferenceKey @"WebKitPointerEventsEnabled"
+#define WebKitSyntheticEditingCommandsEnabledPreferenceKey @"WebKitSyntheticEditingCommandsEnabled"
 #define WebKitWebSecurityEnabledPreferenceKey @"WebKitWebSecurityEnabled"
 #define WebKitAllowUniversalAccessFromFileURLsPreferenceKey @"WebKitAllowUniversalAccessFromFileURLs"
 #define WebKitAllowFileAccessFromFileURLsPreferenceKey @"WebKitAllowFileAccessFromFileURLs"

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (246443 => 246444)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2019-06-14 21:00:13 UTC (rev 246444)
@@ -643,6 +643,7 @@
         [NSNumber numberWithBool:NO], WebKitDirectoryUploadEnabledPreferenceKey,
         [NSNumber numberWithBool:YES], WebKitWebAnimationsEnabledPreferenceKey,
         [NSNumber numberWithBool:YES], WebKitPointerEventsEnabledPreferenceKey,
+        [NSNumber numberWithBool:YES], WebKitSyntheticEditingCommandsEnabledPreferenceKey,
 
 #if PLATFORM(IOS_FAMILY)
         @NO, WebKitVisualViewportAPIEnabledPreferenceKey,
@@ -3156,6 +3157,16 @@
     [self _setBoolValue:flag forKey:WebKitPointerEventsEnabledPreferenceKey];
 }
 
+- (BOOL)syntheticEditingCommandsEnabled
+{
+    return [self _boolValueForKey:WebKitPointerEventsEnabledPreferenceKey];
+}
+
+- (void)setSyntheticEditingCommandsEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitPointerEventsEnabledPreferenceKey];
+}
+
 - (BOOL)fetchAPIKeepAliveEnabled
 {
     return [self _boolValueForKey:WebKitFetchAPIEnabledPreferenceKey];

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h (246443 => 246444)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2019-06-14 21:00:13 UTC (rev 246444)
@@ -573,6 +573,9 @@
 - (void)setPointerEventsEnabled:(BOOL)flag;
 - (BOOL)pointerEventsEnabled;
 
+- (void)setSyntheticEditingCommandsEnabled:(BOOL)flag;
+- (BOOL)syntheticEditingCommandsEnabled;
+
 - (void)setFetchAPIKeepAliveEnabled:(BOOL)flag;
 - (BOOL)fetchAPIKeepAliveEnabled;
 

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (246443 => 246444)


--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2019-06-14 20:55:52 UTC (rev 246443)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2019-06-14 21:00:13 UTC (rev 246444)
@@ -2981,6 +2981,7 @@
     settings.setJavaScriptCanOpenWindowsAutomatically([preferences _javascript_CanOpenWindowsAutomatically] || shouldAllowWindowOpenWithoutUserGesture());
 
     settings.setVisualViewportAPIEnabled([preferences visualViewportAPIEnabled]);
+    settings.setSyntheticEditingCommandsEnabled([preferences syntheticEditingCommandsEnabled]);
     settings.setCSSOMViewScrollingAPIEnabled([preferences CSSOMViewScrollingAPIEnabled]);
     settings.setMediaContentTypesRequiringHardwareSupport([preferences mediaContentTypesRequiringHardwareSupport]);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to