summaryrefslogtreecommitdiffstats
path: root/testing/talos/talos/tests/perf-reftest-singletons/inline-style-cache-1.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/talos/talos/tests/perf-reftest-singletons/inline-style-cache-1.html
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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.html24
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>