[webkit-changes] [WebKit/WebKit] 7240fd: [css-anchor-position-1] Evaluate anchor() in calc()
Antti Koivisto
noreply at github.com
Thu Sep 26 01:43:41 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7240fde26436fed0bf903826c90f596c0207c5ae
https://github.com/WebKit/WebKit/commit/7240fde26436fed0bf903826c90f596c0207c5ae
Author: Antti Koivisto <antti at apple.com>
Date: 2024-09-26 (Thu, 26 Sep 2024)
Changed paths:
M LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-query-fallback-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-typed-om-expected.txt
M Source/WebCore/css/CSSToLengthConversionData.cpp
M Source/WebCore/css/CSSToLengthConversionData.h
M Source/WebCore/css/calc/CSSCalcTree+Evaluation.cpp
M Source/WebCore/css/calc/CSSCalcTree+Parser.cpp
M Source/WebCore/css/calc/CSSCalcTree+Serialization.cpp
M Source/WebCore/css/calc/CSSCalcTree+Simplification.cpp
M Source/WebCore/style/AnchorPositionEvaluator.cpp
M Source/WebCore/style/AnchorPositionEvaluator.h
M Source/WebCore/style/StyleBuilderState.cpp
M Source/WebCore/style/StyleResolver.h
Log Message:
-----------
[css-anchor-position-1] Evaluate anchor() in calc()
https://bugs.webkit.org/show_bug.cgi?id=280328
rdar://problem/136659879
Reviewed by Sam Weinig.
calc(anchor(--foo)) evaluation support.
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-query-fallback-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-typed-om-expected.txt:
* Source/WebCore/css/CSSToLengthConversionData.cpp:
(WebCore::CSSToLengthConversionData::CSSToLengthConversionData):
* Source/WebCore/css/CSSToLengthConversionData.h:
Add Style::BuilderState to the conversion data. This is used for resolving anchor() functions.
It is only available when the conversion is invoked from Style::Builder but that is also the
time when anchor references must be resolved.
(WebCore::CSSToLengthConversionData::styleBuilderState const):
* Source/WebCore/css/calc/CSSCalcTree+Evaluation.cpp:
(WebCore::CSSCalc::evaluate):
* Source/WebCore/css/calc/CSSCalcTree+Evaluation.h:
* Source/WebCore/css/calc/CSSCalcTree+Parser.cpp:
(WebCore::CSSCalc::consumeAnchor):
* Source/WebCore/css/calc/CSSCalcTree+Serialization.cpp:
(WebCore::CSSCalc::serializeMathFunctionArguments):
* Source/WebCore/css/calc/CSSCalcTree+Simplification.cpp:
(WebCore::CSSCalc::simplify):
* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::Style::computeInsetValue):
(WebCore::Style::AnchorPositionEvaluator::resolveAnchorValue):
(WebCore::Style::AnchorPositionEvaluator::evaluate):
Refactor a bit so when can share the code between the old CSSAnchorValue implementation and
the new calc() based implementation.
* Source/WebCore/style/AnchorPositionEvaluator.h:
* Source/WebCore/style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::BuilderState):
(WebCore::Style::BuilderState::cssPropertyID const):
* Source/WebCore/style/StyleResolver.h:
Canonical link: https://commits.webkit.org/284271@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