check if orphaned in docRewriteObserver

This commit is contained in:
tophf 2017-04-21 13:06:00 +03:00
parent 3713c252a8
commit 3b433adb42

View File

@ -246,6 +246,9 @@ function initDocRewriteObserver() {
}
// re-add styles if we detect documentElement being recreated
const reinjectStyles = () => {
if (!styleElements) {
return orphanCheck && orphanCheck();
}
ROOT = document.documentElement;
for (const el of styleElements.values()) {
addStyleElement(document.importNode(el, true));