OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> |
| 4 <div id="host"></div> |
| 5 <div></div> |
| 6 <div></div> |
| 7 <div></div> |
| 8 <div></div> |
| 9 <script> |
| 10 test(() => assert_not_equals(window.internals, undefined, "Needs window.inte
rnals for testing."), "Check that window.internals is defined"); |
| 11 |
| 12 var root = host.attachShadow({mode:"open"}); |
| 13 root.innerHTML = "<div></div><div></div><div></div>"; |
| 14 host.offsetTop; |
| 15 |
| 16 test(() => { |
| 17 var sheet = document.createElement("style"); |
| 18 sheet.appendChild(document.createTextNode(` |
| 19 @keyframes unused { |
| 20 from { color: pink } |
| 21 to { color: orange } |
| 22 }`)); |
| 23 root.appendChild(sheet); |
| 24 // TODO(rune@opera.com): This count should be 1 when async stylesheet |
| 25 // update with RuleSet invalidations land. Currently we always do a |
| 26 // subtree recalc for stylesheet mutations in shadow trees. |
| 27 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 5, |
| 28 "Recalc for shadow tree, including host and inserted style element."
); |
| 29 }, "Check that adding @keyframes does not cause a style recalc of the host e
lement when no animations are running."); |
| 30 </script> |
OLD | NEW |