OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> |
| 3 |
| 4 <style> |
| 5 .outer .inner {} |
| 6 </style> |
| 7 |
| 8 <div id="outer"> |
| 9 <div id="inner" class="inner"> |
| 10 </div> |
| 11 <div id="inner2"> |
| 12 </div> |
| 13 </div> |
| 14 |
| 15 <script> |
| 16 description("Test that adding and removing class names only updates the elements
that are affected."); |
| 17 |
| 18 function insertStyleSheet(css) |
| 19 { |
| 20 var styleElement = document.createElement("style"); |
| 21 styleElement.textContent = css; |
| 22 (document.head || document.documentElement).appendChild(styleElement); |
| 23 } |
| 24 |
| 25 var outer = document.getElementById('outer'); |
| 26 |
| 27 outer.offsetTop; |
| 28 outer.className = 'outer'; |
| 29 |
| 30 // Style recalc should happen on "inner" and "outer", but not "inner2". |
| 31 // FIXME: change the 3 to a 2 once we have a virtual test setup. |
| 32 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", '3'); |
| 33 |
| 34 </script> |
OLD | NEW |