@percy/dom
Advanced tools
Comparing version 1.20.2 to 1.20.3
@@ -143,3 +143,19 @@ (function() { | ||
} | ||
function styleSheetFromNode(node) { | ||
/* istanbul ignore if: sanity check */ | ||
if (node.sheet) return node.sheet; | ||
// Cloned style nodes don't have a sheet instance unless they are within | ||
// a document; we get it by temporarily adding the rules to DOM | ||
const tempStyle = node.cloneNode(); | ||
tempStyle.setAttribute('data-percy-style-helper', ''); | ||
tempStyle.innerHTML = node.innerHTML; | ||
const clone = document.cloneNode(); | ||
clone.appendChild(tempStyle); | ||
const sheet = tempStyle.sheet; | ||
// Cleanup node | ||
tempStyle.remove(); | ||
return sheet; | ||
} | ||
// Returns a mostly random uid. | ||
@@ -183,18 +199,2 @@ function uid() { | ||
} | ||
function styleSheetFromNode(node) { | ||
/* istanbul ignore if: sanity check */ | ||
if (node.sheet) return node.sheet; | ||
// Cloned style nodes don't have a sheet instance unless they are within | ||
// a document; we get it by temporarily adding the rules to DOM | ||
const tempStyle = document.createElement('style'); | ||
tempStyle.setAttribute('data-percy-style-helper', ''); | ||
tempStyle.innerHTML = node.innerHTML; | ||
const clone = document.cloneNode(); | ||
clone.appendChild(tempStyle); | ||
const sheet = tempStyle.sheet; | ||
// Cleanup node | ||
tempStyle.remove(); | ||
return sheet; | ||
} | ||
function serializeCSSOM(_ref) { | ||
@@ -201,0 +201,0 @@ let { |
{ | ||
"name": "@percy/dom", | ||
"version": "1.20.2", | ||
"version": "1.20.3", | ||
"license": "MIT", | ||
@@ -37,3 +37,3 @@ "repository": { | ||
}, | ||
"gitHead": "eb789262833734cfc4b7dbb888e889f571eb886e" | ||
"gitHead": "520bd156af47080881b651e4819014cbacf76781" | ||
} |
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
26587