WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-224718-20210418011417.patch (text/plain), 57.69 KB, created by
Tyler Wilcock
on 2021-04-17 23:14:18 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tyler Wilcock
Created:
2021-04-17 23:14:18 PDT
Size:
57.69 KB
patch
obsolete
>Subversion Revision: 276222 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ef8baa5cab0a8acc450c458d3f18c84569ca70c8..e4723fd57b8304f45078ef685e35183200d03384 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,64 @@ >+2021-04-17 Tyler Wilcock <twilco.o@protonmail.com> >+ >+ [css-counter-styles] Parse @counter-style descriptors >+ https://bugs.webkit.org/show_bug.cgi?id=224718 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implement parsing and CSSCounterStyleRule IDL interface for @counter-style descriptors. >+ See spec for full details on all descriptors: >+ >+ https://drafts.csswg.org/css-counter-styles-3/#the-counter-style-rule >+ >+ Test: webexposed/counter-style-image-symbols-not-exposed.html >+ >+ * css/CSSComputedStyleDeclaration.cpp: >+ (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): >+ Return `nullptr` for new @counter-style descriptor properties. >+ >+ * css/CSSCounterStyleRule.cpp: >+ (WebCore::toCounterStyleSystemEnum): >+ (WebCore::symbolsValidForSystem): >+ (WebCore::StyleRuleCounterStyle::newValueInvalidOrEqual const): >+ (WebCore::CSSCounterStyleRule::cssText const): >+ (WebCore::CSSCounterStyleRule::setName): >+ (WebCore::CSSCounterStyleRule::setterInternal): >+ (WebCore::CSSCounterStyleRule::setSystem): >+ (WebCore::CSSCounterStyleRule::setNegative): >+ (WebCore::CSSCounterStyleRule::setPrefix): >+ (WebCore::CSSCounterStyleRule::setSuffix): >+ (WebCore::CSSCounterStyleRule::setRange): >+ (WebCore::CSSCounterStyleRule::setPad): >+ (WebCore::CSSCounterStyleRule::setFallback): >+ (WebCore::CSSCounterStyleRule::setSymbols): >+ (WebCore::CSSCounterStyleRule::setAdditiveSymbols): >+ (WebCore::CSSCounterStyleRule::setSpeakAs): >+ Implement setters and tangential functionality required by setters. >+ >+ * css/CSSCounterStyleRule.h: >+ Replace FIXME with actual descriptor getter and setter >+ implementations. >+ >+ * css/CSSProperties.json: >+ Add @counter-style descriptor properties. >+ >+ * css/CSSValueKeywords.in: >+ Add new values required for `system` and `speak-as` >+ @counter-style descriptor properties. >+ >+ * css/parser/CSSPropertyParser.cpp: >+ (WebCore::consumeCounterStyleSystem): >+ (WebCore::consumeCounterStyleSymbol): >+ (WebCore::consumeCounterStyleNegative): >+ (WebCore::consumeCounterStyleRangeBound): >+ (WebCore::consumeCounterStyleRange): >+ (WebCore::consumeCounterStylePad): >+ (WebCore::consumeCounterStyleSymbols): >+ (WebCore::consumeCounterStyleAdditiveSymbols): >+ (WebCore::consumeCounterStyleSpeakAs): >+ (WebCore::CSSPropertyParser::parseCounterStyleDescriptor): >+ Parse @counter-style descriptors. >+ > 2021-04-17 Wenson Hsieh <wenson_hsieh@apple.com> > > [macOS] Add some support for webpage translation in WebKitLegacy >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index b57c2b1f068ed28529483ebac90cbc70532e4392..8b2e55e06071851e638d7a9ce242c76a1bb2178c 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,41 @@ >+2021-04-17 Tyler Wilcock <twilco.o@protonmail.com> >+ >+ [css-counter-styles] Parse @counter-style descriptors >+ https://bugs.webkit.org/show_bug.cgi?id=224718 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implement functionality required for CSSCounterStyleAtRulesEnabled and >+ CSSCounterStyleAtRuleImageSymbolsEnabled flags to be set via test >+ header. >+ >+ * Interfaces/IWebPreferencesPrivate.idl: >+ Add CSSCounterStyleAtRulesEnabled, setCSSCounterStyleAtRulesEnabled, >+ CSSCounterStyleAtRuleImageSymbolsEnabled, and >+ setCSSCounterStyleAtRuleImageSymbolsEnabled. >+ >+ * WebPreferenceKeysPrivate.h: >+ Add WebKitCSSCounterStyleAtRulesEnabledPreferenceKey and >+ WebKitCSSCounterStyleAtRuleImageSymbolsEnabledPreferenceKey. >+ >+ * WebPreferences.cpp: >+ (WebPreferences::initializeDefaultSettings): >+ (WebPreferences::CSSCounterStyleAtRulesEnabled): >+ (WebPreferences::setCSSCounterStyleAtRulesEnabled): >+ (WebPreferences::CSSCounterStyleAtRuleImageSymbolsEnabled): >+ (WebPreferences::setCSSCounterStyleAtRuleImageSymbolsEnabled): >+ Implement getters and setters for CSSCounterStyleAtRulesEnabled >+ and CSSCounterStyleAtRuleImageSymbolsEnabled flags. >+ >+ * WebPreferences.h: >+ Declare getters and setters for CSSCounterStyleAtRulesEnabled >+ and CSSCounterStyleAtRuleImageSymbolsEnabled flags. >+ >+ * WebView.cpp: >+ (WebView::notifyPreferencesChanged): >+ Update webpage settings when CSSCounterStyleAtRulesEnabled and >+ CSSCounterStyleAtRuleImageSymbolsEnabled flags change. >+ > 2021-03-28 Sam Weinig <weinig@apple.com> > > Remove ENABLE_INDEXED_DATABASE & ENABLE_INDEXED_DATABASE_IN_WORKERS, it seems like it is on for all ports >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >index 511f89e650f9b4d5258b42af2b879aa949a5ed4c..00c6a4b2ae19abb46431a97ee28707c3fa290183 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >@@ -4003,6 +4003,18 @@ RefPtr<CSSValue> ComputedStyleExtractor::valueForPropertyInStyle(const RenderSty > ASSERT_NOT_REACHED(); > break; > >+ /* These are intentionally unimplemented because they are actually descriptors for @counter-style. */ >+ case CSSPropertySystem: >+ case CSSPropertyNegative: >+ case CSSPropertyPrefix: >+ case CSSPropertySuffix: >+ case CSSPropertyRange: >+ case CSSPropertyPad: >+ case CSSPropertyFallback: >+ case CSSPropertySymbols: >+ case CSSPropertyAdditiveSymbols: >+ break; >+ > /* Unimplemented @font-face properties */ > case CSSPropertySrc: > case CSSPropertyUnicodeRange: >diff --git a/Source/WebCore/css/CSSCounterStyleRule.cpp b/Source/WebCore/css/CSSCounterStyleRule.cpp >index 229c4524d1ee8a7e842cb7eb4c7d553d928ea636..47a90cbdd2f05e24e39957955784fa4fbdec0034 100644 >--- a/Source/WebCore/css/CSSCounterStyleRule.cpp >+++ b/Source/WebCore/css/CSSCounterStyleRule.cpp >@@ -26,6 +26,12 @@ > #include "config.h" > #include "CSSCounterStyleRule.h" > >+#include "CSSPropertyParser.h" >+#include "CSSStyleSheet.h" >+#include "CSSTokenizer.h" >+#include "Pair.h" >+#include <wtf/text/StringBuilder.h> >+ > namespace WebCore { > > StyleRuleCounterStyle::StyleRuleCounterStyle(const AtomString& name, Ref<StyleProperties>&& properties) >@@ -40,6 +46,94 @@ Ref<StyleRuleCounterStyle> StyleRuleCounterStyle::create(const AtomString& name, > return adoptRef(*new StyleRuleCounterStyle(name, WTFMove(properties))); > } > >+static CounterStyleSystem toCounterStyleSystemEnum(RefPtr<CSSValue> system) >+{ >+ if (!system || !system->isPrimitiveValue()) >+ return CounterStyleSystem::Symbolic; >+ >+ auto& primitiveSystemValue = downcast<CSSPrimitiveValue>(*system); >+ ASSERT(primitiveSystemValue.isValueID() || primitiveSystemValue.isPair()); >+ CSSValueID systemKeyword = CSSValueInvalid; >+ if (primitiveSystemValue.isValueID()) >+ systemKeyword = primitiveSystemValue.valueID(); >+ else if (auto* pair = primitiveSystemValue.pairValue()) { >+ // This value must be `fixed` or `extends`, both of which can or must have an additional component. >+ auto firstValue = pair->first(); >+ ASSERT(firstValue && firstValue->isValueID()); >+ if (firstValue) >+ systemKeyword = firstValue->valueID(); >+ } >+ >+ switch (systemKeyword) { >+ case CSSValueCyclic: >+ return CounterStyleSystem::Cyclic; >+ case CSSValueFixed: >+ return CounterStyleSystem::Fixed; >+ case CSSValueSymbolic: >+ return CounterStyleSystem::Symbolic; >+ case CSSValueAlphabetic: >+ return CounterStyleSystem::Alphabetic; >+ case CSSValueNumeric: >+ return CounterStyleSystem::Numeric; >+ case CSSValueAdditive: >+ return CounterStyleSystem::Additive; >+ case CSSValueExtends: >+ return CounterStyleSystem::Extends; >+ default: >+ ASSERT_NOT_REACHED(); >+ return CounterStyleSystem::Symbolic; >+ } >+} >+ >+static bool symbolsValidForSystem(CounterStyleSystem system, RefPtr<CSSValue> symbols, RefPtr<CSSValue> additiveSymbols) >+{ >+ switch (system) { >+ case CounterStyleSystem::Cyclic: >+ case CounterStyleSystem::Fixed: >+ case CounterStyleSystem::Symbolic: >+ return symbols && symbols->isValueList() && downcast<CSSValueList>(*symbols).length(); >+ case CounterStyleSystem::Alphabetic: >+ case CounterStyleSystem::Numeric: >+ return symbols && symbols->isValueList() && downcast<CSSValueList>(*symbols).length() >= 2u; >+ case CounterStyleSystem::Additive: >+ return additiveSymbols && additiveSymbols->isValueList() && downcast<CSSValueList>(*additiveSymbols).length(); >+ case CounterStyleSystem::Extends: >+ return !symbols && !additiveSymbols; >+ default: >+ ASSERT_NOT_REACHED(); >+ return false; >+ } >+} >+ >+bool StyleRuleCounterStyle::newValueInvalidOrEqual(CSSPropertyID propertyID, const RefPtr<CSSValue> newValue) const >+{ >+ auto currentValue = m_properties->getPropertyCSSValue(propertyID); >+ if (compareCSSValuePtr(currentValue, newValue)) >+ return true; >+ >+ RefPtr<CSSValue> symbols; >+ RefPtr<CSSValue> additiveSymbols; >+ switch (propertyID) { >+ case CSSPropertySystem: >+ // If the attribute being set is `system`, and the new value would change the algorithm used, do nothing >+ // and abort these steps. >+ // (It's okay to change an aspect of the algorithm, like the first symbol value of a `fixed` system.) >+ return toCounterStyleSystemEnum(currentValue) != toCounterStyleSystemEnum(newValue); >+ case CSSPropertySymbols: >+ symbols = newValue; >+ additiveSymbols = m_properties->getPropertyCSSValue(CSSPropertyAdditiveSymbols); >+ break; >+ case CSSPropertyAdditiveSymbols: >+ symbols = m_properties->getPropertyCSSValue(CSSPropertySymbols); >+ additiveSymbols = newValue; >+ break; >+ default: >+ return false; >+ } >+ auto system = m_properties->getPropertyCSSValue(CSSPropertySystem); >+ return symbolsValidForSystem(toCounterStyleSystemEnum(system), symbols, additiveSymbols); >+} >+ > StyleRuleCounterStyle::~StyleRuleCounterStyle() = default; > > MutableStyleProperties& StyleRuleCounterStyle::mutableProperties() >@@ -64,8 +158,83 @@ CSSCounterStyleRule::~CSSCounterStyleRule() = default; > > String CSSCounterStyleRule::cssText() const > { >- // FIXME: Implement this function when we parse @counter-style descriptors. >- return emptyString(); >+ StringBuilder result; >+ result.appendLiteral("@counter-style "); >+ result.append(name()); >+ result.appendLiteral(" {"); >+ >+ String systemText = system(); >+ if (systemText.length()) { >+ result.appendLiteral(" system: "); >+ result.append(systemText); >+ result.appendLiteral(";"); >+ } >+ >+ String symbolsText = symbols(); >+ if (symbolsText.length()) { >+ result.appendLiteral(" symbols: "); >+ result.append(symbolsText); >+ result.appendLiteral(";"); >+ } >+ >+ String additiveSymbolsText = additiveSymbols(); >+ if (additiveSymbolsText.length()) { >+ result.appendLiteral(" additive-symbols: "); >+ result.append(additiveSymbolsText); >+ result.appendLiteral(";"); >+ } >+ >+ String negativeText = negative(); >+ if (negativeText.length()) { >+ result.appendLiteral(" negative: "); >+ result.append(negativeText); >+ result.appendLiteral(";"); >+ } >+ >+ String prefixText = prefix(); >+ if (prefixText.length()) { >+ result.appendLiteral(" prefix: "); >+ result.append(prefixText); >+ result.appendLiteral(";"); >+ } >+ >+ String suffixText = suffix(); >+ if (suffixText.length()) { >+ result.appendLiteral(" suffix: "); >+ result.append(suffixText); >+ result.appendLiteral(";"); >+ } >+ >+ String padText = pad(); >+ if (padText.length()) { >+ result.appendLiteral(" pad: "); >+ result.append(padText); >+ result.appendLiteral(";"); >+ } >+ >+ String rangeText = range(); >+ if (rangeText.length()) { >+ result.appendLiteral(" range: "); >+ result.append(rangeText); >+ result.appendLiteral(";"); >+ } >+ >+ String fallbackText = fallback(); >+ if (fallbackText.length()) { >+ result.appendLiteral(" fallback: "); >+ result.append(fallbackText); >+ result.appendLiteral(";"); >+ } >+ >+ String speakAsText = speakAs(); >+ if (speakAsText.length()) { >+ result.appendLiteral(" speak-as: "); >+ result.append(speakAsText); >+ result.appendLiteral(";"); >+ } >+ >+ result.appendLiteral(" }"); >+ return result.toString(); > } > > void CSSCounterStyleRule::reattach(StyleRuleBase& rule) >@@ -73,4 +242,77 @@ void CSSCounterStyleRule::reattach(StyleRuleBase& rule) > m_counterStyleRule = static_cast<StyleRuleCounterStyle&>(rule); > } > >+// https://drafts.csswg.org/css-counter-styles-3/#dom-csscounterstylerule-name >+void CSSCounterStyleRule::setName(const String& text) >+{ >+ auto tokens = CSSTokenizer(text).tokenRange(); >+ auto name = CSSPropertyParserHelpers::consumeCounterStyleNameInPrelude(tokens); >+ if (name.isNull() || name == m_counterStyleRule->name()) >+ return; >+ >+ CSSStyleSheet::RuleMutationScope mutationScope(this); >+ m_counterStyleRule->setName(name); >+} >+ >+void CSSCounterStyleRule::setterInternal(CSSPropertyID propertyID, const String& valueText) >+{ >+ auto tokens = CSSTokenizer(valueText).tokenRange(); >+ auto newValue = CSSPropertyParser::parseCounterStyleDescriptor(propertyID, tokens, parserContext()); >+ if (m_counterStyleRule->newValueInvalidOrEqual(propertyID, newValue)) >+ return; >+ >+ CSSStyleSheet::RuleMutationScope mutationScope(this); >+ m_counterStyleRule->mutableProperties().setProperty(propertyID, WTFMove(newValue)); >+} >+ >+void CSSCounterStyleRule::setSystem(const String& text) >+{ >+ setterInternal(CSSPropertySystem, text); >+} >+ >+void CSSCounterStyleRule::setNegative(const String& text) >+{ >+ setterInternal(CSSPropertyNegative, text); >+} >+ >+void CSSCounterStyleRule::setPrefix(const String& text) >+{ >+ setterInternal(CSSPropertyPrefix, text); >+} >+ >+void CSSCounterStyleRule::setSuffix(const String& text) >+{ >+ setterInternal(CSSPropertySuffix, text); >+} >+ >+void CSSCounterStyleRule::setRange(const String& text) >+{ >+ setterInternal(CSSPropertyRange, text); >+} >+ >+void CSSCounterStyleRule::setPad(const String& text) >+{ >+ setterInternal(CSSPropertyPad, text); >+} >+ >+void CSSCounterStyleRule::setFallback(const String& text) >+{ >+ setterInternal(CSSPropertyFallback, text); >+} >+ >+void CSSCounterStyleRule::setSymbols(const String& text) >+{ >+ setterInternal(CSSPropertySymbols, text); >+} >+ >+void CSSCounterStyleRule::setAdditiveSymbols(const String& text) >+{ >+ setterInternal(CSSPropertyAdditiveSymbols, text); >+} >+ >+void CSSCounterStyleRule::setSpeakAs(const String& text) >+{ >+ setterInternal(CSSPropertySpeakAs, text); >+} >+ > } // namespace WebCore >diff --git a/Source/WebCore/css/CSSCounterStyleRule.h b/Source/WebCore/css/CSSCounterStyleRule.h >index b24fe1fd66f14dcf958aa9a7af7b3c0947c32836..7a897fb12e3956ee6ef86f82399a57cfaa435c08 100644 >--- a/Source/WebCore/css/CSSCounterStyleRule.h >+++ b/Source/WebCore/css/CSSCounterStyleRule.h >@@ -32,6 +32,18 @@ > > namespace WebCore { > >+// The keywords that can be used as values for the counter-style `system` descriptor. >+// https://www.w3.org/TR/css-counter-styles-3/#counter-style-system >+enum class CounterStyleSystem : uint8_t { >+ Cyclic, >+ Numeric, >+ Alphabetic, >+ Symbolic, >+ Additive, >+ Fixed, >+ Extends >+}; >+ > class StyleRuleCounterStyle final : public StyleRuleBase { > public: > static Ref<StyleRuleCounterStyle> create(const AtomString& name, Ref<StyleProperties>&&); >@@ -41,6 +53,20 @@ public: > MutableStyleProperties& mutableProperties(); > > const AtomString& name() const { return m_name; } >+ String system() const { return m_properties->getPropertyValue(CSSPropertySystem); } >+ String negative() const { return m_properties->getPropertyValue(CSSPropertyNegative); } >+ String prefix() const { return m_properties->getPropertyValue(CSSPropertyPrefix); } >+ String suffix() const { return m_properties->getPropertyValue(CSSPropertySuffix); } >+ String range() const { return m_properties->getPropertyValue(CSSPropertyRange); } >+ String pad() const { return m_properties->getPropertyValue(CSSPropertyPad); } >+ String fallback() const { return m_properties->getPropertyValue(CSSPropertyFallback); } >+ String symbols() const { return m_properties->getPropertyValue(CSSPropertySymbols); } >+ String additiveSymbols() const { return m_properties->getPropertyValue(CSSPropertyAdditiveSymbols); } >+ String speakAs() const { return m_properties->getPropertyValue(CSSPropertySpeakAs); } >+ >+ bool newValueInvalidOrEqual(CSSPropertyID, const RefPtr<CSSValue> newValue) const; >+ >+ void setName(const AtomString& name) { m_name = name; } > > private: > explicit StyleRuleCounterStyle(const AtomString&, Ref<StyleProperties>&&); >@@ -59,34 +85,34 @@ public: > CSSRule::Type type() const final { return COUNTER_STYLE_RULE; } > > String name() const { return m_counterStyleRule->name(); } >- // FIXME: Implement after we parse @counter-style descriptors. >- String system() const { return emptyString(); } >- String negative() const { return emptyString(); } >- String prefix() const { return emptyString(); } >- String suffix() const { return emptyString(); } >- String range() const { return emptyString(); } >- String pad() const { return emptyString(); } >- String fallback() const { return emptyString(); } >- String symbols() const { return emptyString(); } >- String additiveSymbols() const { return emptyString(); } >- String speakAs() const { return emptyString(); } >- >- // FIXME: Implement after we parse @counter-style descriptors. >- void setName(const String&) { } >- void setSystem(const String&) { } >- void setNegative(const String&) { } >- void setPrefix(const String&) { } >- void setSuffix(const String&) { } >- void setRange(const String&) { } >- void setPad(const String&) { } >- void setFallback(const String&) { } >- void setSymbols(const String&) { } >- void setAdditiveSymbols(const String&) { } >- void setSpeakAs(const String&) { } >+ String system() const { return m_counterStyleRule->system(); } >+ String negative() const { return m_counterStyleRule->negative(); } >+ String prefix() const { return m_counterStyleRule->prefix(); } >+ String suffix() const { return m_counterStyleRule->suffix(); } >+ String range() const { return m_counterStyleRule->range(); } >+ String pad() const { return m_counterStyleRule->pad(); } >+ String fallback() const { return m_counterStyleRule->fallback(); } >+ String symbols() const { return m_counterStyleRule->symbols(); } >+ String additiveSymbols() const { return m_counterStyleRule->additiveSymbols(); } >+ String speakAs() const { return m_counterStyleRule->speakAs(); } >+ >+ void setName(const String&); >+ void setSystem(const String&); >+ void setNegative(const String&); >+ void setPrefix(const String&); >+ void setSuffix(const String&); >+ void setRange(const String&); >+ void setPad(const String&); >+ void setFallback(const String&); >+ void setSymbols(const String&); >+ void setAdditiveSymbols(const String&); >+ void setSpeakAs(const String&); > > private: > CSSCounterStyleRule(StyleRuleCounterStyle&, CSSStyleSheet* parent); > >+ void setterInternal(CSSPropertyID, const String&); >+ > Ref<StyleRuleCounterStyle> m_counterStyleRule; > }; > >diff --git a/Source/WebCore/css/CSSProperties.json b/Source/WebCore/css/CSSProperties.json >index 72b957ec085544d066dc523e5b10400a9971738f..d8ccd6b2408d09768d734e5a3b3a42a548bf0b4a 100644 >--- a/Source/WebCore/css/CSSProperties.json >+++ b/Source/WebCore/css/CSSProperties.json >@@ -803,6 +803,16 @@ > "url": "https://www.w3.org/TR/css-ruby-1/#rubypos" > } > }, >+ "additive-symbols": { >+ "settings-flag": "cssCounterStyleAtRule", >+ "codegen-properties": { >+ "skip-builder": true >+ }, >+ "specification": { >+ "category": "css-counter-styles", >+ "url": "https://www.w3.org/TR/css-counter-styles-3/#counter-style-symbols" >+ } >+ }, > "alignment-baseline": { > "values": [ > "auto", >@@ -2436,6 +2446,16 @@ > "category": "svg" > } > }, >+ "fallback": { >+ "settings-flag": "cssCounterStyleAtRule", >+ "codegen-properties": { >+ "skip-builder": true >+ }, >+ "specification": { >+ "category": "css-counter-styles", >+ "url": "https://www.w3.org/TR/css-counter-styles-3/#counter-style-fallback" >+ } >+ }, > "fill": { > "inherited": true, > "codegen-properties": { >@@ -3377,6 +3397,16 @@ > "url": "https://drafts.csswg.org/css-overscroll-1/#propdef-overscroll-behavior-y" > } > }, >+ "pad": { >+ "settings-flag": "cssCounterStyleAtRule", >+ "codegen-properties": { >+ "skip-builder": true >+ }, >+ "specification": { >+ "category": "css-counter-styles", >+ "url": "https://www.w3.org/TR/css-counter-styles-3/#counter-style-pad" >+ } >+ }, > "padding": { > "codegen-properties": { > "longhands": [ >@@ -3850,6 +3880,16 @@ > "url": "https://www.w3.org/TR/css3-speech/#speak-as" > } > }, >+ "symbols": { >+ "settings-flag": "cssCounterStyleAtRule", >+ "codegen-properties": { >+ "skip-builder": true >+ }, >+ "specification": { >+ "category": "css-counter-styles", >+ "url": "https://www.w3.org/TR/css-counter-styles-3/#counter-style-symbols" >+ } >+ }, > "table-layout": { > "values": [ > "auto", >@@ -6044,6 +6084,16 @@ > }, > "status": "non-standard" > }, >+ "negative": { >+ "settings-flag": "cssCounterStyleAtRule", >+ "codegen-properties": { >+ "skip-builder": true >+ }, >+ "specification": { >+ "category": "css-counter-styles", >+ "url": "https://www.w3.org/TR/css-counter-styles-3/#counter-style-negative" >+ } >+ }, > "color-scheme": { > "inherited": true, > "values": [ >@@ -6129,6 +6179,16 @@ > "url": "https://www.w3.org/TR/css-transforms-1/#propdef-perspective-origin" > } > }, >+ "prefix": { >+ "settings-flag": "cssCounterStyleAtRule", >+ "codegen-properties": { >+ "skip-builder": true >+ }, >+ "specification": { >+ "category": "css-counter-styles", >+ "url": "https://www.w3.org/TR/css-counter-styles-3/#counter-style-prefix" >+ } >+ }, > "-webkit-print-color-adjust": { > "inherited": true, > "values": [ >@@ -6137,6 +6197,16 @@ > ], > "status": "non-standard" > }, >+ "range": { >+ "settings-flag": "cssCounterStyleAtRule", >+ "codegen-properties": { >+ "skip-builder": true >+ }, >+ "specification": { >+ "category": "css-counter-styles", >+ "url": "https://www.w3.org/TR/css-counter-styles-3/#counter-style-range" >+ } >+ }, > "-webkit-rtl-ordering": { > "inherited": true, > "values": [ >@@ -6149,6 +6219,16 @@ > }, > "status": "non-standard" > }, >+ "suffix": { >+ "runtime-flag": "cssCounterStyleAtRule", >+ "codegen-properties": { >+ "skip-builder": true >+ }, >+ "specification": { >+ "category": "css-counter-styles", >+ "url": "https://www.w3.org/TR/css-counter-styles-3/#counter-style-suffix" >+ } >+ }, > "-webkit-svg-shadow": { > "codegen-properties": { > "skip-codegen": true >@@ -6971,6 +7051,16 @@ > "url": "https://www.w3.org/TR/css-shapes/#propdef-shape-image-threshold" > } > }, >+ "system": { >+ "settings-flag": "cssCounterStyleAtRule", >+ "codegen-properties": { >+ "skip-builder": true >+ }, >+ "specification": { >+ "category": "css-counter-styles", >+ "url": "https://www.w3.org/TR/css-counter-styles-3/#counter-style-system" >+ } >+ }, > "-webkit-tap-highlight-color": { > "inherited": true, > "codegen-properties": { >@@ -7141,6 +7231,11 @@ > "longname": "CSS Generated Content Module", > "url": "https://www.w3.org/TR/css-content-3/" > }, >+ "css-counter-styles": { >+ "shortname": "CSS Counter Styles", >+ "longname": "CSS Counter Styles Module", >+ "url": "https://www.w3.org/TR/css-counter-styles-3" >+ }, > "css-device-adapt": { > "shortname": "CSS Device Adaptation", > "longname": "CSS Device Adaptation Module", >diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in >index fd4f856fcdd16f2b6429763f0e57c68a454262eb..d84e987be2095bbdadf6d9266cac0f439ffd16fd 100644 >--- a/Source/WebCore/css/CSSValueKeywords.in >+++ b/Source/WebCore/css/CSSValueKeywords.in >@@ -1504,6 +1504,24 @@ from-font > standard > high > >+// @counter-style `system` descriptor values >+// https://www.w3.org/TR/css-counter-styles-3/#counter-style-system >+cyclic >+numeric >+// alphabetic >+symbolic >+additive >+// fixed >+extends >+ >+// @counter-style `speak-as` descriptor values >+// https://www.w3.org/TR/css-counter-styles-3/#counter-style-speak-as >+// auto >+bullets >+numbers >+words >+// spell-out >+ > // @supports selector() > // https://drafts.csswg.org/css-conditional-4/#typedef-supports-selector-fn > selector >diff --git a/Source/WebCore/css/parser/CSSPropertyParser.cpp b/Source/WebCore/css/parser/CSSPropertyParser.cpp >index 7761f4339f8a24ebc7a3bc949c38782b9523154e..22627c2271f5f50e92233e7e1811e873e689fd26 100644 >--- a/Source/WebCore/css/parser/CSSPropertyParser.cpp >+++ b/Source/WebCore/css/parser/CSSPropertyParser.cpp >@@ -4436,15 +4436,219 @@ RefPtr<CSSCustomPropertyValue> CSSPropertyParser::parseTypedCustomPropertyValue( > return nullptr; > } > >+// https://www.w3.org/TR/css-counter-styles-3/#counter-style-system >+static RefPtr<CSSPrimitiveValue> consumeCounterStyleSystem(CSSParserTokenRange& range) >+{ >+ if (auto ident = consumeIdent<CSSValueCyclic, CSSValueNumeric, CSSValueAlphabetic, CSSValueSymbolic, CSSValueAdditive>(range)) >+ return ident; >+ >+ if (auto ident = consumeIdent<CSSValueFixed>(range)) { >+ if (range.atEnd()) >+ return ident; >+ // If we have the `fixed` keyword but the range is not at the end, the next token must be a integer. >+ // If it's not, this value is invalid. >+ auto firstSymbolValue = consumeInteger(range); >+ if (!firstSymbolValue) >+ return nullptr; >+ return createPrimitiveValuePair(ident.releaseNonNull(), firstSymbolValue.releaseNonNull()); >+ } >+ >+ if (auto ident = consumeIdent<CSSValueExtends>(range)) { >+ // There must be a `<counter-style-name>` following the `extends` keyword. If there isn't, this value is invalid. >+ auto parsedCounterStyleName = consumeCounterStyleName(range); >+ if (!parsedCounterStyleName) >+ return nullptr; >+ return createPrimitiveValuePair(ident.releaseNonNull(), parsedCounterStyleName.releaseNonNull()); >+ } >+ return nullptr; >+} >+ >+// https://www.w3.org/TR/css-counter-styles-3/#typedef-symbol >+static RefPtr<CSSValue> consumeCounterStyleSymbol(CSSParserTokenRange& range, const CSSParserContext& context) >+{ >+ if (auto string = consumeString(range)) >+ return string; >+ if (auto customIdent = consumeCustomIdent(range)) >+ return customIdent; >+ // There are inherent difficulties in supporting <image> symbols in @counter-styles, so gate them behind a >+ // flag for now. https://bugs.webkit.org/show_bug.cgi?id=167645 >+ if (context.counterStyleAtRuleImageSymbolsEnabled) { >+ if (auto image = consumeImage(range, context, { AllowedImageType::URLFunction, AllowedImageType::GeneratedImage })) >+ return image; >+ } >+ return nullptr; >+} >+ >+// https://www.w3.org/TR/css-counter-styles-3/#counter-style-negative >+static RefPtr<CSSValue> consumeCounterStyleNegative(CSSParserTokenRange& range, const CSSParserContext& context) >+{ >+ auto prependValue = consumeCounterStyleSymbol(range, context); >+ if (!prependValue) >+ return nullptr; >+ if (range.atEnd()) >+ return prependValue; >+ >+ auto appendValue = consumeCounterStyleSymbol(range, context); >+ if (!appendValue || !range.atEnd()) >+ return nullptr; >+ >+ RefPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); >+ values->append(prependValue.releaseNonNull()); >+ values->append(appendValue.releaseNonNull()); >+ return values; >+} >+ >+// https://www.w3.org/TR/css-counter-styles-3/#counter-style-range >+static RefPtr<CSSPrimitiveValue> consumeCounterStyleRangeBound(CSSParserTokenRange& range) >+{ >+ if (auto infinite = consumeIdent<CSSValueInfinite>(range)) >+ return infinite; >+ if (auto integer = consumeInteger(range)) >+ return integer; >+ return nullptr; >+} >+ >+// https://www.w3.org/TR/css-counter-styles-3/#counter-style-range >+static RefPtr<CSSValue> consumeCounterStyleRange(CSSParserTokenRange& range) >+{ >+ if (auto autoValue = consumeIdent<CSSValueAuto>(range)) >+ return autoValue; >+ >+ auto rangeList = CSSValueList::createCommaSeparated(); >+ do { >+ auto lowerBound = consumeCounterStyleRangeBound(range); >+ if (!lowerBound) >+ return nullptr; >+ auto upperBound = consumeCounterStyleRangeBound(range); >+ if (!upperBound) >+ return nullptr; >+ >+ // If the lower bound of any range is higher than the upper bound, the entire descriptor is invalid and must be >+ // ignored. >+ if (lowerBound->isNumber() && upperBound->isNumber() && lowerBound->intValue() > upperBound->intValue()) >+ return nullptr; >+ rangeList->append(createPrimitiveValuePair(lowerBound.releaseNonNull(), upperBound.releaseNonNull(), Pair::IdenticalValueEncoding::DoNotCoalesce)); >+ } while (consumeCommaIncludingWhitespace(range)); >+ if (!range.atEnd() || !rangeList->length()) >+ return nullptr; >+ return rangeList; >+} >+ >+// https://www.w3.org/TR/css-counter-styles-3/#counter-style-pad >+static RefPtr<CSSValue> consumeCounterStylePad(CSSParserTokenRange& range, const CSSParserContext& context) >+{ >+ RefPtr<CSSValue> integer; >+ RefPtr<CSSValue> symbol; >+ while (!integer || !symbol) { >+ if (!integer) { >+ integer = consumeInteger(range, ValueRangeNonNegative); >+ if (integer) >+ continue; >+ } >+ if (!symbol) { >+ symbol = consumeCounterStyleSymbol(range, context); >+ if (symbol) >+ continue; >+ } >+ return nullptr; >+ } >+ if (!range.atEnd()) >+ return nullptr; >+ auto values = CSSValueList::createSpaceSeparated(); >+ values->append(integer.releaseNonNull()); >+ values->append(symbol.releaseNonNull()); >+ return values; >+} >+ >+// https://www.w3.org/TR/css-counter-styles-3/#counter-style-symbols >+static RefPtr<CSSValue> consumeCounterStyleSymbols(CSSParserTokenRange& range, const CSSParserContext& context) >+{ >+ auto symbols = CSSValueList::createSpaceSeparated(); >+ while (!range.atEnd()) { >+ auto symbol = consumeCounterStyleSymbol(range, context); >+ if (!symbol) >+ return nullptr; >+ symbols->append(symbol.releaseNonNull()); >+ } >+ if (!symbols->length()) >+ return nullptr; >+ return symbols; >+} >+ >+// https://www.w3.org/TR/css-counter-styles-3/#counter-style-symbols >+static RefPtr<CSSValue> consumeCounterStyleAdditiveSymbols(CSSParserTokenRange& range, const CSSParserContext& context) >+{ >+ auto values = CSSValueList::createCommaSeparated(); >+ RefPtr<CSSPrimitiveValue> lastInteger; >+ do { >+ RefPtr<CSSPrimitiveValue> integer; >+ RefPtr<CSSValue> symbol; >+ while (!integer || !symbol) { >+ if (!integer) { >+ integer = consumeInteger(range, ValueRangeNonNegative); >+ if (integer) >+ continue; >+ } >+ if (!symbol) { >+ symbol = consumeCounterStyleSymbol(range, context); >+ if (symbol) >+ continue; >+ } >+ return nullptr; >+ } >+ >+ if (lastInteger) { >+ // The additive tuples must be specified in order of strictly descending >+ // weight; otherwise, the declaration is invalid and must be ignored. >+ if (integer->intValue() >= lastInteger->intValue()) >+ return nullptr; >+ } >+ lastInteger = integer; >+ values->append(integer.releaseNonNull()); >+ values->append(symbol.releaseNonNull()); >+ } while (consumeCommaIncludingWhitespace(range)); >+ if (!range.atEnd() || !values->length()) >+ return nullptr; >+ return values; >+} >+ >+// https://www.w3.org/TR/css-counter-styles-3/#counter-style-speak-as >+static RefPtr<CSSValue> consumeCounterStyleSpeakAs(CSSParserTokenRange& range) >+{ >+ if (auto speakAsIdent = consumeIdent<CSSValueAuto, CSSValueBullets, CSSValueNumbers, CSSValueWords, CSSValueSpellOut>(range)) >+ return speakAsIdent; >+ return consumeCounterStyleName(range); >+} >+ > RefPtr<CSSValue> CSSPropertyParser::parseCounterStyleDescriptor(CSSPropertyID propId, CSSParserTokenRange& range, const CSSParserContext& context) > { > if (!context.counterStyleAtRulesEnabled) > return nullptr; >- // FIXME: Implement this function when we can parse @counter-style descriptors. >- UNUSED_PARAM(propId); >- UNUSED_PARAM(range); >- UNUSED_PARAM(context); >- return nullptr; >+ >+ switch (propId) { >+ case CSSPropertySystem: >+ return consumeCounterStyleSystem(range); >+ case CSSPropertyNegative: >+ return consumeCounterStyleNegative(range, context); >+ case CSSPropertyPrefix: >+ case CSSPropertySuffix: >+ return consumeCounterStyleSymbol(range, context); >+ case CSSPropertyRange: >+ return consumeCounterStyleRange(range); >+ case CSSPropertyPad: >+ return consumeCounterStylePad(range, context); >+ case CSSPropertyFallback: >+ return consumeCounterStyleName(range); >+ case CSSPropertySymbols: >+ return consumeCounterStyleSymbols(range, context); >+ case CSSPropertyAdditiveSymbols: >+ return consumeCounterStyleAdditiveSymbols(range, context); >+ case CSSPropertySpeakAs: >+ return consumeCounterStyleSpeakAs(range); >+ default: >+ ASSERT_NOT_REACHED(); >+ return nullptr; >+ } > } > > bool CSSPropertyParser::parseCounterStyleDescriptor(CSSPropertyID propId, const CSSParserContext& context) >diff --git a/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl b/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl >index a79c0ea9e724b6dc4ca6cd050d37c78bb2b14635..8f00572a1f02b6e655b2087ec9c0a50771e8919d 100644 >--- a/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl >+++ b/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl >@@ -256,6 +256,10 @@ interface IWebPreferencesPrivate7 : IWebPreferencesPrivate6 > HRESULT webSQLEnabled([out, retval] BOOL* enabled); > HRESULT CSSIndividualTransformPropertiesEnabled([out, retval] BOOL* enabled); > HRESULT setCSSIndividualTransformPropertiesEnabled([in] BOOL enabled); >+ HRESULT CSSCounterStyleAtRulesEnabled([out, retval] BOOL* enabled); >+ HRESULT setCSSCounterStyleAtRulesEnabled([in] BOOL enabled); >+ HRESULT CSSCounterStyleAtRuleImageSymbolsEnabled([out, retval] BOOL* enabled); >+ HRESULT setCSSCounterStyleAtRuleImageSymbolsEnabled([in] BOOL enabled); > } > > [uuid(04D4AAE1-5D01-4CCD-B46E-C022F10A6826)] >diff --git a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h b/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h >index 99c66497b814c237479402d80a4a741e50adb543..05a4cd68917111f247222844b6c3b55d29be57c7 100644 >--- a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h >+++ b/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h >@@ -228,6 +228,10 @@ > > #define WebKitWebSQLEnabledPreferenceKey "WebKitWebSQLEnabled" > >+#define WebKitCSSCounterStyleAtRulesEnabledPreferenceKey "WebKitCSSCounterStyleAtRulesEnabled" >+ >+#define WebKitCSSCounterStyleAtRuleImageSymbolsEnabledPreferenceKey "WebKitCSSCounterStyleAtRuleImageSymbolsEnabled" >+ > #define WebKitCSSIndividualTransformPropertiesEnabledPreferenceKey "WebKitCSSIndividualTransformPropertiesEnabled" > > #define WebKitSpeechRecognitionEnabledPreferenceKey "WebKitSpeechRecognitionEnabled" >diff --git a/Source/WebKitLegacy/win/WebPreferences.cpp b/Source/WebKitLegacy/win/WebPreferences.cpp >index 8c8ecd3a62f82862c5b07f578a7920c91707e8be..f9a21cf6b59721f44c135e96be67a7d397c44982 100644 >--- a/Source/WebKitLegacy/win/WebPreferences.cpp >+++ b/Source/WebKitLegacy/win/WebPreferences.cpp >@@ -368,6 +368,10 @@ void WebPreferences::initializeDefaultSettings() > > CFDictionaryAddValue(defaults.get(), CFSTR(WebKitCSSIndividualTransformPropertiesEnabledPreferenceKey), kCFBooleanTrue); > >+ CFDictionaryAddValue(defaults.get(), CFSTR(WebKitCSSCounterStyleAtRulesEnabledPreferenceKey), kCFBooleanFalse); >+ >+ CFDictionaryAddValue(defaults.get(), CFSTR(WebKitCSSCounterStyleAtRuleImageSymbolsEnabledPreferenceKey), kCFBooleanFalse); >+ > CFDictionaryAddValue(defaults.get(), CFSTR(WebKitSpeechRecognitionEnabledPreferenceKey), kCFBooleanFalse); > > CFDictionaryAddValue(defaults.get(), CFSTR(WebKitOverscrollBehaviorEnabledPreferenceKey), kCFBooleanFalse); >@@ -2578,6 +2582,34 @@ HRESULT WebPreferences::setCSSIndividualTransformPropertiesEnabled(BOOL enabled) > return S_OK; > } > >+HRESULT WebPreferences::CSSCounterStyleAtRulesEnabled(_Out_ BOOL* enabled) >+{ >+ if (!enabled) >+ return E_POINTER; >+ *enabled = boolValueForKey(WebKitCSSCounterStyleAtRulesEnabledPreferenceKey); >+ return S_OK; >+} >+ >+HRESULT WebPreferences::setCSSCounterStyleAtRulesEnabled(BOOL enabled) >+{ >+ setBoolValue(WebKitCSSCounterStyleAtRulesEnabledPreferenceKey, enabled); >+ return S_OK; >+} >+ >+HRESULT WebPreferences::CSSCounterStyleAtRuleImageSymbolsEnabled(_Out_ BOOL* enabled) >+{ >+ if (!enabled) >+ return E_POINTER; >+ *enabled = boolValueForKey(WebKitCSSCounterStyleAtRuleImageSymbolsEnabledPreferenceKey); >+ return S_OK; >+} >+ >+HRESULT WebPreferences::setCSSCounterStyleAtRuleImageSymbolsEnabled(BOOL enabled) >+{ >+ setBoolValue(WebKitCSSCounterStyleAtRuleImageSymbolsEnabledPreferenceKey, enabled); >+ return S_OK; >+} >+ > HRESULT WebPreferences::speechRecognitionEnabled(_Out_ BOOL* enabled) > { > if (!enabled) >diff --git a/Source/WebKitLegacy/win/WebPreferences.h b/Source/WebKitLegacy/win/WebPreferences.h >index 097d07038170c22d2bfbd26cbe524e7a03c28e1b..cae44cb92a869d56781df05452437328888d4d21 100644 >--- a/Source/WebKitLegacy/win/WebPreferences.h >+++ b/Source/WebKitLegacy/win/WebPreferences.h >@@ -297,6 +297,10 @@ public: > virtual HRESULT STDMETHODCALLTYPE setWebSQLEnabled(BOOL); > virtual HRESULT STDMETHODCALLTYPE CSSIndividualTransformPropertiesEnabled(_Out_ BOOL*); > virtual HRESULT STDMETHODCALLTYPE setCSSIndividualTransformPropertiesEnabled(BOOL); >+ virtual HRESULT STDMETHODCALLTYPE CSSCounterStyleAtRulesEnabled(_Out_ BOOL*); >+ virtual HRESULT STDMETHODCALLTYPE setCSSCounterStyleAtRulesEnabled(BOOL); >+ virtual HRESULT STDMETHODCALLTYPE CSSCounterStyleAtRuleImageSymbolsEnabled(_Out_ BOOL*); >+ virtual HRESULT STDMETHODCALLTYPE setCSSCounterStyleAtRuleImageSymbolsEnabled(BOOL); > > // IWebPreferencesPrivate8 > virtual HRESULT STDMETHODCALLTYPE allowTopNavigationToDataURLs(_Out_ BOOL*); >diff --git a/Source/WebKitLegacy/win/WebView.cpp b/Source/WebKitLegacy/win/WebView.cpp >index abbad4dcf1b1839da801396cbaa67880a1430ec3..57c242e7c7d909d689c6cf09d6f209c47cd88cb5 100644 >--- a/Source/WebKitLegacy/win/WebView.cpp >+++ b/Source/WebKitLegacy/win/WebView.cpp >@@ -5278,6 +5278,16 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) > return hr; > settings.setCSSCustomPropertiesAndValuesEnabled(!!enabled); > >+ hr = prefsPrivate->CSSCounterStyleAtRulesEnabled(&enabled); >+ if (FAILED(hr)) >+ return hr; >+ settings.setCSSCounterStyleAtRulesEnabled(!!enabled); >+ >+ hr = prefsPrivate->CSSCounterStyleAtRuleImageSymbolsEnabled(&enabled); >+ if (FAILED(hr)) >+ return hr; >+ settings.setCSSCounterStyleAtRuleImageSymbolsEnabled(!!enabled); >+ > hr = prefsPrivate->linkPreloadEnabled(&enabled); > if (FAILED(hr)) > return hr; >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index f83baf1fc215007a70d8dceee313ad46383bdd3f..87944f60ce2c21481d8dd4f48401feee53fbba90 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,20 @@ >+2021-04-17 Tyler Wilcock <twilco.o@protonmail.com> >+ >+ [css-counter-styles] Parse @counter-style descriptors >+ https://bugs.webkit.org/show_bug.cgi?id=224718 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * DumpRenderTree/TestOptions.cpp: >+ (WTR::TestOptions::defaults): >+ Fix typo (missing 's'). CSSCounterStyleAtRulesEnabled, not >+ CSSCounterStyleAtRuleEnabled. >+ >+ * DumpRenderTree/win/DumpRenderTree.cpp: >+ (enableExperimentalFeatures): >+ Enable CSSCounterStyleAtRulesEnabled and >+ CSSCounterStyleAtRuleImageSymbolsEnabled as experimental features. >+ > 2021-04-17 Chris Dumez <cdumez@apple.com> > > GPUConnectionToWebProcess::allowsExitUnderMemoryPressure() should check if libWebRTCCodecsProxy is used >diff --git a/Tools/DumpRenderTree/TestOptions.cpp b/Tools/DumpRenderTree/TestOptions.cpp >index fb8a232accac51d63246dd4395e124c0996f50da..ee0e3cebc0f7cfed989f1c502de33f5954e088c6 100644 >--- a/Tools/DumpRenderTree/TestOptions.cpp >+++ b/Tools/DumpRenderTree/TestOptions.cpp >@@ -133,7 +133,7 @@ const TestFeatures& TestOptions::defaults() > { "AsyncClipboardAPIEnabled", false }, > { "AttachmentElementEnabled", false }, > { "CSSContainmentEnabled", false }, >- { "CSSCounterStyleAtRuleEnabled", false }, >+ { "CSSCounterStyleAtRulesEnabled", false }, > { "CSSCounterStyleAtRuleImageSymbolsEnabled", false }, > { "CSSLogicalEnabled", false }, > { "CSSOMViewSmoothScrollingEnabled", false }, >diff --git a/Tools/DumpRenderTree/win/DumpRenderTree.cpp b/Tools/DumpRenderTree/win/DumpRenderTree.cpp >index c6fcd61874f0a0c58b357c9360ed6ac69a0c7cf1..a76d7f0e3975b4e7ff0d72a249ac6beac1f73758 100644 >--- a/Tools/DumpRenderTree/win/DumpRenderTree.cpp >+++ b/Tools/DumpRenderTree/win/DumpRenderTree.cpp >@@ -831,6 +831,8 @@ static void enableExperimentalFeatures(IWebPreferences* preferences) > // FIXME: WebGL2 > // FIXME: WebRTC > prefsPrivate->setCSSOMViewSmoothScrollingEnabled(TRUE); >+ prefsPrivate->setCSSCounterStyleAtRulesEnabled(TRUE); >+ prefsPrivate->setCSSCounterStyleAtRuleImageSymbolsEnabled(TRUE); > } > > static void resetWebPreferencesToConsistentValues(IWebPreferences* preferences) >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 1cd3e12256a03133a161353c56483f6d7de9a9f4..28c20a53c442d57bd2f2728c71e30ef469b1384c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2021-04-17 Tyler Wilcock <twilco.o@protonmail.com> >+ >+ [css-counter-styles] Parse @counter-style descriptors >+ https://bugs.webkit.org/show_bug.cgi?id=224718 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add test ensuring <image> @counter-style symbol values cannot be >+ parsed when the `counterStyleAtRuleImageSymbolsEnabled` feature flag >+ is disabled. >+ >+ * webexposed/counter-style-image-symbols-not-exposed-expected.txt: Added. >+ * webexposed/counter-style-image-symbols-not-exposed.html: Added. >+ > 2021-04-17 Tim Nguyen <ntim@apple.com> > > Add support for inline-{start/end} values to float & clear properties >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index cf241a8fc49acfa0da7ec07766aa915ec73ccec6..23aeb4d47f8482e450ed93b3390ec234104a2336 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,46 @@ >+2021-04-17 Tyler Wilcock <twilco.o@protonmail.com> >+ >+ [css-counter-styles] Parse @counter-style descriptors >+ https://bugs.webkit.org/show_bug.cgi?id=224718 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Parsing for all @counter-style descriptors is implemented with this >+ patch, so mark more tests passing. >+ >+ You'll notice that some @counter-style descriptors implemented in this >+ patch did not gain any passing tests (e.g. `pad`, `negative`). In all >+ of these cases, the expected results contain a <string> value, and we >+ fail only because we incorrectly don't serialize these <string> values >+ with quotes. I have manually confirmed in all cases that these values >+ are properly parsed, so it's just the serialization that's incorrect. >+ >+ These <string> values serialize without quotes because WebKit's representation >+ of custom identifiers is not a separate type, but instead overloaded onto the >+ CSS_STRING type. This means that during serialization time, WebKit must guess >+ whether it is actually serializing a string (and include quotes if so), or if >+ it's serializing a custom ident (leaving off quotes if so). >+ >+ Relevant code snippet: >+ >+ https://github.com/WebKit/WebKit/blob/36caeec07975bd5f47db8ac6b749c2787230a461/Source/WebCore/css/CSSMarkup.cpp#L153#L161 >+ >+ Relevant changelog snippet from David Hyatt, 2016-12-07: >+ >+ > We also overload CSS_STRING primitive value type and have it act as both a string >+ > and a custom identifier. This is lame, since the parser should have made two different >+ > types of objects instead, but since our parser doesn't do that yet, I added a serializeAsStringOrCustomIdent >+ > that preserves our old behavior of "quote the string only if needed." In this case what >+ > that really meant was "Try to guess that we were originally a custom ident and leave off >+ > quotes if so." This function will go away once we properly create CSSStringValues and >+ > CSSCustomIdentValues instead of turning the latter into strings. >+ >+ * web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt: >+ * web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt: >+ * web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt: >+ * web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt: >+ * web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt: >+ > 2021-04-17 Tim Nguyen <ntim@apple.com> > > Add support for inline-{start/end} values to float & clear properties >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt >index 56af9e1d484e5c45d47cad337bc5a7d0da107479..7594788e1c209c099ce2be3de7947a7e3d522809 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt >@@ -1,5 +1,5 @@ > >-FAIL @counter-style 'fallback: bar' is valid assert_not_equals: got disallowed value -1 >+PASS @counter-style 'fallback: bar' is valid > PASS @counter-style 'fallback: "bar"' is invalid > PASS @counter-style 'fallback: none' is invalid > PASS @counter-style 'fallback: initial' is invalid >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt >index 092d7a91cd9be92ad41a28033b8e51f63e5c1a30..87c6a06a6b484bfe02279707d02a56f3e0225a38 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt >@@ -7,20 +7,20 @@ FAIL @counter-style 'prefix: "inherit"' is valid assert_not_equals: got disallow > FAIL @counter-style 'suffix: "inherit"' is valid assert_not_equals: got disallowed value -1 > FAIL @counter-style 'prefix: "unset"' is valid assert_not_equals: got disallowed value -1 > FAIL @counter-style 'suffix: "unset"' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'prefix: custom-ident' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'suffix: custom-ident' is valid assert_not_equals: got disallowed value -1 >+PASS @counter-style 'prefix: custom-ident' is valid >+PASS @counter-style 'suffix: custom-ident' is valid > PASS @counter-style 'prefix: initial' is invalid > PASS @counter-style 'suffix: initial' is invalid > PASS @counter-style 'prefix: inherit' is invalid > PASS @counter-style 'suffix: inherit' is invalid > PASS @counter-style 'prefix: unset' is invalid > PASS @counter-style 'suffix: unset' is invalid >-FAIL @counter-style 'prefix: url("https://example.com/foo.png")' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'suffix: url("https://example.com/foo.png")' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'prefix: url(https://example.com/foo.png)' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'suffix: url(https://example.com/foo.png)' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'prefix: linear-gradient(yellow, blue)' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'suffix: linear-gradient(yellow, blue)' is valid assert_not_equals: got disallowed value -1 >+PASS @counter-style 'prefix: url("https://example.com/foo.png")' is valid >+PASS @counter-style 'suffix: url("https://example.com/foo.png")' is valid >+PASS @counter-style 'prefix: url(https://example.com/foo.png)' is valid >+PASS @counter-style 'suffix: url(https://example.com/foo.png)' is valid >+PASS @counter-style 'prefix: linear-gradient(yellow, blue)' is valid >+PASS @counter-style 'suffix: linear-gradient(yellow, blue)' is valid > PASS @counter-style 'prefix: ' is invalid > PASS @counter-style 'suffix: ' is invalid > PASS @counter-style 'prefix: foo bar' is invalid >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt >index 427372e18023155bf3ad465f0eba86d263d761d3..3437101998072dd466915d2ee963ba8b8543771c 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt >@@ -1,10 +1,10 @@ > >-FAIL @counter-style 'range: auto' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'range: infinite infinite' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'range: infinite 0' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'range: 0 infinite' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'range: infinite 0, 5 10, 100 infinite' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'range: infinite 10, 5 20, 15 infinite' is valid assert_not_equals: got disallowed value -1 >+PASS @counter-style 'range: auto' is valid >+PASS @counter-style 'range: infinite infinite' is valid >+PASS @counter-style 'range: infinite 0' is valid >+PASS @counter-style 'range: 0 infinite' is valid >+PASS @counter-style 'range: infinite 0, 5 10, 100 infinite' is valid >+PASS @counter-style 'range: infinite 10, 5 20, 15 infinite' is valid > PASS @counter-style 'range: ' is invalid > PASS @counter-style 'range: 0 -1' is invalid > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt >index d3b3e43c7f51cc8db32f17ee083a925e5d47654a..c63df763fd51b346c33df450f6c152268dcbd457 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt >@@ -1,11 +1,11 @@ > >-FAIL @counter-style 'speak-as: auto' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'speak-as: bullets' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'speak-as: numbers' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'speak-as: words' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'speak-as: spell-out' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'speak-as: bar' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'speak-as: spellout' is valid assert_not_equals: got disallowed value -1 >+PASS @counter-style 'speak-as: auto' is valid >+PASS @counter-style 'speak-as: bullets' is valid >+PASS @counter-style 'speak-as: numbers' is valid >+PASS @counter-style 'speak-as: words' is valid >+PASS @counter-style 'speak-as: spell-out' is valid >+PASS @counter-style 'speak-as: bar' is valid >+PASS @counter-style 'speak-as: spellout' is valid > PASS @counter-style 'speak-as: bullets numbers' is invalid > PASS @counter-style 'speak-as: none' is invalid > PASS @counter-style 'speak-as: initial' is invalid >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt >index fe1efc872c453c889bea1bfc8e7d3e3cca76bb17..5761ea1d82789a1f094078da5bda84490b3fbd1d 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt >@@ -1,13 +1,13 @@ > >-FAIL @counter-style 'system: cyclic' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'system: fixed' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'system: fixed 100' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'system: fixed -1' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'system: symbolic' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'system: alphabetic' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'system: numeric' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'system: additive' is valid assert_not_equals: got disallowed value -1 >-FAIL @counter-style 'system: extends bar' is valid assert_not_equals: got disallowed value -1 >+PASS @counter-style 'system: cyclic' is valid >+PASS @counter-style 'system: fixed' is valid >+PASS @counter-style 'system: fixed 100' is valid >+PASS @counter-style 'system: fixed -1' is valid >+PASS @counter-style 'system: symbolic' is valid >+PASS @counter-style 'system: alphabetic' is valid >+PASS @counter-style 'system: numeric' is valid >+PASS @counter-style 'system: additive' is valid >+PASS @counter-style 'system: extends bar' is valid > PASS @counter-style 'system: float' is invalid > PASS @counter-style 'system: cyclic cyclic' is invalid > PASS @counter-style 'system: extends none' is invalid >diff --git a/LayoutTests/webexposed/counter-style-image-symbols-not-exposed-expected.txt b/LayoutTests/webexposed/counter-style-image-symbols-not-exposed-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..09cfb3cc4a37e9d43d8cbb37b64d860e5d956f00 >--- /dev/null >+++ b/LayoutTests/webexposed/counter-style-image-symbols-not-exposed-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS @counter-style image symbols are not exposed >+ >diff --git a/LayoutTests/webexposed/counter-style-image-symbols-not-exposed.html b/LayoutTests/webexposed/counter-style-image-symbols-not-exposed.html >new file mode 100644 >index 0000000000000000000000000000000000000000..cd5020a1d6ff14d9970078318ce75141e900200f >--- /dev/null >+++ b/LayoutTests/webexposed/counter-style-image-symbols-not-exposed.html >@@ -0,0 +1,17 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ CSSCounterStyleAtRulesEnabled=true CSSCounterStyleAtRuleImageSymbolsEnabled=false ] --> >+<script src="../resources/testharness.js"></script> >+<script src="../resources/testharnessreport.js"></script> >+<style> >+ @counter-style foo { >+ system: cyclic; >+ suffix: " "; >+ symbols: linear-gradient(yellow, blue); >+ } >+</style> >+<script> >+ test(function() { >+ const cssRules = document.styleSheets[0].cssRules >+ assert_equals(cssRules.length, 1, 'Should\'ve been able to parse @counter-style.') >+ assert_equals(cssRules[0].symbols, '', 'Shouldn\'t have been able to parse image symbol value with the runtime feature flag disabled.') >+ }, '@counter-style image symbols are not exposed') >+</script> >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 224718
:
426339
|
426370
|
426371
|
426507
|
426509
|
426620
|
426678
|
426858