mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
fix: adopted stylesheets (#2785)
This commit is contained in:
committed by
GitHub
parent
1cc853a318
commit
74696faf47
@@ -40,6 +40,10 @@ class AutonomousCustomElement extends HTMLElement {
|
||||
wrapper.appendChild(img);
|
||||
wrapper.appendChild(info);
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
this.shadowRoot.adoptedStyleSheets = [sheet];
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('autonomous-custom-element', AutonomousCustomElement);
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
<head>
|
||||
<title>Web components tests</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script>
|
||||
const sheet = new CSSStyleSheet();
|
||||
sheet.replaceSync('* { color: red !important; }')
|
||||
</script>
|
||||
<script type="text/javascript" src="../../test.js"></script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user