OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> |
| 3 <style> |
| 4 #outer |
| 5 { |
| 6 counter-reset: c; |
| 7 } |
| 8 |
| 9 #outer > div:before |
| 10 { |
| 11 content: counter(c); |
| 12 } |
| 13 |
| 14 .active > div:before { |
| 15 counter-increment: c; |
| 16 } |
| 17 |
| 18 .inactive > div:before { |
| 19 counter-increment: none; |
| 20 } |
| 21 </style> |
| 22 |
| 23 <div id="outer"> |
| 24 <div id="inner1"></div> |
| 25 <div id="inner2"></div> |
| 26 </div> |
| 27 |
| 28 <script> |
| 29 var outerDiv = document.getElementById("outer"); |
| 30 outerDiv.className = "inactive"; |
| 31 outerDiv.offsetTop; |
| 32 outerDiv.className = "active"; |
| 33 |
| 34 shouldBeEqualToString("window.internals.counterValue(document.getElementById
('inner1'))", "1"); |
| 35 shouldBeEqualToString("window.internals.counterValue(document.getElementById
('inner2'))", "2"); |
| 36 </script> |
OLD | NEW |