Skip to content
Permalink
Browse files
[web-animations] implement correct additivity support for the filter …
…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 bbb772a0a698210c840c1e1a9e4de7b070820d39
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
@@ -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
@@ -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();

0 comments on commit bbb772a

Please sign in to comment.