2 <script src=
"../resources/runner.js"></script>
5 window
.onload = function() {
6 PerfTestRunner
.measureTime({
7 description
: "Measures performance of creating and rendering elements with shadow roots from templates (contains class selector styles and a media query).",
9 var list
= document
.querySelector('#list');
10 var tmpl
= document
.querySelector("#tmpl");
12 var start
= PerfTestRunner
.now();
15 var host
= document
.createElement('div');
16 var root
= host
.createShadowRoot();
17 root
.appendChild(tmpl
.content
.cloneNode(true));
18 var light
= document
.createElement('div');
19 list
.appendChild(host
);
20 } while (++i
< listSize
);
22 PerfTestRunner
.forceLayoutOrFullFrame();
23 return PerfTestRunner
.now() - start
;
30 @media (max-width:
600px) {
33 .foo { color: black; }
35 .baz { color: green; }
36 .bat { color: orange; }
40 <section id=
"list"></section>