Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Unified Diff: LayoutTests/inspector/audits/audits-test.js

Issue 596323002: DevTools: make ElementsTreeOutline shadow dom-based. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tests fixed Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/http/tests/inspector/console-test.js ('k') | LayoutTests/inspector/elements/edit-dom-test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 = "";
« no previous file with comments | « LayoutTests/http/tests/inspector/console-test.js ('k') | LayoutTests/inspector/elements/edit-dom-test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698