Skip to content

Commit

Permalink
Remove SyntheticEditingCommandsEnabled preference
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265195

Reviewed by Timothy Hatcher.

This hasn't been needed for many years.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebKit/UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetSyntheticEditingCommandsEnabled):
(WKPreferencesGetSyntheticEditingCommandsEnabled):
* Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::focusedElementInformation):
* Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h:
* Source/WebKitLegacy/mac/WebView/WebPreferences.mm:
(-[WebPreferences syntheticEditingCommandsEnabled]):
(-[WebPreferences setSyntheticEditingCommandsEnabled:]):
* Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h:

Canonical link: https://commits.webkit.org/271044@main
  • Loading branch information
annevk committed Nov 22, 2023
1 parent 225be87 commit cb26fe2
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 40 deletions.
13 changes: 0 additions & 13 deletions Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6416,19 +6416,6 @@ SwitchControlEnabled:
WebCore:
default: false

SyntheticEditingCommandsEnabled:
type: bool
status: mature
humanReadableName: "Synthetic Editing Commands"
humanReadableDescription: "Enable Synthetic Editing Commands"
defaultValue:
WebKitLegacy:
default: true
WebKit:
default: true
WebCore:
default: true

# FIXME: There is no custom binding implemented for WebKitLegacy.
SystemLayoutDirection:
type: uint32_t
Expand Down
19 changes: 9 additions & 10 deletions Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1678,16 +1678,6 @@ void WKPreferencesSetAllowMediaContentTypesRequiringHardwareSupportAsFallback(WK
return toImpl(preferencesRef)->setAllowMediaContentTypesRequiringHardwareSupportAsFallback(allow);
}

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);
Expand Down Expand Up @@ -2086,6 +2076,15 @@ bool WKPreferencesGetMenuItemElementEnabled(WKPreferencesRef preferencesRef)
return false;
}

void WKPreferencesSetSyntheticEditingCommandsEnabled(WKPreferencesRef preferencesRef, bool flag)
{
}

bool WKPreferencesGetSyntheticEditingCommandsEnabled(WKPreferencesRef preferencesRef)
{
return true;
}

void WKPreferencesSetReferrerPolicyAttributeEnabled(WKPreferencesRef preferencesRef, bool flag)
{
}
Expand Down
6 changes: 2 additions & 4 deletions Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,6 @@ WK_EXPORT bool WKPreferencesGetMediaUserGestureInheritsFromDocument(WKPreference
// Defaults to an empty string
WK_EXPORT void WKPreferencesSetMediaContentTypesRequiringHardwareSupport(WKPreferencesRef, WKStringRef);
WK_EXPORT WKStringRef WKPreferencesCopyMediaContentTypesRequiringHardwareSupport(WKPreferencesRef);

// Defaults to true.
WK_EXPORT void WKPreferencesSetSyntheticEditingCommandsEnabled(WKPreferencesRef, bool);
WK_EXPORT bool WKPreferencesGetSyntheticEditingCommandsEnabled(WKPreferencesRef);

// Defaults to false.
WK_EXPORT void WKPreferencesSetCSSOMViewScrollingAPIEnabled(WKPreferencesRef, bool);
Expand Down Expand Up @@ -539,6 +535,8 @@ WK_EXPORT void WKPreferencesSetPaginateDuringLayoutEnabled(WKPreferencesRef, boo
WK_EXPORT bool WKPreferencesGetPaginateDuringLayoutEnabled(WKPreferencesRef) WK_C_API_DEPRECATED;
WK_EXPORT void WKPreferencesSetMenuItemElementEnabled(WKPreferencesRef, bool flag) WK_C_API_DEPRECATED;
WK_EXPORT bool WKPreferencesGetMenuItemElementEnabled(WKPreferencesRef) WK_C_API_DEPRECATED;
WK_EXPORT void WKPreferencesSetSyntheticEditingCommandsEnabled(WKPreferencesRef, bool) WK_C_API_DEPRECATED;
WK_EXPORT bool WKPreferencesGetSyntheticEditingCommandsEnabled(WKPreferencesRef) WK_C_API_DEPRECATED;
WK_EXPORT void WKPreferencesSetReferrerPolicyAttributeEnabled(WKPreferencesRef, bool flag) WK_C_API_DEPRECATED;
WK_EXPORT bool WKPreferencesGetReferrerPolicyAttributeEnabled(WKPreferencesRef) WK_C_API_DEPRECATED;

Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3727,7 +3727,7 @@ static void handleAnimationActions(Element& element, uint32_t action)
information.autocapitalizeType = focusedHTMLElement.autocapitalizeType();
information.inputMode = focusedHTMLElement.canonicalInputMode();
information.enterKeyHint = focusedHTMLElement.canonicalEnterKeyHint();
information.shouldSynthesizeKeyEventsForEditing = focusedHTMLElement.document().settings().syntheticEditingCommandsEnabled();
information.shouldSynthesizeKeyEventsForEditing = true;
} else {
information.isAutocorrect = true;
information.autocapitalizeType = WebCore::AutocapitalizeType::Default;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@
#define WebKitHighlightAPIEnabledPreferenceKey @"WebKitHighlightAPIEnabled"
#define WebKitAsyncClipboardAPIEnabledPreferenceKey @"WebKitAsyncClipboardAPIEnabled"
#define WebKitVisualViewportAPIEnabledPreferenceKey @"WebKitVisualViewportAPIEnabled"
#define WebKitSyntheticEditingCommandsEnabledPreferenceKey @"WebKitSyntheticEditingCommandsEnabled"
#define WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey @"WebKitCSSOMViewSmoothScrollingEnabled"
#define WebKitWebAnimationsCompositeOperationsEnabledPreferenceKey @"WebKitWebAnimationsCompositeOperationsEnabled"
#define WebKitWebAnimationsMutableTimelinesEnabledPreferenceKey @"WebKitWebAnimationsMutableTimelinesEnabled"
Expand Down Expand Up @@ -277,3 +276,4 @@
#define WebKitDisplayListDrawingEnabledPreferenceKey @"WebKitDisplayListDrawingEnabled"
#define WebKitTransformStreamAPIEnabledPreferenceKey @"WebKitTransformStreamAPIEnabled"
#define WebKitIntersectionObserverEnabledPreferenceKey @"WebKitIntersectionObserverEnabled"
#define WebKitSyntheticEditingCommandsEnabledPreferenceKey @"WebKitSyntheticEditingCommandsEnabled"
19 changes: 9 additions & 10 deletions Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2926,16 +2926,6 @@ - (void)setVisualViewportAPIEnabled:(BOOL)flag
[self _setBoolValue:flag forKey:WebKitVisualViewportAPIEnabledPreferenceKey];
}

- (BOOL)syntheticEditingCommandsEnabled
{
return [self _boolValueForKey:WebKitSyntheticEditingCommandsEnabledPreferenceKey];
}

- (void)setSyntheticEditingCommandsEnabled:(BOOL)flag
{
[self _setBoolValue:flag forKey:WebKitSyntheticEditingCommandsEnabledPreferenceKey];
}

- (BOOL)CSSOMViewSmoothScrollingEnabled
{
return [self _boolValueForKey:WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey];
Expand Down Expand Up @@ -3113,6 +3103,15 @@ @implementation WebPreferences (WebPrivateDeprecated)
// The preferences in this category are deprecated and have no effect. They should
// be removed when it is considered safe to do so.

- (BOOL)syntheticEditingCommandsEnabled
{
return YES;
}

- (void)setSyntheticEditingCommandsEnabled:(BOOL)flag
{
}

- (BOOL)aspectRatioOfImgFromWidthAndHeightEnabled
{
return YES;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
@property (nonatomic) BOOL highlightAPIEnabled;
@property (nonatomic) BOOL asyncClipboardAPIEnabled;
@property (nonatomic) BOOL visualViewportAPIEnabled;
@property (nonatomic) BOOL syntheticEditingCommandsEnabled;
@property (nonatomic) BOOL CSSOMViewSmoothScrollingEnabled;
@property (nonatomic) BOOL webAnimationsCompositeOperationsEnabled;
@property (nonatomic) BOOL webAnimationsMutableTimelinesEnabled;
Expand All @@ -331,6 +330,7 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
// The preferences in this category are deprecated and have no effect. They should
// be removed when it is considered safe to do so.

@property (nonatomic) BOOL syntheticEditingCommandsEnabled;
@property (nonatomic) BOOL aspectRatioOfImgFromWidthAndHeightEnabled;
@property (nonatomic) BOOL resizeObserverEnabled;
@property (nonatomic) BOOL subpixelCSSOMElementMetricsEnabled;
Expand Down

0 comments on commit cb26fe2

Please sign in to comment.