<!DOCTYPE HTML> <script src="resources/text-based-repaint.js"></script> <script> function repaintTest() { document.getElementById('target1').className = 'content-box'; document.getElementById('target2').className = 'border-box'; } window.onload = runRepaintTest; </script> <style> body { margin: 0; } div { width: 50%; height: 100px; position: absolute; background-color: green; border: blue solid 20px; } .border-box { box-sizing: border-box; } .content-box { box-sizing: content-box; } </style> <div id="target1" class="border-box" style="top: 0px"></div> <div id="target2" class="content-box" style="top: 200px"></div>