Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 25aee767cc7bb6f3445ed6b9356292f58f42d731
https://github.com/WebKit/WebKit/commit/25aee767cc7bb6f3445ed6b9356292f58f42d731
Author: Sam Weinig <[email protected]>
Date: 2025-04-23 (Wed, 23 Apr 2025)
Changed paths:
M LayoutTests/fast/css/background-position-serialize-expected.txt
M LayoutTests/fast/css/background-position-serialize.html
M
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-position-computed-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-position-x-computed-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-position-y-computed-expected.txt
M LayoutTests/transitions/background-position-transitions-expected.txt
M LayoutTests/transitions/background-position-transitions.html
M Source/WebCore/Sources.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
A Source/WebCore/css/CSSPositionValue.cpp
A Source/WebCore/css/CSSPositionValue.h
M Source/WebCore/css/CSSToStyleMap.cpp
M Source/WebCore/css/CSSValue.cpp
M Source/WebCore/css/CSSValue.h
M Source/WebCore/css/ComputedStyleExtractor.cpp
M Source/WebCore/css/parser/CSSPropertyParser.cpp
M Source/WebCore/css/parser/CSSPropertyParserConsumer+Position.cpp
M Source/WebCore/css/parser/CSSPropertyParserConsumer+Position.h
M Source/WebCore/css/parser/CSSPropertyParserConsumer+Shapes.cpp
M Source/WebCore/css/values/primitives/CSSPosition.cpp
M Source/WebCore/css/values/primitives/CSSPosition.h
M Source/WebCore/rendering/BackgroundPainter.cpp
M Source/WebCore/rendering/style/FillLayer.cpp
M Source/WebCore/rendering/style/FillLayer.h
M Source/WebCore/style/StyleBuilderConverter.h
M Source/WebCore/style/StyleInterpolationWrappers.h
M Source/WebCore/style/values/primitives/StylePosition.cpp
M Source/WebCore/style/values/primitives/StylePosition.h
M
Source/WebCore/style/values/primitives/StylePrimitiveNumericTypes+Conversions.h
Log Message:
-----------
Unify all <position> / <bg-position> around strong CSS value representation
https://bugs.webkit.org/show_bug.cgi?id=291960
Reviewed by Darin Adler.
- Removes older <position> / <bg-position> parsing code, replacing it with
the strong value parser wrapped in new CSSPositionValue, CSSPositionXValue
and CSSPositionYValue CSSValue derived classes.
- Simplifies background-position style representation to be consistent with
other position usages, removing the origin fields and using the calc(100% - x)
for opposite edge instead.
- Updates serialization of computed value of background-position to match
the spec, always serializing the offset as a pair of <length-position> values.
* LayoutTests/fast/css/background-position-serialize-expected.txt:
* LayoutTests/fast/css/background-position-serialize.html:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-position-computed-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-position-x-computed-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-position-y-computed-expected.txt:
* LayoutTests/transitions/background-position-transitions-expected.txt:
* LayoutTests/transitions/background-position-transitions.html:
- Update tests and results for updated background-position serialization.
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/css/CSSPositionValue.cpp: Added.
* Source/WebCore/css/CSSPositionValue.h: Added.
* Source/WebCore/css/CSSValue.cpp:
* Source/WebCore/css/CSSValue.h:
- Add new CSSPositionValue derived classes.
* Source/WebCore/css/CSSToStyleMap.cpp:
- Update to use strong value conversion.
* Source/WebCore/css/ComputedStyleExtractor.cpp:
- Update for removal of explicit origin.
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
- Update to call strong value parser, using new split operator as needed.
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Position.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Position.h:
- Replace old non-strong value parsers with strong value equivalents.
* Source/WebCore/css/values/primitives/CSSPosition.cpp:
* Source/WebCore/css/values/primitives/CSSPosition.h:
- Add support for 3-component variant used by <bg-position>.
- Adds a new split operator for taking a CSS::Position and getting
a CSS::PositionX and CSS::PositionY out of it. Used by shorthand
parsers.
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Shapes.cpp:
- Update for new name, TwoComponentPositionHorizontalVertical.
* Source/WebCore/rendering/BackgroundPainter.cpp:
* Source/WebCore/rendering/style/FillLayer.cpp:
* Source/WebCore/rendering/style/FillLayer.h:
* Source/WebCore/style/StyleInterpolationWrappers.h:
- Remove explicit originX/originY for background position, instead
using calc(100% - x) for opposite edge cases (matching other
position usages).
* Source/WebCore/style/StyleBuilderConverter.h:
- Simplify conversion to call strong value conversion code.
* Source/WebCore/style/values/primitives/StylePosition.cpp:
* Source/WebCore/style/values/primitives/StylePosition.h:
- Refactor conversion code to more easily handle more cases, adding in
the 3-component variant.
*
Source/WebCore/style/values/primitives/StylePrimitiveNumericTypes+Conversions.h:
- Fix conversion issue where zoom was not applied to calc() used
in <length-percentage> values. We now always use canonicalize(),
which is much nicer.
Canonical link: https://commits.webkit.org/294038@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes