Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-values/viewport-units-modify.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Crash when going from non-viewport to viewport units</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="elem" style="padding-left: 1vh">Test passes if there is no crash.</div>
<script>
test((t) => {
assert_not_equals(getComputedStyle(elem).paddingLeft, '0px');
elem.style.paddingLeft = '0';
assert_equals(getComputedStyle(elem).paddingLeft, '0px');
elem.style.paddingLeft = '1vh';
assert_not_equals(getComputedStyle(elem).paddingLeft, '0px');
});
</script>