diff options
Diffstat (limited to 'testing/talos/talos/tests/perf-reftest-singletons/inline-style-cache-1.html')
-rw-r--r-- | testing/talos/talos/tests/perf-reftest-singletons/inline-style-cache-1.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/talos/talos/tests/perf-reftest-singletons/inline-style-cache-1.html b/testing/talos/talos/tests/perf-reftest-singletons/inline-style-cache-1.html new file mode 100644 index 0000000000..a02eb8db2f --- /dev/null +++ b/testing/talos/talos/tests/perf-reftest-singletons/inline-style-cache-1.html @@ -0,0 +1,24 @@ +<!doctype html> +<script src="util.js"></script> +<body> +<script> +const styles = `:host { background: red; width: 100px; height: 100px; display: block; }`.repeat(3000); +customElements.define("custom-element", class CustomElement extends HTMLElement { + connectedCallback() { + this.attachShadow({ mode: "open" }); + const style = document.createElement("style"); + style.textContent = styles; + this.shadowRoot.appendChild(style); + } +}); + +onload = function() { + perf_start(); + for (let i = 0; i < 1000; ++i) { + document.body.appendChild(document.createElement("custom-element")); + } + + flush_layout(document.body); + perf_finish(); +}; +</script> |