1
0
Fork 0
firefox/testing/web-platform/tests/css/cssom/adoptedstylesheets-adopt-style-subresource.tentative.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

28 lines
874 B
HTML

<!doctype html>
<meta charset="utf-8">
<title>adoptedStyleSheets adopt link tag</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/10013">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<style id="styleSheet">
@import url("./resources/adoptedstylesheet-adopt-link.css");
</style>
<my-element id="host"></my-element>
<script>
customElements.define('my-element', class extends HTMLElement {
connectedCallback() {
this.attachShadow({mode:'open'}).append(document.createElement('div'));
const sheet = new CSSStyleSheet();
sheet.replaceSync(`
div {
display: block;
width: 100px;
height: 100px;
background: red;
}
`);
this.shadowRoot.adoptedStyleSheets = [sheet, styleSheet.sheet];
}
});
</script>