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