Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/cssom/StyleSheetList-constructable-with-style-recalc.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<title>CSSOM - StyleSheetList does not include adopted style sheets even after style recalc</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style id="sheet1">
body { width: 50%; }
</style>
</head>
<body>
<script>
test(() => {
const sheet = new CSSStyleSheet();
document.adoptedStyleSheets = [sheet];
document.body.offsetTop;
var styleSheets = document.styleSheets;
assert_equals(styleSheets.length, 1);
assert_equals(styleSheets[0], sheet1.sheet);
}, 'document.styleSheets does not include adopted style sheets');
</script>
</body>
</html>