Changeset 261488 in webkit


Ignore:
Timestamp:
May 11, 2020 12:37:24 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

[Web Animations] Document.getAnimations() should only consider document connection and not timeline association
https://bugs.webkit.org/show_bug.cgi?id=211697

Patch by Antoine Quint <Antoine Quint> on 2020-05-11
Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark two additional WPT tests as PASS.

  • web-platform-tests/web-animations/interfaces/DocumentOrShadowRoot/getAnimations-expected.txt:

Source/WebCore:

The Document.getAnimations() function should return any animation running for an element that is a child of the
target Document. We now consider all current animations, regardless of which timeline they might be associated
with. This lets us pass the final two WPT Document.getAnimations() tests.

  • dom/Document.cpp:

(WebCore::Document::matchingAnimations):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r261468 r261488  
     12020-05-11  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Document.getAnimations() should only consider document connection and not timeline association
     4        https://bugs.webkit.org/show_bug.cgi?id=211697
     5
     6        Reviewed by Dean Jackson.
     7
     8        Mark two additional WPT tests as PASS.
     9
     10        * web-platform-tests/web-animations/interfaces/DocumentOrShadowRoot/getAnimations-expected.txt:
     11
    1122020-05-10  Rob Buis  <rbuis@igalia.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/DocumentOrShadowRoot/getAnimations-expected.txt

    r259577 r261488  
    55PASS Document.getAnimations() does not return a disconnected node
    66PASS Document.getAnimations() does not return an animation with a null target
    7 FAIL Document.getAnimations() returns animations on elements inside same-origin iframes assert_equals: expected 1 but got 0
    8 FAIL iframe.contentDocument.getAnimations() returns animations on elements inside same-origin Document assert_equals: expected 1 but got 0
     7PASS Document.getAnimations() returns animations on elements inside same-origin iframes
     8PASS iframe.contentDocument.getAnimations() returns animations on elements inside same-origin Document
    99PASS ShadowRoot.getAnimations() return all animations in the shadow tree
    1010PASS Document.getAnimations() does NOT return animations in shadow trees
  • trunk/Source/WebCore/ChangeLog

    r261487 r261488  
     12020-05-11  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Document.getAnimations() should only consider document connection and not timeline association
     4        https://bugs.webkit.org/show_bug.cgi?id=211697
     5
     6        Reviewed by Dean Jackson.
     7
     8        The Document.getAnimations() function should return any animation running for an element that is a child of the
     9        target Document. We now consider all current animations, regardless of which timeline they might be associated
     10        with. This lets us pass the final two WPT Document.getAnimations() tests.
     11
     12        * dom/Document.cpp:
     13        (WebCore::Document::matchingAnimations):
     14
    1152020-05-11  Andres Gonzalez  <andresg_22@apple.com>
    216
  • trunk/Source/WebCore/dom/Document.cpp

    r261470 r261488  
    81308130    updateStyleIfNeeded();
    81318131
    8132     if (!m_timeline)
    8133         return { };
    8134 
    81358132    Vector<RefPtr<WebAnimation>> animations;
    8136     for (auto& animation : m_timeline->relevantAnimations()) {
     8133    for (auto* animation : WebAnimation::instances()) {
    81378134        if (!animation || !animation->isRelevant() || !is<KeyframeEffect>(animation->effect()))
    81388135            continue;
    81398136
    81408137        auto* target = downcast<KeyframeEffect>(*animation->effect()).targetElementOrPseudoElement();
    8141         if (target && target->isDescendantOf(this) && function(*target))
     8138        if (target && target->isConnected() && &target->document() == this && function(*target))
    81428139            animations.append(animation);
    81438140    }
Note: See TracChangeset for help on using the changeset viewer.