[webkit-changes] [WebKit/WebKit] cc9941: [css-anchor-position-1] Implement parsing `@positi...
Kiet Ho
noreply at github.com
Sun Dec 8 19:02:02 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cc994137838b32d393c63fb549185375a96e2354
https://github.com/WebKit/WebKit/commit/cc994137838b32d393c63fb549185375a96e2354
Author: Kiet Ho <kiet.ho at apple.com>
Date: 2024-12-08 (Sun, 08 Dec 2024)
Changed paths:
M LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/at-position-try-allowed-declarations-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/at-position-try-cssom-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/at-position-try-invalidation-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/at-position-try-invalidation-shadow-dom-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/at-position-try-parse-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/last-successful-change-try-rule-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/SaferCPPExpectations/RefCntblBaseVirtualDtorExpectations
M Source/WebCore/SaferCPPExpectations/UncountedCallArgsCheckerExpectations
M Source/WebCore/Sources.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/bindings/js/JSCSSRuleCustom.cpp
M Source/WebCore/bindings/js/WebCoreBuiltinNames.h
A Source/WebCore/css/CSSPositionTryRule.cpp
A Source/WebCore/css/CSSPositionTryRule.h
A Source/WebCore/css/CSSPositionTryRule.idl
M Source/WebCore/css/CSSProperty.cpp
M Source/WebCore/css/CSSProperty.h
M Source/WebCore/css/StyleRule.cpp
M Source/WebCore/css/StyleRule.h
M Source/WebCore/css/StyleRuleType.h
M Source/WebCore/css/StyleSheetContents.cpp
M Source/WebCore/css/parser/CSSAtRuleID.cpp
M Source/WebCore/css/parser/CSSAtRuleID.h
M Source/WebCore/css/parser/CSSParserImpl.cpp
M Source/WebCore/css/parser/CSSParserImpl.h
M Source/WebCore/css/parser/CSSPropertyParser.cpp
M Source/WebCore/css/parser/CSSPropertyParser.h
M Source/WebCore/inspector/InspectorStyleSheet.cpp
M Source/WebCore/style/AnchorPositionEvaluator.cpp
M Source/WebCore/style/RuleSetBuilder.cpp
Log Message:
-----------
[css-anchor-position-1] Implement parsing `@position-try` rule
rdar://129789726
https://bugs.webkit.org/show_bug.cgi?id=275455
Reviewed by Antti Koivisto.
Implement parsing `@position-try` rule in CSS Anchor Positioning spec.
Note that the rules are only parsed and not yet collected for use in
`position-try-fallbacks`. This will be implemented in a future patch,
at least after parsing support for `position-try-fallbacks` is
completed.
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/at-position-try-allowed-declarations-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/at-position-try-cssom-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/at-position-try-invalidation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/at-position-try-invalidation-shadow-dom-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/at-position-try-parse-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/last-successful-change-try-rule-expected.txt:
* Source/WebCore/CMakeLists.txt:
* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources-output.xcfilelist:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/SaferCPPExpectations/RefCntblBaseVirtualDtorExpectations:
Added exception for CSSPositionTryRule, which inherits StyleRuleBase.
StyleRuleBase doesn't define a virtual destructor, which trips up the
checker. This is okay since StyleRuleBase defines its own delete operator
that calls the correct destructor depends on the derived type. See
https://github.com/WebKit/WebKit/pull/37285.
* Source/WebCore/SaferCPPExpectations/UncountedCallArgsCheckerExpectations:
Added exception for JSCSSPositionTryRule.cpp. Auto-generated file so can't
be fixed except by fixing the code generator.
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/bindings/js/JSCSSRuleCustom.cpp:
(WebCore::toJSNewlyCreated):
* Source/WebCore/bindings/js/WebCoreBuiltinNames.h:
* Source/WebCore/css/CSSPositionTryRule.cpp: Added.
(WebCore::StyleRulePositionTry::create):
(WebCore::StyleRulePositionTry::StyleRulePositionTry):
(WebCore::StyleRulePositionTry::protectedMutableProperties):
(WebCore::CSSPositionTryRule::create):
(WebCore::CSSPositionTryRule::CSSPositionTryRule):
(WebCore::CSSPositionTryRule::cssText const):
(WebCore::CSSPositionTryRule::reattach):
(WebCore::CSSPositionTryRule::name const):
(WebCore::CSSPositionTryRule::style):
* Source/WebCore/css/CSSPositionTryRule.h: Added.
(isType):
* Source/WebCore/css/CSSPositionTryRule.idl: Added.
* Source/WebCore/css/CSSProperty.cpp:
(WebCore::CSSProperty::isInsetProperty): Added some inset properties that we missed.
(WebCore::CSSProperty::isSizingProperty): Moved from AnchorPositionEvaluator.cpp
(WebCore::CSSProperty::isMarginProperty): Moved from AnchorPositionEvaluator.cpp
* Source/WebCore/css/CSSProperty.h:
* Source/WebCore/css/StyleRule.cpp:
(WebCore::StyleRuleBase::visitDerived):
(WebCore::StyleRuleBase::createCSSOMWrapper const):
* Source/WebCore/css/StyleRule.h:
(WebCore::StyleRuleBase::isPositionTryRule const):
* Source/WebCore/css/StyleRuleType.h: Added new StyleRule type for @position-try.
* Source/WebCore/css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::traverseSubresources const):
(WebCore::StyleSheetContents::mayDependOnBaseURL const):
* Source/WebCore/css/parser/CSSAtRuleID.cpp:
(WebCore::cssAtRuleID):
* Source/WebCore/css/parser/CSSAtRuleID.h:
* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeAtRule): Added case to consume @position-try rule.
(WebCore::CSSParserImpl::consumePositionTryRule): Added code to parse @position-try.
(WebCore::ruleDoesNotAllowImportant):
(WebCore::CSSParserImpl::consumeDeclaration): Returned early if current style rule does not
allow !important. Rejected custom properties when parsing @position-try.
* Source/WebCore/css/parser/CSSParserImpl.h:
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseValue): Added code to parse descriptors in @position-try rule.
(WebCore::propertyAllowedInPositionTryRule):
(WebCore::CSSPropertyParser::parsePositionTryDescriptor):
* Source/WebCore/css/parser/CSSPropertyParser.h:
* Source/WebCore/css/query/MediaQueryEvaluator.cpp:
* Source/WebCore/inspector/InspectorStyleSheet.cpp:
(WebCore::flatteningStrategyForStyleRuleType):
* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::Style::AnchorPositionEvaluator::evaluateSize):
(WebCore::Style::isSizingProperty): Moved to CSSProperty.cpp
(WebCore::Style::isMarginProperty): Moved to CSSProperty.cpp
* Source/WebCore/style/RuleSetBuilder.cpp:
(WebCore::Style::RuleSetBuilder::addChildRule):
Canonical link: https://commits.webkit.org/287528@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list