Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../resources/testharness.js"></script> | |
| 3 <script src="../resources/testharnessreport.js"></script> | |
| 4 <style> | |
| 5 div { | |
| 6 /* This is required so that z-index doesn't compute as auto. */ | |
| 7 position: relative; | |
| 8 } | |
| 9 </style> | |
| 10 | |
| 11 <div id="animated"></div> | |
| 12 <div id="reference"></div> | |
| 13 | |
| 14 <script> | |
| 15 var numberProperties = [ | |
|
dstockwell
2015/11/18 23:52:00
I wonder if there's a way to test all properties.
alancutter (OOO until 2018)
2015/11/19 00:10:07
CSSOM2 would be good for this case.
| |
| 16 'flex-grow', | |
| 17 'flex-shrink', | |
| 18 'font-size-adjust', | |
| 19 'line-height', | |
| 20 'orphans', | |
| 21 'stroke-miterlimit', | |
| 22 'widows', | |
| 23 'z-index', | |
| 24 ]; | |
| 25 | |
| 26 var bigNumber = 1e20; | |
| 27 | |
| 28 for (var property of numberProperties) { | |
| 29 test(() => { | |
| 30 animated.animate({[property]: bigNumber}, {fill: 'forwards'}); | |
| 31 reference.style[property] = bigNumber; | |
| 32 assert_equals(getComputedStyle(animated)[property], getComputedStyle(referen ce)[property]); | |
| 33 }, `Animations on ${property} should clamp identically to setting inline style `); | |
| 34 } | |
| 35 </script> | |
| OLD | NEW |