Skip to content

Commit

Permalink
[web-animations] implement correct additivity support for the filter …
Browse files Browse the repository at this point in the history
…property

https://bugs.webkit.org/show_bug.cgi?id=248225

Reviewed by Tim Nguyen.

When blending with additivity, simply concatenate the two filter lists.

* LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFilterOperations):

Canonical link: https://commits.webkit.org/256955@main
  • Loading branch information
graouts committed Nov 22, 2022
1 parent bbb9a28 commit bbb772a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Expand Up @@ -197,8 +197,8 @@ PASS fill-rule (type: discrete) has testAddition function
PASS fill-rule: "nonzero" onto "evenodd"
PASS fill-rule: "evenodd" onto "nonzero"
PASS filter (type: filterList) has testAddition function
FAIL filter: blur on blur assert_equals: The value should be blur(10px) blur(20px) at 0ms expected "blur(10px) blur(20px)" but got "blur(30px)"
FAIL filter: different filter functions assert_equals: The value should be blur(10px) brightness(0.8) at 0ms expected "blur(10px) brightness(0.8)" but got "brightness(0.8)"
PASS filter: blur on blur
PASS filter: different filter functions
PASS flex-basis (type: lengthPercentageOrCalc) has testAddition function
PASS flex-basis: length
PASS flex-basis: length of rem
Expand Down
8 changes: 8 additions & 0 deletions Source/WebCore/animation/CSSPropertyAnimation.cpp
Expand Up @@ -330,6 +330,14 @@ static inline RefPtr<FilterOperation> blendFunc(FilterOperation* from, FilterOpe

static inline FilterOperations blendFilterOperations(const FilterOperations& from, const FilterOperations& to, const CSSPropertyBlendingContext& context)
{
if (context.compositeOperation == CompositeOperation::Add) {
ASSERT(context.progress == 1.0);
FilterOperations resultOperations;
resultOperations.operations().appendVector(from.operations());
resultOperations.operations().appendVector(to.operations());
return resultOperations;
}

FilterOperations result;
size_t fromSize = from.operations().size();
size_t toSize = to.operations().size();
Expand Down

0 comments on commit bbb772a

Please sign in to comment.