[webkit-changes] [WebKit/WebKit] 63a655: Repaint issues with currentColor & color-mix()
Tim Nguyen
noreply at github.com
Sat Apr 29 07:56:00 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 63a655702b0109ffa21df1c21f7307af5bc8e598
https://github.com/WebKit/WebKit/commit/63a655702b0109ffa21df1c21f7307af5bc8e598
Author: Tim Nguyen <ntim at apple.com>
Date: 2023-04-29 (Sat, 29 Apr 2023)
Changed paths:
A LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/color-mix-currentcolor-border-repaint-expected.xht
A LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/color-mix-currentcolor-border-repaint-parent-expected.xht
A LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/color-mix-currentcolor-border-repaint-parent.html
A LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/color-mix-currentcolor-border-repaint.html
A LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/currentcolor-border-repaint-parent-expected.xht
A LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/currentcolor-border-repaint-parent.html
M Source/WebCore/animation/CSSPropertyAnimation.cpp
M Source/WebCore/css/StyleColor.cpp
M Source/WebCore/css/StyleColor.h
M Source/WebCore/css/color/CSSUnresolvedColor.cpp
M Source/WebCore/css/color/CSSUnresolvedColor.h
M Source/WebCore/editing/EditingStyle.cpp
M Source/WebCore/rendering/style/BorderData.cpp
M Source/WebCore/rendering/style/RenderStyle.cpp
M Source/WebCore/rendering/style/RenderStyle.h
M Source/WebCore/rendering/style/SVGRenderStyle.cpp
M Source/WebCore/rendering/style/StyleGradientImage.cpp
M Source/WebCore/style/ElementRuleCollector.cpp
M Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp
Log Message:
-----------
Repaint issues with currentColor & color-mix()
https://bugs.webkit.org/show_bug.cgi?id=256118
rdar://104872702
Reviewed by Antti Koivisto.
There are 2 different issues:
1. Raw `currentColor` (even without `color-mix()`) will not repaint if the color was changed on the ancestors
2. Using `currentColor` inside `color-mix()` will not repaint if the color was changed (either on the element itself or the ancestors)
1. is fixed by taking in account currentColor changes in `RenderStyle::changeRequiresRepaint()`
2. is fixed by introducing a `containsCurrentColor()` helper taking in account nested currentColor inside `color-mix()`, and replacing appropriate `isCurrentColor()` checks.
Also remove `RenderStyle::isCurrentColor()` since it does not add much value.
* LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/color-mix-currentcolor-border-repaint-expected.xht: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/color-mix-currentcolor-border-repaint-parent-expected.xht: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/color-mix-currentcolor-border-repaint-parent.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/color-mix-currentcolor-border-repaint.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/currentcolor-border-repaint-parent-expected.xht: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/currentcolor-border-repaint-parent.html: Added.
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::blendSyntaxValues):
* Source/WebCore/css/StyleColor.cpp:
(WebCore::StyleColor::containsCurrentColor):
(WebCore::StyleColor::containsCurrentColor const):
* Source/WebCore/css/StyleColor.h:
* Source/WebCore/css/color/CSSUnresolvedColor.cpp:
(WebCore::CSSUnresolvedColor::containsCurrentColor const):
* Source/WebCore/css/color/CSSUnresolvedColor.h:
* Source/WebCore/editing/EditingStyle.cpp:
(WebCore::EditingStyle::removeTextFillAndStrokeColorsIfNeeded):
* Source/WebCore/rendering/style/BorderData.cpp:
(WebCore::BorderData::isEquivalentForPainting const):
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaint const):
(WebCore::RenderStyle::colorResolvingCurrentColor const):
* Source/WebCore/rendering/style/RenderStyle.h:
(WebCore::RenderStyle::currentColor):
(WebCore::RenderStyle::isCurrentColor): Deleted.
* Source/WebCore/rendering/style/SVGRenderStyle.cpp:
(WebCore::colorChangeRequiresRepaint):
* Source/WebCore/rendering/style/StyleGradientImage.cpp:
(WebCore::stopsAreCacheable):
* Source/WebCore/style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::addMatchedProperties):
* Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp:
(WebCore::SVGAnimationColorFunction::calculateDistance const):
Canonical link: https://commits.webkit.org/263531@main
More information about the webkit-changes
mailing list