Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: bd44685c5370772e97308f946e7455831e726fd5 https://github.com/WebKit/WebKit/commit/bd44685c5370772e97308f946e7455831e726fd5 Author: Antti Koivisto <an...@apple.com> Date: 2025-09-04 (Thu, 04 Sep 2025)
Changed paths: M LayoutTests/TestExpectations M LayoutTests/imported/w3c/web-platform-tests/css/css-mixins/at-function-cssom-expected.txt M Source/WebCore/CMakeLists.txt M Source/WebCore/DerivedSources-input.xcfilelist M Source/WebCore/DerivedSources-output.xcfilelist M Source/WebCore/DerivedSources.make M Source/WebCore/Sources.txt M Source/WebCore/WebCore.xcodeproj/project.pbxproj M Source/WebCore/bindings/js/JSCSSRuleCustom.cpp M Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp M Source/WebCore/bindings/js/WebCoreBuiltinNames.h A Source/WebCore/css/CSSFunctionDeclarations.cpp A Source/WebCore/css/CSSFunctionDeclarations.h A Source/WebCore/css/CSSFunctionDeclarations.idl A Source/WebCore/css/CSSFunctionDescriptors.cpp A Source/WebCore/css/CSSFunctionDescriptors.h A Source/WebCore/css/CSSFunctionDescriptors.idl A Source/WebCore/css/CSSFunctionRule.cpp A Source/WebCore/css/CSSFunctionRule.h A Source/WebCore/css/CSSFunctionRule.idl M Source/WebCore/css/CSSStyleDeclaration.h M Source/WebCore/css/PropertySetCSSDescriptors.cpp M Source/WebCore/css/StyleRule.cpp M Source/WebCore/css/StyleRule.h M Source/WebCore/css/StyleRuleFunction.cpp M Source/WebCore/css/StyleRuleFunction.h M Source/WebCore/css/parser/CSSParser.cpp M Source/WebCore/css/parser/CSSParser.h M Source/WebCore/css/parser/CSSParserEnum.h M Source/WebCore/css/parser/CSSPropertyParser.cpp M Source/WebCore/css/query/MediaQueryParser.h Log Message: ----------- [css-mixins-1] Parse @function body https://bugs.webkit.org/show_bug.cgi?id=298095 rdar://159440523 Reviewed by Sam Weinig and Matthieu Dubet. https://drafts.csswg.org/css-mixins/#function-body @function body accepts nested @media and other conditional rules along with custom properties so the parsing is more like regular style rules. Also add most of the CSSOM to get some test coverage, https://drafts.csswg.org/css-mixins/#cssom * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/css/css-mixins/at-function-cssom-expected.txt: Type parameter serialization is not implemented yet. * Source/WebCore/CMakeLists.txt: * Source/WebCore/DerivedSources-input.xcfilelist: * Source/WebCore/DerivedSources-output.xcfilelist: * Source/WebCore/DerivedSources.make: * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/bindings/js/JSCSSRuleCustom.cpp: (WebCore::toJSNewlyCreated): * Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::toJSNewlyCreated): * Source/WebCore/bindings/js/WebCoreBuiltinNames.h: * Source/WebCore/css/CSSFunctionDeclarations.cpp: Copied from Source/WebCore/css/StyleRuleFunction.cpp. (WebCore::CSSFunctionDeclarations::CSSFunctionDeclarations): (WebCore::CSSFunctionDeclarations::style): (WebCore::CSSFunctionDeclarations::cssText const): (WebCore::CSSFunctionDeclarations::reattach): * Source/WebCore/css/CSSFunctionDeclarations.h: Copied from Source/WebCore/css/StyleRuleFunction.cpp. * Source/WebCore/css/CSSFunctionDeclarations.idl: Copied from Source/WebCore/css/StyleRuleFunction.cpp. * Source/WebCore/css/CSSFunctionDescriptors.cpp: Copied from Source/WebCore/css/StyleRuleFunction.cpp. (WebCore::CSSFunctionDescriptors::CSSFunctionDescriptors): (WebCore::CSSFunctionDescriptors::ruleType const): (WebCore::CSSFunctionDescriptors::result const): (WebCore::CSSFunctionDescriptors::setResult): * Source/WebCore/css/CSSFunctionDescriptors.h: Copied from Source/WebCore/css/StyleRuleFunction.cpp. * Source/WebCore/css/CSSFunctionDescriptors.idl: Copied from Source/WebCore/css/StyleRuleFunction.cpp. * Source/WebCore/css/CSSFunctionRule.cpp: Added. (WebCore::CSSFunctionRule::create): (WebCore::CSSFunctionRule::CSSFunctionRule): (WebCore::CSSFunctionRule::name const): (WebCore::CSSFunctionRule::getParameters const): (WebCore::CSSFunctionRule::returnType const): (WebCore::CSSFunctionRule::cssText const): (WebCore::CSSFunctionRule::styleRuleFunction const): * Source/WebCore/css/CSSFunctionRule.h: Copied from Source/WebCore/css/StyleRuleFunction.cpp. * Source/WebCore/css/CSSFunctionRule.idl: Copied from Source/WebCore/css/StyleRuleFunction.cpp. * Source/WebCore/css/CSSStyleDeclaration.h: * Source/WebCore/css/PropertySetCSSDescriptors.cpp: (WebCore::PropertySetCSSDescriptors::getPropertyValue): * Source/WebCore/css/StyleRule.cpp: (WebCore::StyleRuleBase::createCSSOMWrapper const): * Source/WebCore/css/StyleRule.h: (WebCore::StyleRuleBase::isGroupRule const): * Source/WebCore/css/StyleRuleFunction.cpp: (WebCore::StyleRuleFunctionDeclarations::mutableProperties): * Source/WebCore/css/StyleRuleFunction.h: * Source/WebCore/css/parser/CSSParser.cpp: (WebCore::CSSParser::consumeAtRule): Add an allow mode to only allow "conditional group rules". (WebCore::CSSParser::consumeNestedGroupRules): (WebCore::CSSParser::consumeFunctionRule): (WebCore::CSSParser::consumeBlockContent): (WebCore::CSSParser::consumeDeclarationRuleListInNewNestingContext): (WebCore::CSSParser::consumeDeclarationList): (WebCore::CSSParser::consumeDeclarationRuleList): @function body takes <declaration-rule-list>, add parsing support for it. (WebCore::CSSParser::consumeStyleBlock): (WebCore::ruleDoesNotAllowImportant): * Source/WebCore/css/parser/CSSParser.h: (WebCore::CSSParser::isStyleNestedContext const): (WebCore::CSSParser::isFunctionNestedContext const): * Source/WebCore/css/parser/CSSParserEnum.h: * Source/WebCore/css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseValue): (WebCore::consumeFunctionDescriptor): * Source/WebCore/css/query/MediaQueryParser.h: Canonical link: https://commits.webkit.org/299544@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes