Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 3fa329db6badd1d45b3c3769182fa41059aded67 https://github.com/WebKit/WebKit/commit/3fa329db6badd1d45b3c3769182fa41059aded67 Author: Vitor Roriz <vitor.ro...@apple.com> Date: 2023-03-28 (Tue, 28 Mar 2023)
Changed paths: M LayoutTests/TestExpectations M Source/WebCore/css/CSSCounterStyleDescriptors.cpp M Source/WebCore/css/CSSCounterStyleDescriptors.h M Source/WebCore/css/CSSCounterStyleRegistry.cpp M Source/WebCore/css/CSSCounterStyleRegistry.h M Source/WebCore/css/CSSCounterStyleRule.cpp M Source/WebCore/css/CSSCounterStyleRule.h M Source/WebCore/style/RuleSetBuilder.cpp M Source/WebCore/style/StyleScope.cpp Log Message: ----------- Fix @counter-style CSSOM update https://bugs.webkit.org/show_bug.cgi?id=254411 rdar://107184142 Reviewed by Antti Koivisto. We were not updating the CounterStyles descriptors when the related CSSOM descriptor was updated. Now, we define setters for each descriptor of CSSCounterStyleDescriptors. The setters at CSSCounterStyleRule still use setterInternal() to set the associated property at StyleProperties. The function setterInternal() was modified to return true if it did set a new value. The function newValueInvalidOrEqual() had a small bug in which it would return symbolsValidForSystem(...). The right thing to do is return !symbolsValidForSystem(...), since it should true for a invalid value. Each setter at CSSCounterStyleRule now returns early if setterInternal() didn't set a value. If it did set a value we proceed to set the associated descriptor stored at the rule with the newly created setters. Ideally, storing only the descriptors would be enough and we could stop storing StyleProperties. This would require definining a serializer for each descriptor and modifying the the CSSCounterStyleRule setters to set the descriptor directly, without modifying the property first. This improvement should come in a separated PR and it was was reported at https://bugs.webkit.org/show_bug.cgi?id=254524 which is tracked by rdar://107267784. Minor change: We are also renaming hasUnresolvedReferences to m_hasUnresolvedReferences, for following webkit's style. * LayoutTests/TestExpectations: * Source/WebCore/css/CSSCounterStyleDescriptors.cpp: (WebCore::translateRangeFromStyleProperties): (WebCore::translateAdditiveSymbolsFromStyleProperties): (WebCore::translatePadFromStyleProperties): (WebCore::translateNegativeSymbolsFromStyleProperties): (WebCore::translateSymbolsFromStyleProperties): (WebCore::translateFallbackNameFromStyleProperties): (WebCore::translatePrefixFromStyleProperties): (WebCore::translateSuffixFromStyleProperties): (WebCore::extractDataFromSystemDescriptor): (WebCore::CSSCounterStyleDescriptors::setNegative): (WebCore::CSSCounterStyleDescriptors::setPrefix): (WebCore::CSSCounterStyleDescriptors::setSuffix): (WebCore::CSSCounterStyleDescriptors::setRanges): (WebCore::CSSCounterStyleDescriptors::setPad): (WebCore::CSSCounterStyleDescriptors::setFallbackName): (WebCore::CSSCounterStyleDescriptors::setSymbols): (WebCore::CSSCounterStyleDescriptors::setAdditiveSymbols): * Source/WebCore/css/CSSCounterStyleDescriptors.h: (WebCore::CSSCounterStyleDescriptors::setName): * Source/WebCore/css/CSSCounterStyleRegistry.cpp: (WebCore::CSSCounterStyleRegistry::resolveReferencesIfNeeded): (WebCore::CSSCounterStyleRegistry::addCounterStyle): (WebCore::CSSCounterStyleRegistry::clearAuthorCounterStyles): (WebCore::CSSCounterStyleRegistry::invalidate): * Source/WebCore/css/CSSCounterStyleRegistry.h: * Source/WebCore/css/CSSCounterStyleRule.cpp: (WebCore::StyleRuleCounterStyle::newValueInvalidOrEqual 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): * Source/WebCore/css/CSSCounterStyleRule.h: * Source/WebCore/style/RuleSetBuilder.cpp: (WebCore::Style::RuleSetBuilder::addMutatingRulesToResolver): * Source/WebCore/style/StyleScope.cpp: (WebCore::Style::Scope::clearResolver): (WebCore::Style::Scope::updateResolver): Canonical link: https://commits.webkit.org/262203@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes