Index: LayoutTests/inspector/audits/audits-test.js |
diff --git a/LayoutTests/inspector/audits/audits-test.js b/LayoutTests/inspector/audits/audits-test.js |
index 0806a20324b3486ccdeb8b41492f243921d413ff..49ec17c67fb86ec0363fb1ed01d2811dba820b31 100644 |
--- a/LayoutTests/inspector/audits/audits-test.js |
+++ b/LayoutTests/inspector/audits/audits-test.js |
@@ -26,12 +26,14 @@ InspectorTest.launchAllAudits = function(shouldReload, callback) |
InspectorTest.collectTextContent = function(element, indent) |
{ |
var nodeOutput = ""; |
- var child = element.firstChild; |
+ var child = element.shadowRoot || element.firstChild; |
+ var nonTextTags = { "STYLE": 1, "SCRIPT": 1 }; |
while (child) { |
if (child.nodeType === Node.TEXT_NODE) { |
- nodeOutput += child.nodeValue.replace("\u200B", ""); |
- } else if (child.nodeType === Node.ELEMENT_NODE) { |
+ if (!nonTextTags[child.parentElement.nodeName]) |
+ nodeOutput += child.nodeValue.replace("\u200B", ""); |
+ } else if (child.nodeType === Node.ELEMENT_NODE || child.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { |
if (nodeOutput !== "") { |
InspectorTest.addResult(indent + nodeOutput); |
nodeOutput = ""; |