chromium/third_party/blink/web_tests/animations/svg-attribute-composition/svg-markerWidth-composition.html

<!DOCTYPE html>
<html>
<head>
<script src="../../resources/ahem.js"></script>
<style>
:root {
  font: 10px Ahem;
}
</style>
</head>
<body>
<template id="target-template">
<svg width="200px" height="300px" viewBox="0 0 1500 1000">
  <marker class="target" />
</svg>
</template>
<script src="../svg-attribute-interpolation/resources/interpolation-test.js"></script>
<script>
'use strict';
assertAttributeInterpolation({
  property: 'markerWidth',
  underlying: '2',
  from: '-1',
  fromComposite: 'add',
  to: '4',
  toComposite: 'add'
}, [
  {at: -0.4, is: 0},
  {at: 0, is: 1},
  {at: 0.2, is: 2},
  {at: 0.6, is: 4},
  {at: 1, is: 6},
  {at: 1.4, is: 8}
]);
assertAttributeInterpolation({
  property: 'markerWidth',
  underlying: '1in',
  from: '9in',
  fromComposite: 'add',
  to: '698pt',
  toComposite: 'add'
}, [
  {at: -0.4, is: '700pt'},
  {at: 0, is: '720pt'},
  {at: 0.2, is: '730pt'},
  {at: 0.6, is: '750pt'},
  {at: 1, is: '770pt'},
  {at: 1.4, is: '790pt'}
]);
assertAttributeInterpolation({
  property: 'markerWidth',
  underlying: '10',
  from: '10',
  fromComposite: 'add',
  to: '19em',
  toComposite: 'add'
}, [
  {at: -0.4, is: '0'},
  {at: 0, is: '20'},
  {at: 0.2, is: '56'},
  {at: 0.6, is: '128'},
  {at: 1, is: '200'},
  {at: 1.4, is: '272'}
]);

assertAttributeInterpolation({
  property: 'markerWidth',
  underlying: '2',
  from: '1',
  fromComposite: 'replace',
  to: '4',
  toComposite: 'add'
}, [
  {at: -0.4, is: 0},
  {at: 0, is: 1},
  {at: 0.2, is: 2},
  {at: 0.6, is: 4},
  {at: 1, is: 6},
  {at: 1.4, is: 8}
]);
assertAttributeInterpolation({
  property: 'markerWidth',
  underlying: '1in',
  from: '10in',
  fromComposite: 'replace',
  to: '698pt',
  toComposite: 'add'
}, [
  {at: -0.4, is: '700pt'},
  {at: 0, is: '720pt'},
  {at: 0.2, is: '730pt'},
  {at: 0.6, is: '750pt'},
  {at: 1, is: '770pt'},
  {at: 1.4, is: '790pt'}
]);
assertAttributeInterpolation({
  property: 'markerWidth',
  underlying: '5em',
  from: '10',
  fromComposite: 'replace',
  to: '5em',
  toComposite: 'add'
}, [
  {at: -0.4, is: '0'},
  {at: 0, is: '10'},
  {at: 0.2, is: '28'},
  {at: 0.6, is: '64'},
  {at: 1, is: '100'},
  {at: 1.4, is: '136'}
]);

assertAttributeInterpolation({
  property: 'markerWidth',
  underlying: '1',
  from: neutralKeyframe,
  to: '6',
  toComposite: 'replace'
}, [
  {at: -0.4, is: 0},
  {at: 0, is: 1},
  {at: 0.2, is: 2},
  {at: 0.6, is: 4},
  {at: 1, is: 6},
  {at: 1.4, is: 8}
]);
assertAttributeInterpolation({
  property: 'markerWidth',
  underlying: '10in',
  from: neutralKeyframe,
  to: '770pt',
  toComposite: 'replace'
}, [
  {at: -0.4, is: '700pt'},
  {at: 0, is: '720pt'},
  {at: 0.2, is: '730pt'},
  {at: 0.6, is: '750pt'},
  {at: 1, is: '770pt'},
  {at: 1.4, is: '790pt'}
]);
assertAttributeInterpolation({
  property: 'markerWidth',
  underlying: '10',
  from: neutralKeyframe,
  to: '10em',
  toComposite: 'replace'
}, [
  {at: -0.4, is: '0'},
  {at: 0, is: '10'},
  {at: 0.2, is: '28'},
  {at: 0.6, is: '64'},
  {at: 1, is: '100'},
  {at: 1.4, is: '136'}
]);
</script>
</body>
</html>