@percy/dom
Advanced tools
Comparing version 1.10.0 to 1.10.1
@@ -108,6 +108,4 @@ (function() { | ||
function isCSSOM(styleSheet) { | ||
var _styleSheet$ownerNode, _styleSheet$ownerNode2; | ||
// no href, has a rulesheet, and isn't already in the DOM | ||
return !styleSheet.href && styleSheet.cssRules && !((_styleSheet$ownerNode = styleSheet.ownerNode) !== null && _styleSheet$ownerNode !== void 0 && (_styleSheet$ownerNode2 = _styleSheet$ownerNode.innerText) !== null && _styleSheet$ownerNode2 !== void 0 && _styleSheet$ownerNode2.trim().length); | ||
// no href, has a rulesheet, and has an owner node | ||
return !styleSheet.href && styleSheet.cssRules && styleSheet.ownerNode; | ||
} // Outputs in-memory CSSOM into their respective DOM nodes. | ||
@@ -123,5 +121,7 @@ | ||
style.type = 'text/css'; | ||
style.setAttribute('data-percy-element-id', styleId); | ||
style.setAttribute('data-percy-cssom-serialized', 'true'); | ||
style.innerHTML = Array.from(styleSheet.cssRules).reduce((prev, cssRule) => prev + cssRule.cssText, ''); | ||
style.innerHTML = Array.from(styleSheet.cssRules).map(cssRule => cssRule.cssText).join('\n'); | ||
cloneOwnerNode.parentNode.insertBefore(style, cloneOwnerNode.nextSibling); | ||
cloneOwnerNode.remove(); | ||
} | ||
@@ -128,0 +128,0 @@ } |
{ | ||
"name": "@percy/dom", | ||
"version": "1.10.0", | ||
"version": "1.10.1", | ||
"license": "MIT", | ||
@@ -37,3 +37,3 @@ "repository": { | ||
}, | ||
"gitHead": "a6934eda4fc3b84845ae606d7f5a901f25e0a56f" | ||
"gitHead": "3e16144300e8b49aab638ceb699630f4be71bb9f" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13864