From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- .../tests/css/cssom-view/resources/matchMedia.js | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 testing/web-platform/tests/css/cssom-view/resources/matchMedia.js (limited to 'testing/web-platform/tests/css/cssom-view/resources/matchMedia.js') diff --git a/testing/web-platform/tests/css/cssom-view/resources/matchMedia.js b/testing/web-platform/tests/css/cssom-view/resources/matchMedia.js new file mode 100644 index 0000000000..f8947e0472 --- /dev/null +++ b/testing/web-platform/tests/css/cssom-view/resources/matchMedia.js @@ -0,0 +1,60 @@ +"use strict"; + +{ +// private variables are defined with `const` so they don't leak outside this block statement +const IFRAME_DEFAULT_SIZE = "200"; +const iframes = new WeakMap(); + +// helpers are defined with `var` so they are globally accessible +var createMQL = async t => { + const iframe = await createIFrame(t); + const mql = iframe.contentWindow.matchMedia(`(max-width: ${IFRAME_DEFAULT_SIZE}px)`); + assert_true(mql.matches, "MQL should match on newly created