Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@percy/dom

Package Overview
Dependencies
Maintainers
1
Versions
240
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@percy/dom - npm Package Compare versions

Comparing version 1.28.7 to 1.28.8-beta.0

61

dist/bundle.js

@@ -223,29 +223,38 @@ (function() {

// in-memory CSSOM into their respective DOM nodes.
for (let styleSheet of dom.styleSheets) {
var _styleSheet$href;
if (isCSSOM(styleSheet)) {
let styleId = styleSheet.ownerNode.getAttribute('data-percy-element-id');
let cloneOwnerNode = clone.querySelector(`[data-percy-element-id="${styleId}"]`);
if (styleSheetsMatch(styleSheet, styleSheetFromNode(cloneOwnerNode))) continue;
let style = document.createElement('style');
style.type = 'text/css';
style.setAttribute('data-percy-element-id', styleId);
style.setAttribute('data-percy-cssom-serialized', 'true');
style.innerHTML = Array.from(styleSheet.cssRules).map(cssRule => cssRule.cssText).join('\n');
cloneOwnerNode.parentNode.insertBefore(style, cloneOwnerNode.nextSibling);
cloneOwnerNode.remove();
} else if ((_styleSheet$href = styleSheet.href) !== null && _styleSheet$href !== void 0 && _styleSheet$href.startsWith('blob:')) {
const styleLink = document.createElement('link');
styleLink.setAttribute('rel', 'stylesheet');
let resource = createStyleResource(styleSheet);
resources.add(resource);
styleLink.setAttribute('data-percy-blob-stylesheets-serialized', 'true');
styleLink.setAttribute('data-percy-serialized-attribute-href', resource.url);
let styleSheets = null;
// catch error in case styleSheets property is not available (overwritten to throw error)
try {
styleSheets = dom.styleSheets;
} catch {
warnings.add('Skipping `styleSheets` as it is not supported.');
}
if (styleSheets) {
for (let styleSheet of styleSheets) {
var _styleSheet$href;
if (isCSSOM(styleSheet)) {
let styleId = styleSheet.ownerNode.getAttribute('data-percy-element-id');
let cloneOwnerNode = clone.querySelector(`[data-percy-element-id="${styleId}"]`);
if (styleSheetsMatch(styleSheet, styleSheetFromNode(cloneOwnerNode))) continue;
let style = document.createElement('style');
style.type = 'text/css';
style.setAttribute('data-percy-element-id', styleId);
style.setAttribute('data-percy-cssom-serialized', 'true');
style.innerHTML = Array.from(styleSheet.cssRules).map(cssRule => cssRule.cssText).join('\n');
cloneOwnerNode.parentNode.insertBefore(style, cloneOwnerNode.nextSibling);
cloneOwnerNode.remove();
} else if ((_styleSheet$href = styleSheet.href) !== null && _styleSheet$href !== void 0 && _styleSheet$href.startsWith('blob:')) {
const styleLink = document.createElement('link');
styleLink.setAttribute('rel', 'stylesheet');
let resource = createStyleResource(styleSheet);
resources.add(resource);
styleLink.setAttribute('data-percy-blob-stylesheets-serialized', 'true');
styleLink.setAttribute('data-percy-serialized-attribute-href', resource.url);
/* istanbul ignore next: tested, but coverage is stripped */
if (clone.constructor.name === 'HTMLDocument' || clone.constructor.name === 'DocumentFragment') {
// handle document and iframe
clone.body.prepend(styleLink);
} else if (clone.constructor.name === 'ShadowRoot') {
clone.prepend(styleLink);
/* istanbul ignore next: tested, but coverage is stripped */
if (clone.constructor.name === 'HTMLDocument' || clone.constructor.name === 'DocumentFragment') {
// handle document and iframe
clone.body.prepend(styleLink);
} else if (clone.constructor.name === 'ShadowRoot') {
clone.prepend(styleLink);
}
}

@@ -252,0 +261,0 @@ }

{
"name": "@percy/dom",
"version": "1.28.7",
"version": "1.28.8-beta.0",
"license": "MIT",

@@ -12,3 +12,3 @@ "repository": {

"access": "public",
"tag": "latest"
"tag": "beta"
},

@@ -39,3 +39,3 @@ "main": "dist/bundle.js",

},
"gitHead": "d920b185772c020b9df6719142623844aeccb9af"
"gitHead": "866f110837fabc0607d9b817b2e4373bc91bc474"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc