OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"></script> |
| 3 <style id="sheet">#removed { background-color: red; }</style> |
| 4 <style> |
| 5 @font-face { |
| 6 font-family: dummy; |
| 7 src: local(dummy); |
| 8 } |
| 9 |
| 10 .green { |
| 11 font-family: sans-serif; |
| 12 background-color: green; |
| 13 } |
| 14 </style> |
| 15 <div id="removed" class="green"> |
| 16 This text should have a green background. |
| 17 </div> |
| 18 <div> |
| 19 <div></div> |
| 20 <div></div> |
| 21 <div></div> |
| 22 <div></div> |
| 23 </div> |
| 24 <script> |
| 25 description("Remove a stylesheet not affecting layout."); |
| 26 |
| 27 var red = "rgb(255, 0, 0)"; |
| 28 var green = "rgb(0, 128, 0)"; |
| 29 |
| 30 shouldBe("getComputedStyle(removed).backgroundColor", "red"); |
| 31 document.body.offsetTop; // force layout |
| 32 |
| 33 sheet.parentNode.removeChild(sheet); |
| 34 |
| 35 if (window.internals) { |
| 36 var recalcCount = internals.updateStyleAndReturnAffectedElementCount(); |
| 37 var layoutCount = internals.needsLayoutCount(); |
| 38 shouldBe("recalcCount", "1"); |
| 39 shouldBe("layoutCount", "0"); |
| 40 } |
| 41 |
| 42 shouldBe("getComputedStyle(removed).backgroundColor", "green"); |
| 43 </script> |
OLD | NEW |