Changeset 230000 in webkit


Ignore:
Timestamp:
Mar 27, 2018 12:19:46 PM (6 years ago)
Author:
graouts@webkit.org
Message:

[Web Animations] Stop using internals.pauseAnimationAtTimeOnElement() in favor of Web Animations API for animations tests
https://bugs.webkit.org/show_bug.cgi?id=184038

Reviewed by Dean Jackson.

Source/WebCore:

Expose a new method to indicate that the runtime flag for CSS Animations and CSS Transitions as Web Animations is enabled.

  • testing/InternalSettings.cpp:

(WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):

  • testing/InternalSettings.h:
  • testing/InternalSettings.idl:

LayoutTests:

Make 48 tests opt into CSS Animations and CSS Transitions as Web Animations. These tests used the internals.pauseAnimationAtTimeOnElement()
method, but this method should be going away since the Web Animations API allows seeking and pausing. To support this, we make
animation-test-helpers.js use the Web Animations API instead of internals.pauseAnimationAtTimeOnElement() if the tests has opted
into CSS Animations and CSS Transitions as Web Animations and we know it's safe to use these APIs.

  • animations/3d/matrix-transform-type-animation.html:
  • animations/3d/transform-perspective.html:
  • animations/animation-callback-timestamp.html:
  • animations/animation-direction-reverse-hardware-opacity.html:
  • animations/animation-direction-reverse-hardware.html:
  • animations/animation-direction-reverse-non-hardware.html:
  • animations/animation-direction-reverse-timing-functions-hardware.html:
  • animations/animation-direction-reverse-timing-functions.html:
  • animations/animation-direction.html:
  • animations/animation-hit-test.html:
  • animations/animation-offscreen-to-onscreen.html:
  • animations/change-keyframes-expected.txt:
  • animations/change-keyframes.html:
  • animations/cross-fade-background-image.html:
  • animations/cross-fade-border-image-source.html:
  • animations/cross-fade-list-style-image.html:
  • animations/cross-fade-webkit-mask-box-image.html:
  • animations/duplicate-keys-expected.html:
  • animations/duplicate-keys.html:
  • animations/font-variations/font-stretch.html:
  • animations/font-variations/font-style.html:
  • animations/font-variations/font-variation-settings-order.html:
  • animations/font-variations/font-variation-settings-unlike.html:
  • animations/font-variations/font-variation-settings.html:
  • animations/font-variations/font-weight.html:
  • animations/generic-from-to.html:
  • animations/import.html:
  • animations/keyframe-multiple-timing-functions-transform.html:
  • animations/keyframes-comma-separated.html:
  • animations/keyframes-infinite-iterations.html:
  • animations/keyframes-invalid-keys.html:
  • animations/keyframes-out-of-order.html:
  • animations/keyframes.html:
  • animations/longhand-timing-function.html:
  • animations/matrix-anim.html:
  • animations/missing-keyframe-properties-repeating.html:
  • animations/missing-keyframe-properties.html:
  • animations/missing-values-first-keyframe.html:
  • animations/missing-values-last-keyframe.html:
  • animations/multiple-animations-timing-function.html:
  • animations/multiple-animations.html:
  • animations/multiple-keyframes.html:
  • animations/negative-delay.html:
  • animations/pause-crash.html:
  • animations/resources/animation-test-helpers.js:

(checkExpectedValue):
(pauseAnimationAtTimeOnElement):
(startTest):
(runAnimationTest):

  • animations/simultaneous-start-left.html:
  • animations/spring-function.html:
  • animations/stacking-context-unchanged-while-running.html:
  • animations/timing-functions.html:
  • animations/unanimated-style.html:
  • animations/unprefixed-keyframes.html:
Location:
trunk
Files:
56 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r229999 r230000  
     12018-03-27  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Stop using internals.pauseAnimationAtTimeOnElement() in favor of Web Animations API for animations tests
     4        https://bugs.webkit.org/show_bug.cgi?id=184038
     5
     6        Reviewed by Dean Jackson.
     7
     8        Make 48 tests opt into CSS Animations and CSS Transitions as Web Animations. These tests used the internals.pauseAnimationAtTimeOnElement()
     9        method, but this method should be going away since the Web Animations API allows seeking and pausing. To support this, we make
     10        animation-test-helpers.js use the Web Animations API instead of internals.pauseAnimationAtTimeOnElement() if the tests has opted
     11        into CSS Animations and CSS Transitions as Web Animations and we know it's safe to use these APIs.
     12
     13        * animations/3d/matrix-transform-type-animation.html:
     14        * animations/3d/transform-perspective.html:
     15        * animations/animation-callback-timestamp.html:
     16        * animations/animation-direction-reverse-hardware-opacity.html:
     17        * animations/animation-direction-reverse-hardware.html:
     18        * animations/animation-direction-reverse-non-hardware.html:
     19        * animations/animation-direction-reverse-timing-functions-hardware.html:
     20        * animations/animation-direction-reverse-timing-functions.html:
     21        * animations/animation-direction.html:
     22        * animations/animation-hit-test.html:
     23        * animations/animation-offscreen-to-onscreen.html:
     24        * animations/change-keyframes-expected.txt:
     25        * animations/change-keyframes.html:
     26        * animations/cross-fade-background-image.html:
     27        * animations/cross-fade-border-image-source.html:
     28        * animations/cross-fade-list-style-image.html:
     29        * animations/cross-fade-webkit-mask-box-image.html:
     30        * animations/duplicate-keys-expected.html:
     31        * animations/duplicate-keys.html:
     32        * animations/font-variations/font-stretch.html:
     33        * animations/font-variations/font-style.html:
     34        * animations/font-variations/font-variation-settings-order.html:
     35        * animations/font-variations/font-variation-settings-unlike.html:
     36        * animations/font-variations/font-variation-settings.html:
     37        * animations/font-variations/font-weight.html:
     38        * animations/generic-from-to.html:
     39        * animations/import.html:
     40        * animations/keyframe-multiple-timing-functions-transform.html:
     41        * animations/keyframes-comma-separated.html:
     42        * animations/keyframes-infinite-iterations.html:
     43        * animations/keyframes-invalid-keys.html:
     44        * animations/keyframes-out-of-order.html:
     45        * animations/keyframes.html:
     46        * animations/longhand-timing-function.html:
     47        * animations/matrix-anim.html:
     48        * animations/missing-keyframe-properties-repeating.html:
     49        * animations/missing-keyframe-properties.html:
     50        * animations/missing-values-first-keyframe.html:
     51        * animations/missing-values-last-keyframe.html:
     52        * animations/multiple-animations-timing-function.html:
     53        * animations/multiple-animations.html:
     54        * animations/multiple-keyframes.html:
     55        * animations/negative-delay.html:
     56        * animations/pause-crash.html:
     57        * animations/resources/animation-test-helpers.js:
     58        (checkExpectedValue):
     59        (pauseAnimationAtTimeOnElement):
     60        (startTest):
     61        (runAnimationTest):
     62        * animations/simultaneous-start-left.html:
     63        * animations/spring-function.html:
     64        * animations/stacking-context-unchanged-while-running.html:
     65        * animations/timing-functions.html:
     66        * animations/unanimated-style.html:
     67        * animations/unprefixed-keyframes.html:
     68
    1692018-03-27  Per Arne Vollan  <pvollan@apple.com>
    270
  • trunk/LayoutTests/animations/3d/matrix-transform-type-animation.html

    r84872 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/3d/transform-perspective.html

    r84872 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22
    33<html>
  • trunk/LayoutTests/animations/animation-callback-timestamp.html

    r202399 r230000  
    1 <!DOCTYPE HTML>
     1<!DOCTYPE HTML><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/animation-direction-reverse-hardware-opacity.html

    r180441 r230000  
    1 <!doctype html>
     1<!doctype html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/animation-direction-reverse-hardware.html

    r180441 r230000  
    1 <!doctype html>
     1<!doctype html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/animation-direction-reverse-non-hardware.html

    r180441 r230000  
    1 <!doctype html>
     1<!doctype html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/animation-direction-reverse-timing-functions-hardware.html

    r180441 r230000  
    1 <!doctype html>
     1<!doctype html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html lang="en">
    33<head>
  • trunk/LayoutTests/animations/animation-direction-reverse-timing-functions.html

    r180441 r230000  
    1 <!doctype html>
     1<!doctype html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html lang="en">
    33<head>
  • trunk/LayoutTests/animations/animation-direction.html

    r180441 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22
    33<html>
  • trunk/LayoutTests/animations/animation-hit-test.html

    r211573 r230000  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    2    "http://www.w3.org/TR/html4/loose.dtd">
     1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    32
    43<html lang="en">
     
    5958            if (window.testRunner) {
    6059                var target = document.getElementById("target");
    61                 if (!internals.pauseAnimationAtTimeOnElement("anim", 2.0, target)) {
     60                if (!pauseAnimationAtTimeOnElement("anim", 2.0, target)) {
    6261                    document.getElementById('result').innerHTML = "FAIL: Failed to pause animation"
    6362                    testRunner.notifyDone();
  • trunk/LayoutTests/animations/animation-offscreen-to-onscreen.html

    r135212 r230000  
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    12<html>
    23<head>
  • trunk/LayoutTests/animations/change-keyframes-expected.txt

    r191132 r230000  
    1 CONSOLE MESSAGE: line 57: CSSKeyframesRule 'insertRule' function is deprecated.  Use 'appendRule' instead.
    2 CONSOLE MESSAGE: line 59: CSSKeyframesRule 'insertRule' function is deprecated.  Use 'appendRule' instead.
     1CONSOLE MESSAGE: line 56: CSSKeyframesRule 'insertRule' function is deprecated.  Use 'appendRule' instead.
     2CONSOLE MESSAGE: line 58: CSSKeyframesRule 'insertRule' function is deprecated.  Use 'appendRule' instead.
    33This test performs an animation of the left property and makes sure it is animating. Then it stops the animation, changes the keyframes to an animation of the top property, restarts the animation and makes sure top is animating.
    44PASS - "left" property for "box" element at 0.5s saw something close to: 200
  • trunk/LayoutTests/animations/change-keyframes.html

    r173982 r230000  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    2    "http://www.w3.org/TR/html4/loose.dtd">
     1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    32
    43<html lang="en">
  • trunk/LayoutTests/animations/cross-fade-background-image.html

    r200888 r230000  
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    12<html>
    23<head>
  • trunk/LayoutTests/animations/cross-fade-border-image-source.html

    r200888 r230000  
     1<!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    12<html>
    23<head>
  • trunk/LayoutTests/animations/cross-fade-list-style-image.html

    r200888 r230000  
     1<!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    12<html>
    23<head>
  • trunk/LayoutTests/animations/cross-fade-webkit-mask-box-image.html

    r200888 r230000  
     1<!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    12<html>
    23<head>
  • trunk/LayoutTests/animations/duplicate-keys-expected.html

    r201818 r230000  
     1<!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    12<style>
    23.box {
     
    2829if (window.testRunner) {
    2930    window.addEventListener("load", function () {
    30         var box = document.querySelector(".box");
    31         internals.pauseAnimationAtTimeOnElement("foo", 0.1, box);
     31        const animations = document.querySelector(".box").getAnimations();
     32        for (let animation of animations) {
     33            if (animation instanceof CSSAnimation && animation.animationName == "foo") {
     34                animation.currentTime = 100;
     35                animation.pause();
     36                break;
     37            }
     38        }
    3239    }, false);
    3340}
  • trunk/LayoutTests/animations/duplicate-keys.html

    r201818 r230000  
     1<!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    12<style>
    23.box {
     
    3132    testRunner.waitUntilDone();
    3233    window.addEventListener("load", function () {
    33         var box = document.querySelector(".box");
    34         internals.pauseAnimationAtTimeOnElement("foo", 0.1, box);
     34        const animations = document.querySelector(".box").getAnimations();
     35        for (let animation of animations) {
     36            if (animation instanceof CSSAnimation && animation.animationName == "foo") {
     37                animation.currentTime = 100;
     38                animation.pause();
     39                break;
     40            }
     41        }
    3542        testRunner.notifyDone();
    3643    }, false);
  • trunk/LayoutTests/animations/font-variations/font-stretch.html

    r214414 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/font-variations/font-style.html

    r214414 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/font-variations/font-variation-settings-order.html

    r211573 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/font-variations/font-variation-settings-unlike.html

    r211573 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/font-variations/font-variation-settings.html

    r211573 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/font-variations/font-weight.html

    r214414 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/generic-from-to.html

    r84872 r230000  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    2    "http://www.w3.org/TR/html4/loose.dtd">
    3 
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    42<html lang="en">
    53<head>
  • trunk/LayoutTests/animations/import.html

    r84872 r230000  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    2    "http://www.w3.org/TR/html4/loose.dtd">
    3 
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    42<html lang="en">
    53<head>
  • trunk/LayoutTests/animations/keyframe-multiple-timing-functions-transform.html

    r167472 r230000  
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    12<html>
    23<head>
  • trunk/LayoutTests/animations/keyframes-comma-separated.html

    r84872 r230000  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    2    "http://www.w3.org/TR/html4/loose.dtd">
    3 
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    42<html lang="en">
    53<head>
  • trunk/LayoutTests/animations/keyframes-infinite-iterations.html

    r89597 r230000  
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    12<html>
    23<head>
  • trunk/LayoutTests/animations/keyframes-invalid-keys.html

    r149106 r230000  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    2    "http://www.w3.org/TR/html4/loose.dtd">
    3 
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    42<html lang="en">
    53<head>
  • trunk/LayoutTests/animations/keyframes-out-of-order.html

    r84872 r230000  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    2    "http://www.w3.org/TR/html4/loose.dtd">
    3 
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    42<html lang="en">
    53<head>
  • trunk/LayoutTests/animations/keyframes.html

    r84872 r230000  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    2    "http://www.w3.org/TR/html4/loose.dtd">
    3 
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    42<html lang="en">
    53<head>
  • trunk/LayoutTests/animations/longhand-timing-function.html

    r211573 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22
    33<html>
  • trunk/LayoutTests/animations/matrix-anim.html

    r84872 r230000  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    2    "http://www.w3.org/TR/html4/loose.dtd">
     1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    32
    43<html lang="en">
  • trunk/LayoutTests/animations/missing-keyframe-properties-repeating.html

    r84872 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/missing-keyframe-properties.html

    r84872 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/missing-values-first-keyframe.html

    r84872 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/missing-values-last-keyframe.html

    r84872 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/animations/multiple-animations-timing-function.html

    r89462 r230000  
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    12<html>
    23<head>
  • trunk/LayoutTests/animations/multiple-animations.html

    r84872 r230000  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    2    "http://www.w3.org/TR/html4/loose.dtd">
     1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    32
    43<html lang="en">
  • trunk/LayoutTests/animations/multiple-keyframes.html

    r84872 r230000  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    2    "http://www.w3.org/TR/html4/loose.dtd">
     1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    32
    43<html lang="en">
  • trunk/LayoutTests/animations/negative-delay.html

    r84872 r230000  
    1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    2         "http://www.w3.org/TR/html4/strict.dtd">
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    32<html>
    43<head>
  • trunk/LayoutTests/animations/pause-crash.html

    r119985 r230000  
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    12<html>
    23<head>
  • trunk/LayoutTests/animations/resources/animation-test-helpers.js

    r214414 r230000  
    1919
    2020    [1] If null is passed, a regular setTimeout() will be used instead to snapshot the animated property in the future,
    21     instead of fast forwarding using the pauseAnimationAtTimeOnElement() JS API from Internals.
     21    instead of fast forwarding using the pauseAnimationAtTimeOnElement() function.
    2222   
    2323    [2] If a single string is passed, it is the id of the element to test. If an array with 2 elements is passed they
     
    374374    }
    375375
    376     if (animationName && hasPauseAnimationAPI && !internals.pauseAnimationAtTimeOnElement(animationName, time, document.getElementById(elementId))) {
     376    if (animationName && hasPauseAnimationAPI && !pauseAnimationAtTimeOnElement(animationName, time, document.getElementById(elementId))) {
    377377        result += "FAIL - animation \"" + animationName + "\" is not running" + "<br>";
    378378        return;
    379379    }
    380380   
    381     if (compareElements && !element2Static && animationName && hasPauseAnimationAPI && !internals.pauseAnimationAtTimeOnElement(animationName, time, document.getElementById(elementId2))) {
     381    if (compareElements && !element2Static && animationName && hasPauseAnimationAPI && !pauseAnimationAtTimeOnElement(animationName, time, document.getElementById(elementId2))) {
    382382        result += "FAIL - animation \"" + animationName + "\" is not running" + "<br>";
    383383        return;
     
    511511}
    512512
     513function pauseAnimationAtTimeOnElement(animationName, time, element)
     514{
     515    // If we haven't opted into CSS Animations and CSS Transitions as Web Animations, use the internal API.
     516    if ('internals' in window && !internals.settings.cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled())
     517        return internals.pauseAnimationAtTimeOnElement(animationName, time, element);
     518
     519    // Otherwise, use the Web Animations API.
     520    const animations = element.getAnimations();
     521    for (let animation of animations) {
     522        if (animation instanceof CSSAnimation && animation.animationName == animationName) {
     523            animation.currentTime = time * 1000;
     524            animation.pause();
     525            return true;
     526        }
     527    }
     528    return false;
     529}
     530
    513531var testStarted = false;
    514532function startTest(expected, startCallback, finishCallback)
     
    527545
    528546        // We can only use the animation fast-forward mechanism if there's an animation name
    529         // and Internals implements pauseAnimationAtTimeOnElement()
    530547        if (animationName && hasPauseAnimationAPI)
    531548            checkExpectedValue(expected, i);
     
    547564
    548565var result = "";
    549 var hasPauseAnimationAPI;
     566var hasPauseAnimationAPI = true;
    550567
    551568if (window.testRunner)
     
    554571function runAnimationTest(expected, startCallback, event, disablePauseAnimationAPI, doPixelTest, finishCallback)
    555572{
    556     hasPauseAnimationAPI = 'internals' in window;
    557573    if (disablePauseAnimationAPI)
    558574        hasPauseAnimationAPI = false;
  • trunk/LayoutTests/animations/simultaneous-start-left.html

    r84872 r230000  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    2    "http://www.w3.org/TR/html4/loose.dtd">
     1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    32
    43<html lang="en">
  • trunk/LayoutTests/animations/spring-function.html

    r201759 r230000  
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    12<script>
    23  if (window.internals)
  • trunk/LayoutTests/animations/stacking-context-unchanged-while-running.html

    r208025 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22
    33<html>
  • trunk/LayoutTests/animations/timing-functions.html

    r180441 r230000  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    2    "http://www.w3.org/TR/html4/loose.dtd">
     1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    32
    43<html lang="en">
  • trunk/LayoutTests/animations/unanimated-style.html

    r211573 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22
    33<html>
  • trunk/LayoutTests/animations/unprefixed-keyframes.html

    r180441 r230000  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<html>
    33<head>
  • trunk/Source/WebCore/ChangeLog

    r229997 r230000  
     12018-03-27  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Stop using internals.pauseAnimationAtTimeOnElement() in favor of Web Animations API for animations tests
     4        https://bugs.webkit.org/show_bug.cgi?id=184038
     5
     6        Reviewed by Dean Jackson.
     7
     8        Expose a new method to indicate that the runtime flag for CSS Animations and CSS Transitions as Web Animations is enabled.
     9
     10        * testing/InternalSettings.cpp:
     11        (WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
     12        * testing/InternalSettings.h:
     13        * testing/InternalSettings.idl:
     14
    1152018-03-27  Thibault Saunier  <tsaunier@igalia.com>
    216
  • trunk/Source/WebCore/testing/InternalSettings.cpp

    r229531 r230000  
    937937}
    938938
     939bool InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled()
     940{
     941    return RuntimeEnabledFeatures::sharedFeatures().cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled();
     942}
     943
    939944// If you add to this class, make sure that you update the Backup class for test reproducability!
    940945
  • trunk/Source/WebCore/testing/InternalSettings.h

    r229531 r230000  
    125125    static void setScreenCaptureEnabled(bool);
    126126
     127    static bool cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled();
     128
    127129private:
    128130    explicit InternalSettings(Page*);
  • trunk/Source/WebCore/testing/InternalSettings.idl

    r229531 r230000  
    110110    [MayThrowException] void setShouldManageAudioSessionCategory(boolean should);
    111111    [MayThrowException] void setCustomPasteboardDataEnabled(boolean enabled);
     112
     113    [EnabledAtRuntime=WebAnimations] boolean cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled();
    112114};
    113115
Note: See TracChangeset for help on using the changeset viewer.