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

Unified Diff: Source/devtools/front_end/ui/DOMExtension.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 | « Source/devtools/front_end/inspectorSyntaxHighlight.css ('k') | Source/devtools/front_end/ui/RootView.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/DOMExtension.js
diff --git a/Source/devtools/front_end/ui/DOMExtension.js b/Source/devtools/front_end/ui/DOMExtension.js
index 0d9ab5f3c76062079e0d733ab6931fd704ea1913..77b5856ecbe0493f3c3d7b9c488065b36194913f 100644
--- a/Source/devtools/front_end/ui/DOMExtension.js
+++ b/Source/devtools/front_end/ui/DOMExtension.js
@@ -656,6 +656,22 @@ Element.prototype.selectionLeftOffset = function()
}
/**
+ * @return {string}
+ */
+Node.prototype.deepTextContent = function()
+{
+ var node = this.traverseNextTextNode(this);
+ var result = [];
+ var nonTextTags = { "STYLE": 1, "SCRIPT": 1 };
+ while (node) {
+ if (!nonTextTags[node.parentElement.nodeName])
+ result.push(node.textContent);
+ node = node.traverseNextTextNode(this);
+ }
+ return result.join("");
+}
+
+/**
* @param {?Node} node
* @return {boolean}
*/
@@ -706,14 +722,16 @@ Node.prototype.isSelfOrDescendant = function(node)
*/
Node.prototype.traverseNextNode = function(stayWithin)
{
- var node = this.firstChild;
- if (node)
- return node;
+ if (this.firstChild)
+ return this.firstChild;
+
+ if (this.shadowRoot)
+ return this.shadowRoot;
if (stayWithin && this === stayWithin)
return null;
- node = this.nextSibling;
+ var node = this.nextSibling;
if (node)
return node;
« no previous file with comments | « Source/devtools/front_end/inspectorSyntaxHighlight.css ('k') | Source/devtools/front_end/ui/RootView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698