Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c04f5a04bc5000dc40cece68f299b03eefc945ee
https://github.com/WebKit/WebKit/commit/c04f5a04bc5000dc40cece68f299b03eefc945ee
Author: Kiet Ho <[email protected]>
Date: 2026-09-21 (Mon, 21 Sep 2026)
Changed paths:
M Source/WebCore/Headers.cmake
M Source/WebCore/Sources.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/style/StyleBuilderCustom.h
M Source/WebCore/style/StyleColorResolver.cpp
M Source/WebCore/style/StyleColorResolver.h
M
Source/WebCore/style/computed/StyleComputedStyleProperties+GettersCustomInlines.h
M Source/WebCore/style/values/color/StyleColor.cpp
M Source/WebCore/style/values/color/StyleColor.h
M Source/WebCore/style/values/color/StyleColorLayers.cpp
M Source/WebCore/style/values/color/StyleColorLayers.h
M Source/WebCore/style/values/color/StyleColorMix.cpp
M Source/WebCore/style/values/color/StyleColorMix.h
M Source/WebCore/style/values/color/StyleContrastColor.cpp
M Source/WebCore/style/values/color/StyleContrastColor.h
M Source/WebCore/style/values/color/StyleCurrentAccentColor.h
M Source/WebCore/style/values/color/StyleCurrentColor.cpp
M Source/WebCore/style/values/color/StyleCurrentColor.h
M Source/WebCore/style/values/color/StyleRelativeAlphaColor.cpp
M Source/WebCore/style/values/color/StyleRelativeAlphaColor.h
M Source/WebCore/style/values/color/StyleRelativeColor.h
M Source/WebCore/style/values/color/StyleResolvedColor.h
A Source/WebCore/style/values/color/StyleResolvedColors.cpp
A Source/WebCore/style/values/color/StyleResolvedColors.h
M Source/WebCore/style/values/filter-effects/StyleDropShadowFunction.cpp
Log Message:
-----------
[AccentColor] Introduce Style::ResolvedColors
rdar://187666049
https://bugs.webkit.org/show_bug.cgi?id=324433
Reviewed by Sam Weinig.
Currently, Style::CurrentColor is resolved to the current color by supplying
the current color to Style::resolveColor(), then it gets plumbed to
Style::resolveColor(const CurrentColor&), which simply returns it.
To implement AccentColor following the current accent color, we'd have to
plumb the current accent color the same way as the current color. The obvious
solution is to add another parameter, but we don't want to do that every time
a new "current X" color is introduced.
This patch introduces Style::ResolvedColors, which acts as a storage of colors
needed to resolve "current X" colors like currentColor and AccentColor. A
Style::ResolvedColors is created by pulling out the needed colors from a
ComputedStyle. Then ResolvedColors is given to Style::resolveColor() to
help resolve "current X" colors.
For now it only stores the current `color` property, but future patches will
add accent color to it, so it can resolve current accent color.
No new behaviors, tested by existing test suite.
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyInitialColor):
(WebCore::Style::BuilderCustom::applyValueColor):
(WebCore::Style::BuilderCustom::applyHighlightInheritColor):
* Source/WebCore/style/StyleColorResolver.cpp:
(WebCore::Style::ColorResolver::colorResolvingCurrentColor const):
(WebCore::Style::ColorResolver::visitedLinkColorResolvingCurrentColor const):
* Source/WebCore/style/StyleColorResolver.h:
(WebCore::Style::ColorPropertyResolver<ColorTraits>::colorResolvingCurrentColor
const):
(WebCore::Style::requires):
*
Source/WebCore/style/computed/StyleComputedStyleProperties+GettersCustomInlines.h:
(WebCore::Style::ColorPropertyTraits<PropertyNameConstant<CSSPropertyTextDecorationColor>>::colorResolvingCurrentColor):
(WebCore::Style::ColorPropertyTraits<PropertyNameConstant<CSSPropertyTextDecorationColor>>::visitedLinkColorResolvingCurrentColor):
* Source/WebCore/style/values/color/StyleColor.cpp:
(WebCore::Style::Color::resolveColor const):
(WebCore::Style::resolveColor):
* Source/WebCore/style/values/color/StyleColor.h:
* Source/WebCore/style/values/color/StyleColorLayers.cpp:
(WebCore::Style::resolveColor):
* Source/WebCore/style/values/color/StyleColorLayers.h:
* Source/WebCore/style/values/color/StyleColorMix.cpp:
(WebCore::Style::resolveColor):
* Source/WebCore/style/values/color/StyleColorMix.h:
* Source/WebCore/style/values/color/StyleContrastColor.cpp:
(WebCore::Style::resolveColor):
* Source/WebCore/style/values/color/StyleContrastColor.h:
* Source/WebCore/style/values/color/StyleCurrentAccentColor.h:
(WebCore::Style::resolveColor):
* Source/WebCore/style/values/color/StyleCurrentColor.h:
(WebCore::Style::resolveColor):
* Source/WebCore/style/values/color/StyleRelativeAlphaColor.cpp:
(WebCore::Style::resolveColor):
* Source/WebCore/style/values/color/StyleRelativeAlphaColor.h:
* Source/WebCore/style/values/color/StyleRelativeColor.h:
(WebCore::Style::resolveColor):
* Source/WebCore/style/values/color/StyleResolvedColor.h:
(WebCore::Style::resolveColor):
* Source/WebCore/style/values/color/StyleResolvedColors.cpp: Copied from
Source/WebCore/style/values/color/StyleCurrentColor.h.
(WebCore::Style::ResolvedColors::ResolvedColors):
(WebCore::Style::ResolvedColors::fromStyle):
(WebCore::Style::ResolvedColors::fromVisitedLinkStyle):
* Source/WebCore/style/values/color/StyleResolvedColors.h: Copied from
Source/WebCore/style/values/color/StyleCurrentColor.h.
(WebCore::Style::ResolvedColors::currentColor const):
* Source/WebCore/style/values/filter-effects/StyleDropShadowFunction.cpp:
(WebCore::Style::Ref<FilterEffect>>::operator):
(WebCore::Style::ToPlatform<DropShadow>::operator):
* Source/WebCore/style/values/color/StyleCurrentColor.cpp:
(WebCore::Style::resolveColor):
Canonical link: https://commits.webkit.org/321525@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications