Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/cssom/getComputedStyle-page-rule.xhtml - WPT Dashboard Interop Dashboard
<head>
<title>getComputedStyle does not crash with @page rules</title>
<meta charset="utf-8" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style type="text/css">
@page {
margin: 0;
}
</style>
</head>
<body>
<p id="target">Test</p>
<script>
"use strict";
test(() => {
const styles = window.getComputedStyle(document.getElementById("target"));
styles.color;
}, "getComputedStyle should not throw when a @page rule is present");
</script>
</body>
</html>