OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <style> |
| 3 #test-container span { |
| 4 float: left; /* This is the root cause */ |
| 5 width: 18px; |
| 6 height: 18px; |
| 7 } |
| 8 </style> |
| 9 <div id="test-container"></div> |
| 10 <script src="../resources/runner.js"></script> |
| 11 <script> |
| 12 var count = 3000; |
| 13 |
| 14 function addFloats() { |
| 15 var container = document.getElementById("test-container"); |
| 16 var newDiv = document.createElement("div"); |
| 17 for (var i = 0; i < count; i++) { |
| 18 var span = document.createElement("span"); |
| 19 newDiv.appendChild(span); |
| 20 } |
| 21 container.appendChild(newDiv); |
| 22 }; |
| 23 |
| 24 function removeFloats() { |
| 25 var container = document.getElementById("test-container"); |
| 26 if (container.lastChild) container.removeChild(container.lastChild); |
| 27 } |
| 28 |
| 29 function test() { |
| 30 addFloats(); |
| 31 PerfTestRunner.forceLayoutOrFullFrame(); |
| 32 removeFloats(); |
| 33 } |
| 34 |
| 35 PerfTestRunner.measureRunsPerSecond({ |
| 36 description: "Measures performance of removing floats in a block with a lot
of inline children.", |
| 37 run: test |
| 38 }); |
| 39 </script> |
| 40 </html> |
OLD | NEW |