Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 2 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-viewport/zoom/parsing/zoom-computed.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Test: getComputedStyle().zoom</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
#container {
container-type: inline-size;
width: 100px;
}
</style>
<div id="container">
<div id="target"></div>
</div>
<script>
test_computed_value("zoom", "normal", "1");
test_computed_value("zoom", "1", "1");
test_computed_value("zoom", "1.5", "1.5");
test_computed_value("zoom", "0.75", "0.75");
test_computed_value("zoom", 'calc(1 + (sign(2cqw - 10px) * 0.5))', '0.5');
test_computed_value("zoom", "100%", "1");
test_computed_value("zoom", "150%", "1.5");
test_computed_value("zoom", "75%", "0.75");
test_computed_value("zoom", 'calc(100% + (sign(2cqw - 10px) * 50%))', '0.5');
// Legacy crap, wat
test_computed_value("zoom", "0", "1");
test_computed_value("zoom", "0%", "1");
</script>