commit aff0c754e82f01f1deb9ecc9a51e626da38d9879 parent d438717567406a581c8def3c1c6d97d5a5387d34 Author: Sammy Gill <sammy.gill@apple.com> Date: Fri, 31 Oct 2025 09:05:26 +0000 Bug 1996907 [wpt PR 55719] - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=301148, a=testonly Automatic update from web-platform-tests WebKit export: [CSS] Iframe should use parent frame zoom (#55719) https://bugs.webkit.org/show_bug.cgi?id=301148 Co-authored-by: Matthieu Dubet <m_dubet@apple.com> -- wpt-commits: 5c0e30621e7ff1bb65de4ec52192f585bdb48107 wpt-pr: 55719 Diffstat:
3 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/testing/web-platform/tests/css/css-viewport/zoom/iframe-zoom-nested.html b/testing/web-platform/tests/css/css-viewport/zoom/iframe-zoom-nested.html @@ -1,4 +1,6 @@ <!DOCTYPE html> +<html class="reftest-wait"> +<head> <title>nested iframes with CSS zoom</title> <link rel="author" title="Yotam Hacohen" href="mailto:yotha@chromium.org"> <link rel="author" title="Stefan Zager" href="mailto:szager@chromium.org"> @@ -21,8 +23,27 @@ iframe { zoom: 1.5; } </style> +</head> + +<body> <iframe id="baseline" src="resources/nested-iframe.html" scrolling="no"></iframe> <iframe id="zoom-child" src="resources/nested-iframe.html?zoom=2" scrolling="no"></iframe> <iframe id="zoom-top" class="zoom" src="resources/nested-iframe.html" scrolling="no"></iframe> <iframe id="zoom-top-child" class="zoom" src="resources/nested-iframe.html?zoom=2" scrolling="no"></iframe> + +<script> +// Wait for all iframes to load before allowing the screenshot +let loadedCount = 0; +const iframes = document.querySelectorAll('iframe'); +const totalFrames = iframes.length; + +iframes.forEach(iframe => { + iframe.onload = function() { + loadedCount++; + if (loadedCount === totalFrames) { + document.documentElement.classList.remove("reftest-wait"); + } + }; +}); +</script> diff --git a/testing/web-platform/tests/css/css-viewport/zoom/iframe-zoom.sub.html b/testing/web-platform/tests/css/css-viewport/zoom/iframe-zoom.sub.html @@ -22,5 +22,5 @@ iframe { </style> <iframe id="baseline" src="resources/leaf.html"></iframe> -<iframe id="zoom-same-origin" class="zoom" src="resources/leaf.html"></iframe> -<iframe id="zoom-cross-origin" class="zoom" src="http://{{hosts[alt][]}}:{{ports[http][0]}}/css/css-viewport/zoom/resources/leaf.html"></iframe> +<iframe id="zoom-same-origin" class="zoom" src="resources/leaf.html" scrolling="no"></iframe> +<iframe id="zoom-cross-origin" class="zoom" src="http://{{hosts[alt][]}}:{{ports[http][0]}}/css/css-viewport/zoom/resources/leaf.html" scrolling="no"></iframe> diff --git a/testing/web-platform/tests/css/css-viewport/zoom/zoom-iframe-dynamic.html b/testing/web-platform/tests/css/css-viewport/zoom/zoom-iframe-dynamic.html @@ -30,8 +30,9 @@ promise_test(async function(t) { let parentDpi = window.devicePixelRatio; let origSize = iframe.getBoundingClientRect(); assert_equals(parentDpi, iframe.contentWindow.devicePixelRatio, "DPI should match between frame and parent"); + const dpiChangePromise = promiseDpiChange(iframe.contentWindow, 2 * parentDpi); iframe.style.zoom = 2; - await promiseDpiChange(iframe.contentWindow, 2 * parentDpi); + await dpiChangePromise; assert_equals(iframe.contentWindow.devicePixelRatio, 2 * parentDpi, "DPI should have doubled on the frame"); assert_equals(iframe.getBoundingClientRect().width, origSize.width * 2, "Width should have doubled as well"); assert_equals(iframe.getBoundingClientRect().height, origSize.height * 2, "Height should have doubled as well");