Changeset 246444 in webkit


Ignore:
Timestamp:
Jun 14, 2019 2:00:13 PM (5 years ago)
Author:
Megan Gardner
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:]):

Location:
trunk/Source
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r246441 r246444  
     12019-06-14  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Move Synthetic Editing Commands to behind an experimental feature flag
     4        https://bugs.webkit.org/show_bug.cgi?id=198842
     5        <rdar://problem/50594700>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Moving from a quirk to a feature flag.
     10
     11        * page/Quirks.cpp:
     12        (WebCore::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost): Deleted.
     13        (WebCore::Quirks::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas const): Deleted.
     14        * page/Quirks.h:
     15        * page/RuntimeEnabledFeatures.h:
     16        (WebCore::RuntimeEnabledFeatures::setSyntheticEditingCommandsEnabled):
     17        (WebCore::RuntimeEnabledFeatures::syntheticEditingCommandsEnabled const):
     18
    1192019-06-14  Jer Noble  <jer.noble@apple.com>
    220
  • trunk/Source/WebCore/page/Quirks.cpp

    r246319 r246444  
    243243}
    244244
    245 static bool shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost(const StringView& host)
    246 {
    247 #if PLATFORM(IOS_FAMILY)
    248     return equalLettersIgnoringASCIICase(host, "docs.google.com");
    249 #else
    250     UNUSED_PARAM(host);
    251     return false;
    252 #endif
    253 }
    254 
    255245bool Quirks::shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const
    256246{
     
    269259
    270260    return false;
    271 }
    272 
    273 bool Quirks::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas() const
    274 {
    275     if (!needsQuirks())
    276         return false;
    277 
    278     return shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost(m_document->topDocument().url().host());
    279261}
    280262
  • trunk/Source/WebCore/page/Quirks.h

    r246226 r246444  
    5959    WEBCORE_EXPORT bool shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const;
    6060    WEBCORE_EXPORT bool shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas() const;
    61     WEBCORE_EXPORT bool shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas() const;
    6261    WEBCORE_EXPORT bool isTouchBarUpdateSupressedForHiddenContentEditable() const;
    6362    WEBCORE_EXPORT bool isNeverRichlyEditableForTouchBar() const;
  • trunk/Source/WebCore/page/RuntimeEnabledFeatures.h

    r246388 r246444  
    184184    void setPointerEventsEnabled(bool isEnabled) { m_pointerEventsEnabled = isEnabled; }
    185185    bool pointerEventsEnabled() const { return m_pointerEventsEnabled; }
     186   
     187    void setSyntheticEditingCommandsEnabled(bool isEnabled) { m_syntheticEditingCommandsEnabled = isEnabled; }
     188    bool syntheticEditingCommandsEnabled() const { return m_syntheticEditingCommandsEnabled; }
    186189
    187190#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     
    417420    bool m_CSSCustomPropertiesAndValuesEnabled { false };
    418421    bool m_pointerEventsEnabled { true };
     422    bool m_syntheticEditingCommandsEnabled { true };
    419423    bool m_webSQLEnabled { true };
    420424    bool m_pageAtRuleSupportEnabled { false };
  • trunk/Source/WebCore/page/Settings.yaml

    r246285 r246444  
    587587  initial: false
    588588
     589syntheticEditingCommandsEnabled:
     590  initial: true
     591
    589592CSSOMViewScrollingAPIEnabled:
    590593  initial: false
  • trunk/Source/WebKit/ChangeLog

    r246425 r246444  
     12019-06-14  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Move Synthetic Editing Commands to behind an experimental feature flag
     4        https://bugs.webkit.org/show_bug.cgi?id=198842
     5        <rdar://problem/50594700>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Add a feature flag to gate synthetic editing commands.
     10
     11        * Shared/WebPreferences.yaml:
     12        * WebProcess/WebPage/ios/WebPageIOS.mm:
     13        (WebKit::WebPage::getFocusedElementInformation):
     14
    1152019-06-13  Megan Gardner  <megan_gardner@apple.com>
    216
  • trunk/Source/WebKit/Shared/WebPreferences.yaml

    r246388 r246444  
    12551255  category: experimental
    12561256
     1257SyntheticEditingCommandsEnabled:
     1258  type: bool
     1259  defaultValue: true
     1260  humanReadableName: "Synthetic Editing Commands"
     1261  humanReadableDescription: "Enable Synthetic Editing Commands"
     1262  category: experimental
     1263
    12571264CSSOMViewScrollingAPIEnabled:
    12581265  type: bool
  • trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp

    r242738 r246444  
    19811981}
    19821982
     1983void WKPreferencesSetSyntheticEditingCommandsEnabled(WKPreferencesRef preferencesRef, bool flag)
     1984{
     1985    toImpl(preferencesRef)->setSyntheticEditingCommandsEnabled(flag);
     1986}
     1987
     1988bool WKPreferencesGetSyntheticEditingCommandsEnabled(WKPreferencesRef preferencesRef)
     1989{
     1990    return toImpl(preferencesRef)->syntheticEditingCommandsEnabled();
     1991}
     1992
    19831993void WKPreferencesSetCSSOMViewScrollingAPIEnabled(WKPreferencesRef preferencesRef, bool flag)
    19841994{
  • trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h

    r242621 r246444  
    560560WK_EXPORT bool WKPreferencesGetAriaReflectionEnabled(WKPreferencesRef);
    561561
     562// Defaults to true.
     563WK_EXPORT void WKPreferencesSetSyntheticEditingCommandsEnabled(WKPreferencesRef, bool);
     564WK_EXPORT bool WKPreferencesGetSyntheticEditingCommandsEnabled(WKPreferencesRef);
     565   
    562566// Defaults to false.
    563567WK_EXPORT void WKPreferencesSetCSSOMViewScrollingAPIEnabled(WKPreferencesRef, bool);
  • trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

    r246404 r246444  
    29442944            information.autocapitalizeType = focusedElement.autocapitalizeType();
    29452945            information.inputMode = focusedElement.canonicalInputMode();
    2946             information.shouldSynthesizeKeyEventsForEditing = focusedElement.document().quirks().shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas();
     2946            information.shouldSynthesizeKeyEventsForEditing = focusedElement.document().settings().syntheticEditingCommandsEnabled();
    29472947        } else {
    29482948            information.isAutocorrect = true;
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r246429 r246444  
     12019-06-14  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Move Synthetic Editing Commands to behind an experimental feature flag
     4        https://bugs.webkit.org/show_bug.cgi?id=198842
     5        <rdar://problem/50594700>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Add plumbing for synthetic editing command feature flag.
     10
     11        * WebView/WebPreferenceKeysPrivate.h:
     12        * WebView/WebPreferences.mm:
     13        (+[WebPreferences initialize]):
     14        (-[WebPreferences syntheticEditingCommandsEnabled]):
     15        (-[WebPreferences setSyntheticEditingCommandsEnabled:]):
     16        * WebView/WebPreferencesPrivate.h:
     17        * WebView/WebView.mm:
     18        (-[WebView _preferencesChanged:]):
     19
    1202019-06-13  Antoine Quint  <graouts@apple.com>
    221
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h

    r246045 r246444  
    5555#define WebKitWebAnimationsEnabledPreferenceKey @"WebKitWebAnimationsEnabled"
    5656#define WebKitPointerEventsEnabledPreferenceKey @"WebKitPointerEventsEnabled"
     57#define WebKitSyntheticEditingCommandsEnabledPreferenceKey @"WebKitSyntheticEditingCommandsEnabled"
    5758#define WebKitWebSecurityEnabledPreferenceKey @"WebKitWebSecurityEnabled"
    5859#define WebKitAllowUniversalAccessFromFileURLsPreferenceKey @"WebKitAllowUniversalAccessFromFileURLs"
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm

    r246285 r246444  
    644644        [NSNumber numberWithBool:YES], WebKitWebAnimationsEnabledPreferenceKey,
    645645        [NSNumber numberWithBool:YES], WebKitPointerEventsEnabledPreferenceKey,
     646        [NSNumber numberWithBool:YES], WebKitSyntheticEditingCommandsEnabledPreferenceKey,
    646647
    647648#if PLATFORM(IOS_FAMILY)
     
    31573158}
    31583159
     3160- (BOOL)syntheticEditingCommandsEnabled
     3161{
     3162    return [self _boolValueForKey:WebKitPointerEventsEnabledPreferenceKey];
     3163}
     3164
     3165- (void)setSyntheticEditingCommandsEnabled:(BOOL)flag
     3166{
     3167    [self _setBoolValue:flag forKey:WebKitPointerEventsEnabledPreferenceKey];
     3168}
     3169
    31593170- (BOOL)fetchAPIKeepAliveEnabled
    31603171{
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h

    r246045 r246444  
    573573- (void)setPointerEventsEnabled:(BOOL)flag;
    574574- (BOOL)pointerEventsEnabled;
     575
     576- (void)setSyntheticEditingCommandsEnabled:(BOOL)flag;
     577- (BOOL)syntheticEditingCommandsEnabled;
    575578
    576579- (void)setFetchAPIKeepAliveEnabled:(BOOL)flag;
  • trunk/Source/WebKitLegacy/mac/WebView/WebView.mm

    r246285 r246444  
    29822982
    29832983    settings.setVisualViewportAPIEnabled([preferences visualViewportAPIEnabled]);
     2984    settings.setSyntheticEditingCommandsEnabled([preferences syntheticEditingCommandsEnabled]);
    29842985    settings.setCSSOMViewScrollingAPIEnabled([preferences CSSOMViewScrollingAPIEnabled]);
    29852986    settings.setMediaContentTypesRequiringHardwareSupport([preferences mediaContentTypesRequiringHardwareSupport]);
Note: See TracChangeset for help on using the changeset viewer.