testing/web-platform/tests/web-animations/animation-model/keyframe-effects/keyframe-exceptions.html
author Emilio Cobos Álvarez <emilio@crisal.io>
Thu, 10 Jul 2025 09:08:54 +0000 (4 hours ago)
changeset 795952 1d422913e1cb1658224a2d269f8e4c9e80032d29
parent 658403 28801a9647b9f5193618f5af35d93c4dccb5a649
permissions -rw-r--r--
Bug 1976623 - Create drag popups eagerly for now. r=tnikkel,layout-reviewers Trivially restores pre-regression behavior, for now. Differential Revision: https://phabricator.services.mozilla.com/D256769
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<link rel="help" src="https://www.w3.org/TR/web-animations-1/#processing-a-keyframes-argument">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/web-animations/testcommon.js"></script>
<script src="support/testcommon.js"></script>
<title>Keyframes with invalid offsets</title>
</head>
<script>
  test(() => {
    assert_throws_js(TypeError,
      function() {
        document.documentElement.animate([
          {offset: 0.6},
          {offset: 0.4}
        ]);
      });
  }, 'Offsets must be loosely sorted');

  test(() => {
      assert_throws_js(TypeError,
      function() {
        document.documentElement.animate([
          {offset: 'whatever'}
        ]);
      });
  }, 'Invalid offset');

  test(() => {
    assert_throws_js(TypeError,
      function() {
        document.documentElement.animate([
          {offset: -1}
        ]);
      });
  }, 'Offsets must be null or in the range [0,1]');
</script>