| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <script src="resources/text-based-repaint.js"></script> | 2 <script src="resources/text-based-repaint.js"></script> |
| 3 <script> | 3 <script> |
| 4 function repaintTest() | 4 function repaintTest() |
| 5 { | 5 { |
| 6 document.getElementById('target').style.boxSizing = 'content-box'; | 6 document.getElementById('target1').className = 'content-box'; |
| 7 document.getElementById('target2').className = 'border-box'; |
| 7 } | 8 } |
| 8 window.onload = runRepaintTest; | 9 window.onload = runRepaintTest; |
| 9 </script> | 10 </script> |
| 10 <style> | 11 <style> |
| 11 body { | 12 body { |
| 12 margin: 0; | 13 margin: 0; |
| 13 } | 14 } |
| 14 #target { | 15 div { |
| 15 border: solid blue 20px; | |
| 16 width: 50%; | 16 width: 50%; |
| 17 height: 100px; | 17 height: 100px; |
| 18 position: absolute; |
| 19 background-color: green; |
| 20 border: blue solid 20px; |
| 21 } |
| 22 .border-box { |
| 18 box-sizing: border-box; | 23 box-sizing: border-box; |
| 19 position: absolute; | 24 } |
| 25 .content-box { |
| 26 box-sizing: content-box; |
| 20 } | 27 } |
| 21 </style> | 28 </style> |
| 22 <div id="target"></div> | 29 <div id="target1" class="border-box" style="top: 0px"></div> |
| 30 <div id="target2" class="content-box" style="top: 200px"></div> |
| OLD | NEW |