[webkit-changes] [WebKit/WebKit] 0b2824: Change unclear Color::isValid() to explicit isCurr...

Matthieu Dubet noreply at github.com
Tue Sep 20 10:26:24 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0b28244472f04925b48519bbe131ad84739c621e
      https://github.com/WebKit/WebKit/commit/0b28244472f04925b48519bbe131ad84739c621e
  Author: Matthieu Dubet <m_dubet at apple.com>
  Date:   2022-09-20 (Tue, 20 Sep 2022)

  Changed paths:
    M Source/WebCore/animation/CSSPropertyAnimation.cpp
    M Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp

  Log Message:
  -----------
  Change unclear Color::isValid() to explicit isCurrentColor().
https://bugs.webkit.org/show_bug.cgi?id=245424

Reviewed by Antoine Quint.

Due to the representation of "current color" as "invalid color" in WebCore,
they are two functionally equivalent functions in the codebase:
- Color::isValid()
- RenderStyle::isCurrentColor(Color) which is implemented as "return !color.isValid()".

The second one makes the intention of the check clearer and should be preferred.

* Source/WebCore/animation/CSSPropertyAnimation.cpp:
* Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp:
(WebCore::SVGAnimationColorFunction::calculateDistance const):

Canonical link: https://commits.webkit.org/254683@main




More information about the webkit-changes mailing list