Skip to content

Commit

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

Reviewed by Tim Nguyen.

The behavior has been consistent for a little over a decade. Time to
remove the old code paths.

* LayoutTests/fast/backgrounds/background-shorthand-after-set-backgroundSize-expected.txt: Removed.
* LayoutTests/fast/backgrounds/background-shorthand-after-set-backgroundSize.html: Removed.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/css/parser/CSSParserContext.cpp:
(WebCore::add):
* Source/WebCore/css/parser/CSSParserContext.h:
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeBackgroundShorthand):
* Source/WebKitLegacy/mac/Misc/WebKitVersionChecks.h:
* Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h:
* Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm:
(WebKit::defaultUseLegacyBackgroundSizeShorthandBehavior): Deleted.

Canonical link: https://commits.webkit.org/276298@main
  • Loading branch information
annevk committed Mar 18, 2024
1 parent cf61984 commit 1e70a1e
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 87 deletions.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6971,17 +6971,6 @@ UseImageDocumentForSubframePDF:
PLATFORM(IOS_FAMILY): true
default: false

UseLegacyBackgroundSizeShorthandBehavior:
type: bool
status: embedder
defaultValue:
WebKitLegacy:
default: WebKit::defaultUseLegacyBackgroundSizeShorthandBehavior()
WebKit:
default: false
WebCore:
default: false

UsePreHTML5ParserQuirks:
type: bool
status: embedder
Expand Down
42 changes: 20 additions & 22 deletions Source/WebCore/css/parser/CSSParserContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ CSSParserContext::CSSParserContext(const Document& document, const URL& sheetBas
#if ENABLE(CSS_TRANSFORM_STYLE_OPTIMIZED_3D)
, transformStyleOptimized3DEnabled { document.settings().cssTransformStyleOptimized3DEnabled() }
#endif
, useLegacyBackgroundSizeShorthandBehavior { document.settings().useLegacyBackgroundSizeShorthandBehavior() }
, focusVisibleEnabled { document.settings().focusVisibleEnabled() }
, cascadeLayersEnabled { document.settings().cssCascadeLayersEnabled() }
, gradientPremultipliedAlphaInterpolationEnabled { document.settings().cssGradientPremultipliedAlphaInterpolationEnabled() }
Expand Down Expand Up @@ -136,29 +135,28 @@ void add(Hasher& hasher, const CSSParserContext& context)
#if ENABLE(CSS_TRANSFORM_STYLE_OPTIMIZED_3D)
| context.transformStyleOptimized3DEnabled << 9
#endif
| context.useLegacyBackgroundSizeShorthandBehavior << 10
| context.focusVisibleEnabled << 11
| context.cascadeLayersEnabled << 12
| context.gradientPremultipliedAlphaInterpolationEnabled << 13
| context.gradientInterpolationColorSpacesEnabled << 14
| context.masonryEnabled << 15
| context.cssNestingEnabled << 16
| context.cssPaintingAPIEnabled << 17
| context.cssScopeAtRuleEnabled << 18
| context.cssTextUnderlinePositionLeftRightEnabled << 19
| context.cssWordBreakAutoPhraseEnabled << 20
| context.popoverAttributeEnabled << 21
| context.sidewaysWritingModesEnabled << 22
| context.cssTextWrapPrettyEnabled << 23
| context.highlightAPIEnabled << 24
| context.grammarAndSpellingPseudoElementsEnabled << 25
| context.customStateSetEnabled << 26
| context.thumbAndTrackPseudoElementsEnabled << 27
| context.focusVisibleEnabled << 10
| context.cascadeLayersEnabled << 11
| context.gradientPremultipliedAlphaInterpolationEnabled << 12
| context.gradientInterpolationColorSpacesEnabled << 13
| context.masonryEnabled << 14
| context.cssNestingEnabled << 15
| context.cssPaintingAPIEnabled << 16
| context.cssScopeAtRuleEnabled << 17
| context.cssTextUnderlinePositionLeftRightEnabled << 18
| context.cssWordBreakAutoPhraseEnabled << 19
| context.popoverAttributeEnabled << 20
| context.sidewaysWritingModesEnabled << 21
| context.cssTextWrapPrettyEnabled << 22
| context.highlightAPIEnabled << 23
| context.grammarAndSpellingPseudoElementsEnabled << 24
| context.customStateSetEnabled << 25
| context.thumbAndTrackPseudoElementsEnabled << 26
#if ENABLE(SERVICE_CONTROLS)
| context.imageControlsEnabled << 28
| context.imageControlsEnabled << 27
#endif
| context.lightDarkEnabled << 29
| (uint64_t)context.mode << 30; // This is multiple bits, so keep it last.
| context.lightDarkEnabled << 28
| (uint64_t)context.mode << 29; // This is multiple bits, so keep it last.
add(hasher, context.baseURL, context.charset, context.propertySettings, bits);
}

Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/css/parser/CSSParserContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ struct CSSParserContext {
#if ENABLE(CSS_TRANSFORM_STYLE_OPTIMIZED_3D)
bool transformStyleOptimized3DEnabled : 1 { false };
#endif
bool useLegacyBackgroundSizeShorthandBehavior : 1 { false };
bool focusVisibleEnabled : 1 { false };
bool cascadeLayersEnabled : 1 { false };
bool gradientPremultipliedAlphaInterpolationEnabled : 1 { false };
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/css/parser/CSSPropertyParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1955,8 +1955,6 @@ bool CSSPropertyParser::consumeBackgroundShorthand(const StylePropertyShorthand&

for (size_t i = 0; i < longhandCount; ++i) {
CSSPropertyID property = shorthand.properties()[i];
if (property == CSSPropertyBackgroundSize && !longhands[i].isEmpty() && m_context.useLegacyBackgroundSizeShorthandBehavior)
continue;
if (longhands[i].size() == 1)
addProperty(property, shorthand.id(), WTFMove(longhands[i][0]), important);
else
Expand Down
2 changes: 0 additions & 2 deletions Source/WebKitLegacy/mac/Misc/WebKitVersionChecks.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@
#define WEBKIT_FIRST_VERSION_WITHOUT_CONTENT_SNIFFING_FOR_FILE_URLS 0x02120A00 // 530.10.0
#define WEBKIT_FIRST_VERSION_WITHOUT_LINK_ELEMENT_TEXT_CSS_QUIRK 0x02130200 // 531.2.0
#define WEBKIT_FIRST_VERSION_WITH_CSS_ATTRIBUTE_SETTERS_IGNORING_PRIORITY 0x02170D00 // 535.13.0
#define WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR 0x02190100 // 537.1.0
#define WEBKIT_FIRST_VERSION_WITH_INSECURE_CONTENT_BLOCKING 0x02590116 // 601.1.22
#define WEBKIT_FIRST_VERSION_WITH_DEFAULT_ICON_LOADING 0x025C0126 // 604.1.38

#else
// <rdar://problem/6627758> Need to implement WebKitLinkedOnOrAfter
// Actually UIKit version numbers, since applications don't link against WebKit
#define WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR 2665 // iOS 7.0
#define WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES 2665 // iOS 7.0
#define WEBKIT_FIRST_VERSION_WITH_INSECURE_CONTENT_BLOCKING 3454
#define WEBKIT_FIRST_VERSION_WITH_CONTENT_SECURITY_POLICY_SOURCE_STAR_PROTOCOL_RESTRICTION 3555
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ bool defaultNeedsKeyboardEventDisambiguationQuirks();

bool defaultAttachmentElementEnabled();
bool defaultShouldRestrictBaseURLSchemes();
bool defaultUseLegacyBackgroundSizeShorthandBehavior();
bool defaultAllowDisplayOfInsecureContent();
bool defaultAllowRunningOfInsecureContent();
bool defaultShouldConvertInvalidURLsToBlank();
Expand Down
11 changes: 0 additions & 11 deletions Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,6 @@ bool defaultShouldRestrictBaseURLSchemes()
return shouldRestrictBaseURLSchemes;
}

bool defaultUseLegacyBackgroundSizeShorthandBehavior()
{
#if PLATFORM(IOS_FAMILY)
static bool shouldUseLegacyBackgroundSizeShorthandBehavior = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR);
#else
static bool shouldUseLegacyBackgroundSizeShorthandBehavior = WebCore::MacApplication::isVersions()
&& !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR);
#endif
return shouldUseLegacyBackgroundSizeShorthandBehavior;
}

bool defaultAllowDisplayOfInsecureContent()
{
static bool shouldAllowDisplayOfInsecureContent = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_INSECURE_CONTENT_BLOCKING);
Expand Down

0 comments on commit 1e70a1e

Please sign in to comment.