Automatic update from web-platform-tests WebKit export of https://bugs.webkit.org/show_bug.cgi?id=312074 (#59255) -- wpt-commits: 9c244115fe3c762d30bde8504058b6126425add1 wpt-pr: 59255
30 lines
1016 B
HTML
30 lines
1016 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>CSSOM - StyleSheetList does not include adopted style sheets in shadow roots</title>
|
|
<link rel="help" href="https://drafts.csswg.org/cssom/#css-style-sheet-collections">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
test(() => {
|
|
const host = document.createElement('div');
|
|
document.body.appendChild(host);
|
|
const shadow = host.attachShadow({mode: 'open'});
|
|
|
|
const style = document.createElement('style');
|
|
style.textContent = ':host { color: red }';
|
|
shadow.appendChild(style);
|
|
|
|
const sheet = new CSSStyleSheet();
|
|
shadow.adoptedStyleSheets = [sheet];
|
|
|
|
var styleSheets = shadow.styleSheets;
|
|
assert_equals(styleSheets.length, 1);
|
|
assert_equals(styleSheets[0], style.sheet);
|
|
}, 'shadowRoot.styleSheets does not include adopted style sheets');
|
|
</script>
|
|
</body>
|
|
</html>
|