diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_filter_primitive.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_filter_primitive.cc index 69046a512c3ee..29cbccb797563 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_filter_primitive.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_filter_primitive.cc @@ -41,7 +41,7 @@ LayoutSVGFilterPrimitive::LayoutSVGFilterPrimitive( : LayoutObject(filter_primitive_element) {} static bool CurrentColorChanged(StyleDifference diff, const StyleColor& color) { - return diff.text_decoration_or_color_changed && color.IsCurrentColor(); + return diff.text_decoration_or_color_changed && color.DependsOnCurrentColor(); } static void CheckForColorChange(SVGFilterPrimitiveStandardAttributes& element, @@ -49,10 +49,11 @@ static void CheckForColorChange(SVGFilterPrimitiveStandardAttributes& element, StyleDifference diff, const StyleColor& old_color, const StyleColor& new_color) { - // If the change from/to 'currentcolor' then invalidate the filter - // chain so that it is rebuilt. (Makes sure the 'tainted' flag is - // propagated.) - if (new_color.IsCurrentColor() != old_color.IsCurrentColor()) { + // If the dependency on 'currentcolor' changes (including via + // unresolved color functions like color-mix(currentColor, ...)) then + // invalidate the filter chain so that it is rebuilt. (Makes sure the + // 'tainted' flag is propagated.) + if (new_color.DependsOnCurrentColor() != old_color.DependsOnCurrentColor()) { element.Invalidate(); return; }