summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-toggle/support
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/web-platform/tests/css/css-toggle/support
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.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/web-platform/tests/css/css-toggle/support')
-rw-r--r--testing/web-platform/tests/css/css-toggle/support/toggle-helpers.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-toggle/support/toggle-helpers.js b/testing/web-platform/tests/css/css-toggle/support/toggle-helpers.js
new file mode 100644
index 0000000000..48f0916b4e
--- /dev/null
+++ b/testing/web-platform/tests/css/css-toggle/support/toggle-helpers.js
@@ -0,0 +1,16 @@
+async function wait_for_toggle_creation(element) {
+ // TODO(crbug.com/1250716): The spec is vague about when toggles need to be
+ // created, and whether :toggle() pseudo-classes will update within the same
+ // update. See https://github.com/tabatkins/css-toggle/issues/27 . For
+ // now, we call elementFromPoint (which in Chromium flushes to PrePaint
+ // clean), which isn't a long term solution!
+ document.elementFromPoint(10, 10);
+}
+
+async function set_up_single_toggle_in(container, toggle_style) {
+ let div = document.createElement("div");
+ div.style.toggle = toggle_style;
+ container.replaceChildren(div);
+ await wait_for_toggle_creation(div);
+ return div;
+}