mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Correctly clone dynami CSSStyleSheets (Fix #1370)
This commit is contained in:
@ -229,6 +229,15 @@ export class DocumentCloner {
|
||||
return tempIframe;
|
||||
}
|
||||
|
||||
if (node instanceof HTMLStyleElement && node.sheet && node.sheet.cssRules) {
|
||||
const css = [].slice
|
||||
.call(node.sheet.cssRules, 0)
|
||||
.reduce((css, rule) => css + rule.cssText, '');
|
||||
const style = node.cloneNode(false);
|
||||
style.textContent = css;
|
||||
return style;
|
||||
}
|
||||
|
||||
return node.cloneNode(false);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user