Changeset 290122 in webkit


Ignore:
Timestamp:
Feb 18, 2022 7:35:59 AM (5 months ago)
Author:
graouts@webkit.org
Message:

[custom-effect] Animations associated with a custom effect should appear in document.getAnimations() result
https://bugs.webkit.org/show_bug.cgi?id=236828

Reviewed by Dean Jackson.

Source/WebCore:

Test: webanimations/custom-effect/custom-effect-get-animations.html

  • dom/Document.cpp:

(WebCore::Document::matchingAnimations):

LayoutTests:

  • webanimations/custom-effect/custom-effect-get-animations-expected.txt: Added.
  • webanimations/custom-effect/custom-effect-get-animations.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r290121 r290122  
     12022-02-18  Antoine Quint  <graouts@webkit.org>
     2
     3        [custom-effect] Animations associated with a custom effect should appear in document.getAnimations() result
     4        https://bugs.webkit.org/show_bug.cgi?id=236828
     5
     6        Reviewed by Dean Jackson.
     7
     8        * webanimations/custom-effect/custom-effect-get-animations-expected.txt: Added.
     9        * webanimations/custom-effect/custom-effect-get-animations.html: Added.
     10
    1112022-02-18  Antoine Quint  <graouts@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r290121 r290122  
     12022-02-18  Antoine Quint  <graouts@webkit.org>
     2
     3        [custom-effect] Animations associated with a custom effect should appear in document.getAnimations() result
     4        https://bugs.webkit.org/show_bug.cgi?id=236828
     5
     6        Reviewed by Dean Jackson.
     7
     8        Test: webanimations/custom-effect/custom-effect-get-animations.html
     9
     10        * dom/Document.cpp:
     11        (WebCore::Document::matchingAnimations):
     12
    1132022-02-18  Antoine Quint  <graouts@webkit.org>
    214
  • trunk/Source/WebCore/dom/Document.cpp

    r290116 r290122  
    5454#include "ContentfulPaintChecker.h"
    5555#include "CookieJar.h"
     56#include "CustomEffect.h"
    5657#include "CustomElementReactionQueue.h"
    5758#include "CustomElementRegistry.h"
     
    85168517
    85178518    Vector<RefPtr<WebAnimation>> animations;
     8519
     8520    auto effectCanBeListed = [&](AnimationEffect* effect) {
     8521        if (is<CustomEffect>(effect))
     8522            return true;
     8523
     8524        if (auto* keyframeEffect = dynamicDowncast<KeyframeEffect>(effect)) {
     8525            auto* target = keyframeEffect->target();
     8526            return target && target->isConnected() && &target->document() == this && function(*target);
     8527        }
     8528
     8529        return false;
     8530    };
     8531
    85188532    for (auto* animation : WebAnimation::instances()) {
    8519         if (!animation->isRelevant() || !is<KeyframeEffect>(animation->effect()))
    8520             continue;
    8521 
    8522         auto* target = downcast<KeyframeEffect>(*animation->effect()).target();
    8523         if (target && target->isConnected() && &target->document() == this && function(*target))
     8533        if (animation->isRelevant() && effectCanBeListed(animation->effect()))
    85248534            animations.append(animation);
    85258535    }
Note: See TracChangeset for help on using the changeset viewer.