OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../resources/runner.js"></script> |
| 3 <div id="host"> |
| 4 </div> |
| 5 <script> |
| 6 'use strict'; |
| 7 const numAssignedDivs = 100; |
| 8 |
| 9 const host = document.getElementById('host'); |
| 10 for (let i = 0; i < numAssignedDivs; ++i){ |
| 11 let div = document.createElement('div'); |
| 12 div.setAttribute('slot', 's1'); |
| 13 div.appendChild(document.createTextNode('div' + i)); |
| 14 host.appendChild(div); |
| 15 } |
| 16 |
| 17 const slot = document.createElement('slot'); |
| 18 slot.setAttribute('name', 's1'); |
| 19 const shadowRoot = host.attachShadow({mode: 'open'}); |
| 20 shadowRoot.appendChild(slot); |
| 21 |
| 22 function run() { |
| 23 slot.innerText; |
| 24 } |
| 25 |
| 26 PerfTestRunner.measureRunsPerSecond({ |
| 27 description: 'Measure Slot Distribution Calculation', |
| 28 run: run, |
| 29 done: () => { |
| 30 } |
| 31 }); |
| 32 </script> |
| 33 |
OLD | NEW |