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 svg { background-color: lightblue } | |
| 6 div { width: 500px; background-color: blue; padding: 1em } | |
| 7 </style> | |
| 8 <div> | |
| 9 <svg viewBox="0 0 100 100"></svg> | |
| 10 </div> | |
| 11 <script> | |
| 12 var dec_test = async_test("Test SVG dimensions after container width has shr unk"); | |
| 13 var inc_test = async_test("Test SVG dimensions after container width has gro wn"); | |
| 14 onload = setTimeout(function() { | |
|
pdr.
2014/06/18 17:48:43
Can you use requestAnimationFrame instead of setTi
davve
2014/06/18 19:16:47
Good idea. I haven't accustomed myself with reques
| |
| 15 document.querySelector('div').style.width = "1000px"; | |
| 16 inc_test.step(function() { | |
| 17 assert_equals(document.querySelector('svg').offsetWidth, 1000); | |
| 18 assert_equals(document.querySelector('svg').offsetHeight, 1000); | |
| 19 }); | |
| 20 inc_test.done(); | |
| 21 | |
| 22 document.querySelector('div').style.width = "100px"; | |
| 23 dec_test.step(function() { | |
| 24 assert_equals(document.querySelector('svg').offsetWidth, 100); | |
| 25 assert_equals(document.querySelector('svg').offsetHeight, 100); | |
| 26 }); | |
| 27 dec_test.done(); | |
| 28 }, 0); | |
| 29 </script> | |
| OLD | NEW |