diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/cssom-view/getClientRects-zoom.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/cssom-view/getClientRects-zoom.html')
-rw-r--r-- | testing/web-platform/tests/css/cssom-view/getClientRects-zoom.html | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/cssom-view/getClientRects-zoom.html b/testing/web-platform/tests/css/cssom-view/getClientRects-zoom.html new file mode 100644 index 0000000000..93d42aee87 --- /dev/null +++ b/testing/web-platform/tests/css/cssom-view/getClientRects-zoom.html @@ -0,0 +1,80 @@ +<!DOCTYPE html> +<title>getBoundingClientRect for elements with css zoom</title> +<link rel="author" title="Yotam Hacohen" href="mailto:yotha@chromium.org"> +<link rel="author" title="Google" href="http://www.google.com/"> +<link rel="help" href="https://drafts.csswg.org/css-viewport/"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style> + .test_content div { + width: 64px; + height: 64px; + background-color: blue + } + .test_content div.x4_zoom { + zoom: 4.0; + background-color: blueviolet; + } + .test_content div.x2_zoom { + background-color: chartreuse; + zoom: 2.0; + } + + .test_content div.transform { + transform: scale(2); + transform-origin: top left; + } + + +</style> +<body> + <div class="test_content"> + <div id="no_zoom"></div> + <div class="x4_zoom" id="with_zoom"> + </div> + <div class="x2_zoom"> + <div class="x4_zoom" id="nested_zoom"></div> + </div> + <div id="transform_and_zoom" class="x4_zoom transform"></div> + </div> + <script> + setup(() => { + window.noZoom = document.getElementById("no_zoom"); + window.withZoom = document.getElementById("with_zoom"); + window.nestedZoom = document.getElementById("nested_zoom"); + window.transformAndZoom = document.getElementById("transform_and_zoom"); + }); + test(function() { + assert_true(!!noZoom, "no zoom target exists"); + assert_true(!!withZoom, "zoom target exists"); + }); + test(function() { + let noZoomRect = noZoom.getClientRects()[0]; + assert_equals(noZoomRect.left, 8, 'no zoom left'); + assert_equals(noZoomRect.top, 8, 'no zoom top'); + assert_equals(noZoomRect.width, 64, 'no zoom width'); + assert_equals(noZoomRect.height, 64, 'no zoom height'); + }); + test(function() { + let ZoomRect = withZoom.getClientRects()[0]; + assert_equals(ZoomRect.left, 8, 'x4 zoom left'); + assert_equals(ZoomRect.top, 8 + 64, 'x4 zoom top'); + assert_equals(ZoomRect.width, 256, 'x4 zoom width'); + assert_equals(ZoomRect.height, 256, 'x4 zoom height'); + }); + test(function() { + let nestedZoomRect = nestedZoom.getClientRects()[0]; + assert_equals(nestedZoomRect.left, 8, 'nested zoom left'); + assert_equals(nestedZoomRect.top, 8 + 64 + 256, 'nested zoom top'); + assert_equals(nestedZoomRect.width, 512, 'nested zoom width'); + assert_equals(nestedZoomRect.height, 512, 'nested zoom height'); + }); + test(function() { + let transformAndZoomRect = transformAndZoom.getClientRects()[0]; + assert_equals(transformAndZoomRect.left, 8, 'transform and zoom left'); + assert_equals(transformAndZoomRect.top, 8 + 64 + 256 + 128, 'transform and zoom top'); + assert_equals(transformAndZoomRect.width, 512, 'transform and zoom width'); + assert_equals(transformAndZoomRect.height, 512, 'transform and zoom height'); + }); + </script> +</body> |