OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <title>activation behavior with shadow children</title> |
| 3 <script src="../resources/testharness.js"></script> |
| 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <video controls></video> |
| 6 <script> |
| 7 function shouldTogglePlayState(shadowChild) |
| 8 { |
| 9 var id = internals.shadowPseudoId(shadowChild); |
| 10 if (id == "-webkit-media-controls") |
| 11 return true; |
| 12 if (id == "-webkit-media-controls-play-button") |
| 13 return true; |
| 14 if (id == "-webkit-media-controls-panel") |
| 15 return false; |
| 16 return shouldTogglePlayState(shadowChild.parentNode); |
| 17 } |
| 18 |
| 19 test(function() |
| 20 { |
| 21 var v = document.querySelector("video"); |
| 22 var shadowChildren = internals.shadowRoot(v).querySelectorAll("*"); |
| 23 Array.prototype.forEach.call(shadowChildren, function(shadowChild) |
| 24 { |
| 25 v.pause(); |
| 26 shadowChild.click(); |
| 27 assert_equals(v.paused, !shouldTogglePlayState(shadowChild), |
| 28 "paused state after click element with pseudo id '" |
| 29 + internals.shadowPseudoId(shadowChild) + "'"); |
| 30 }); |
| 31 }); |
| 32 </script> |
OLD | NEW |