@percy/dom
Advanced tools
Comparing version 1.30.3-alpha.3 to 1.30.3-beta.0
@@ -521,3 +521,4 @@ (function() { | ||
clone.attachShadow({ | ||
mode: 'open' | ||
mode: 'open', | ||
serializable: true | ||
}); | ||
@@ -551,10 +552,22 @@ } | ||
function getOuterHTML(docElement) { | ||
// firefox doesn't serialize shadow DOM, we're awaiting API's by firefox to become ready and are not polyfilling it. | ||
if (!docElement.getInnerHTML) { | ||
// All major browsers in latest versions supports getHTML API to get serialized DOM | ||
// https://developer.mozilla.org/en-US/docs/Web/API/Element/getHTML | ||
// old firefox doesn't serialize shadow DOM, we're awaiting API's by firefox to become ready and are not polyfilling it. | ||
// new firefox from 128 onwards serializes it using getHTML | ||
/* istanbul ignore if: Only triggered in firefox <= 128 and tests runs on latest */ | ||
if (!docElement.getHTML) { | ||
return docElement.outerHTML; | ||
} | ||
// chromium gives us declarative shadow DOM serialization API | ||
let innerHTML = docElement.getInnerHTML({ | ||
includeShadowRoots: true | ||
}); | ||
let innerHTML = ''; | ||
/* istanbul ignore else if: Only triggered in chrome <= 128 and tests runs on latest */ | ||
if (docElement.getHTML) { | ||
innerHTML = docElement.getHTML({ | ||
serializableShadowRoots: true | ||
}); | ||
} else if (docElement.getInnerHTML) { | ||
innerHTML = docElement.getInnerHTML({ | ||
includeShadowRoots: true | ||
}); | ||
} | ||
docElement.textContent = ''; | ||
@@ -561,0 +574,0 @@ // Note: Here we are specifically passing replacer function to avoid any replacements due to |
{ | ||
"name": "@percy/dom", | ||
"version": "1.30.3-alpha.3", | ||
"version": "1.30.3-beta.0", | ||
"license": "MIT", | ||
@@ -12,3 +12,3 @@ "repository": { | ||
"access": "public", | ||
"tag": "alpha" | ||
"tag": "beta" | ||
}, | ||
@@ -39,3 +39,3 @@ "main": "dist/bundle.js", | ||
}, | ||
"gitHead": "4d36bd849268e2aa9987509c9fdd5d1224ce5157" | ||
"gitHead": "8f5a9cb4b287900c4b053302452ea6f84d20c2f1" | ||
} |
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
35963
708