OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Style invalidation when adding/removing audio controls</title> |
| 3 <script src="../resources/testharness.js"></script> |
| 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <div id="log"></div> |
| 6 <script> |
| 7 test(function() { |
| 8 var audio = document.createElement('audio'); |
| 9 document.body.appendChild(audio); |
| 10 // Note: The clientWidth getter in this assert will force a layout. |
| 11 // Without that, the test would pass for the wrong reasons. |
| 12 assert_equals(audio.clientWidth, 0); |
| 13 audio.controls = true; |
| 14 assert_equals(audio.clientWidth, 300); |
| 15 }, "Style invalidation when adding audio controls"); |
| 16 |
| 17 test(function() { |
| 18 var audio = document.createElement('audio'); |
| 19 document.body.appendChild(audio); |
| 20 audio.controls = true; |
| 21 assert_equals(audio.clientWidth, 300); |
| 22 audio.controls = false; |
| 23 assert_equals(audio.clientWidth, 0); |
| 24 }, "Style invalidation when removing audio controls"); |
| 25 </script> |
OLD | NEW |