Bug 145386

Summary: Backdrop filters don't animate
Product: WebKit Reporter: Dean Jackson <dino>
Component: New BugsAssignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
simon.fraser: review+
Patch none

Description Dean Jackson 2015-05-26 13:39:33 PDT
Backdrop filters don't animate
Comment 1 Radar WebKit Bug Importer 2015-05-26 13:41:25 PDT
<rdar://problem/21110037>
Comment 2 Dean Jackson 2015-05-26 14:00:41 PDT
Created attachment 253736 [details]
Patch
Comment 3 Simon Fraser (smfr) 2015-05-26 14:13:10 PDT
Comment on attachment 253736 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=253736&action=review

> Source/WebCore/page/animation/CSSPropertyAnimation.cpp:204
> +    if (anim->filterFunctionListsMatch() || anim->backdropFilterFunctionListsMatch())
>          result = blendFilterOperations(anim, from, to, progress);

This doesn't seem right. Can't a KeyframeAnimaiton have a matching filter list, and non-matching backdrop filter list or vice versa?

> Source/WebCore/page/animation/ImplicitAnimation.cpp:328
> +    if (val->operations().isEmpty())
> +        val = toVal;
> +
> +    if (val->operations().isEmpty())
> +        return;
> +
> +    // An empty filter list matches anything.
> +    if (val != toVal && !toVal->operations().isEmpty() && !val->operationsMatch(*toVal))
> +        return;

We should share this part of the code with filters.
Comment 4 Darin Adler 2015-05-26 14:17:35 PDT
Comment on attachment 253736 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=253736&action=review

> Source/WebCore/page/animation/ImplicitAnimation.cpp:318
> +    const FilterOperations* val = &m_fromStyle->backdropFilter();
> +    const FilterOperations* toVal = &m_toStyle->backdropFilter();

I think we could spring for the two extra letters "ue" and call these value instead of val.

I suggest that toValue be a reference instead of a pointer.

> Source/WebCore/page/animation/KeyframeAnimation.cpp:461
> +    const FilterOperations* firstVal = &m_keyframes[firstNonEmptyFilterKeyframeIndex].style()->backdropFilter();

I suggest a reference instead of a pointer. Also suggest using the word "value" instead of the non-word "val". Also seems that auto& would work well here.

> Source/WebCore/page/animation/KeyframeAnimation.cpp:464
> +        const KeyframeValue& currentKeyframe = m_keyframes[i];

Doesn’t seem like we need this local variable. Should just use m_keyframes[i] directly.

> Source/WebCore/page/animation/KeyframeAnimation.cpp:465
> +        const FilterOperations* val = &currentKeyframe.style()->backdropFilter();

I suggest a reference instead of a pointer. Also suggest using the word "value" instead of the non-word "val". Also seems that auto& would work well here.

> Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:245
> +        return "backdropFilters";

Should use ASCIILiteral here.

In fact, I think the return type of this function should be ASCIILiteral instead of String.
Comment 5 Dean Jackson 2015-05-26 15:19:43 PDT
(In reply to comment #4)
> Comment on attachment 253736 [details]
> Patch

Thanks Darin and Simon.
Comment 6 Dean Jackson 2015-05-27 11:10:10 PDT
Created attachment 253795 [details]
Patch
Comment 7 Dean Jackson 2015-05-27 11:16:21 PDT
Committed r184908: <http://trac.webkit.org/changeset/184908>