@applitools/dom-snapshot
Advanced tools
Comparing version 1.2.1 to 1.2.3
@@ -1,2 +0,2 @@ | ||
// @applitools/dom-snapshot@1.2.1 | ||
// @applitools/dom-snapshot@1.2.3 | ||
function __processPage() { | ||
@@ -71,3 +71,3 @@ var processPage = (function () { | ||
function elementNodeFactory(domNodes, elementNode) { | ||
let node; | ||
let node, manualChildNodeIndexes; | ||
const {nodeType} = elementNode; | ||
@@ -78,11 +78,10 @@ if ([NODE_TYPES.ELEMENT, NODE_TYPES.DOCUMENT_FRAGMENT_NODE].includes(nodeType)) { | ||
elementNode.nodeName === 'STYLE' && | ||
!elementNode.textContent && | ||
elementNode.sheet && | ||
elementNode.sheet.cssRules.length | ||
) { | ||
elementNode.appendChild( | ||
docNode.createTextNode( | ||
[...elementNode.sheet.cssRules].map(rule => rule.cssText).join(''), | ||
), | ||
); | ||
domNodes.push({ | ||
nodeType: NODE_TYPES.TEXT, | ||
nodeValue: [...elementNode.sheet.cssRules].map(rule => rule.cssText).join(''), | ||
}); | ||
manualChildNodeIndexes = [domNodes.length - 1]; | ||
} | ||
@@ -112,5 +111,7 @@ | ||
}), | ||
childNodeIndexes: elementNode.childNodes.length | ||
? childrenFactory(domNodes, elementNode.childNodes) | ||
: [], | ||
childNodeIndexes: | ||
manualChildNodeIndexes || | ||
(elementNode.childNodes.length | ||
? childrenFactory(domNodes, elementNode.childNodes) | ||
: []), | ||
}; | ||
@@ -117,0 +118,0 @@ |
@@ -1,2 +0,2 @@ | ||
// @applitools/dom-snapshot@1.2.1 | ||
// @applitools/dom-snapshot@1.2.3 | ||
function __processPageAndPoll() { | ||
@@ -123,3 +123,3 @@ var processPageAndPoll = (function () { | ||
function elementNodeFactory(domNodes, elementNode) { | ||
let node; | ||
let node, manualChildNodeIndexes; | ||
const {nodeType} = elementNode; | ||
@@ -130,11 +130,10 @@ if ([NODE_TYPES.ELEMENT, NODE_TYPES.DOCUMENT_FRAGMENT_NODE].includes(nodeType)) { | ||
elementNode.nodeName === 'STYLE' && | ||
!elementNode.textContent && | ||
elementNode.sheet && | ||
elementNode.sheet.cssRules.length | ||
) { | ||
elementNode.appendChild( | ||
docNode.createTextNode( | ||
[...elementNode.sheet.cssRules].map(rule => rule.cssText).join(''), | ||
), | ||
); | ||
domNodes.push({ | ||
nodeType: NODE_TYPES.TEXT, | ||
nodeValue: [...elementNode.sheet.cssRules].map(rule => rule.cssText).join(''), | ||
}); | ||
manualChildNodeIndexes = [domNodes.length - 1]; | ||
} | ||
@@ -164,5 +163,7 @@ | ||
}), | ||
childNodeIndexes: elementNode.childNodes.length | ||
? childrenFactory(domNodes, elementNode.childNodes) | ||
: [], | ||
childNodeIndexes: | ||
manualChildNodeIndexes || | ||
(elementNode.childNodes.length | ||
? childrenFactory(domNodes, elementNode.childNodes) | ||
: []), | ||
}; | ||
@@ -169,0 +170,0 @@ |
@@ -1,2 +0,2 @@ | ||
// @applitools/dom-snapshot@1.2.1 | ||
// @applitools/dom-snapshot@1.2.3 | ||
function __processPageAndSerialize() { | ||
@@ -123,3 +123,3 @@ var processPageAndSerialize = (function () { | ||
function elementNodeFactory(domNodes, elementNode) { | ||
let node; | ||
let node, manualChildNodeIndexes; | ||
const {nodeType} = elementNode; | ||
@@ -130,11 +130,10 @@ if ([NODE_TYPES.ELEMENT, NODE_TYPES.DOCUMENT_FRAGMENT_NODE].includes(nodeType)) { | ||
elementNode.nodeName === 'STYLE' && | ||
!elementNode.textContent && | ||
elementNode.sheet && | ||
elementNode.sheet.cssRules.length | ||
) { | ||
elementNode.appendChild( | ||
docNode.createTextNode( | ||
[...elementNode.sheet.cssRules].map(rule => rule.cssText).join(''), | ||
), | ||
); | ||
domNodes.push({ | ||
nodeType: NODE_TYPES.TEXT, | ||
nodeValue: [...elementNode.sheet.cssRules].map(rule => rule.cssText).join(''), | ||
}); | ||
manualChildNodeIndexes = [domNodes.length - 1]; | ||
} | ||
@@ -164,5 +163,7 @@ | ||
}), | ||
childNodeIndexes: elementNode.childNodes.length | ||
? childrenFactory(domNodes, elementNode.childNodes) | ||
: [], | ||
childNodeIndexes: | ||
manualChildNodeIndexes || | ||
(elementNode.childNodes.length | ||
? childrenFactory(domNodes, elementNode.childNodes) | ||
: []), | ||
}; | ||
@@ -169,0 +170,0 @@ |
{ | ||
"name": "@applitools/dom-snapshot", | ||
"version": "1.2.1", | ||
"version": "1.2.3", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -36,3 +36,3 @@ /* eslint-disable no-use-before-define */ | ||
function elementNodeFactory(domNodes, elementNode) { | ||
let node; | ||
let node, manualChildNodeIndexes; | ||
const {nodeType} = elementNode; | ||
@@ -43,11 +43,10 @@ if ([NODE_TYPES.ELEMENT, NODE_TYPES.DOCUMENT_FRAGMENT_NODE].includes(nodeType)) { | ||
elementNode.nodeName === 'STYLE' && | ||
!elementNode.textContent && | ||
elementNode.sheet && | ||
elementNode.sheet.cssRules.length | ||
) { | ||
elementNode.appendChild( | ||
docNode.createTextNode( | ||
[...elementNode.sheet.cssRules].map(rule => rule.cssText).join(''), | ||
), | ||
); | ||
domNodes.push({ | ||
nodeType: NODE_TYPES.TEXT, | ||
nodeValue: [...elementNode.sheet.cssRules].map(rule => rule.cssText).join(''), | ||
}); | ||
manualChildNodeIndexes = [domNodes.length - 1]; | ||
} | ||
@@ -77,5 +76,7 @@ | ||
}), | ||
childNodeIndexes: elementNode.childNodes.length | ||
? childrenFactory(domNodes, elementNode.childNodes) | ||
: [], | ||
childNodeIndexes: | ||
manualChildNodeIndexes || | ||
(elementNode.childNodes.length | ||
? childrenFactory(domNodes, elementNode.childNodes) | ||
: []), | ||
}; | ||
@@ -82,0 +83,0 @@ |
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
78417
1980