<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[214844] trunk/Source/WebInspectorUI</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/214844">214844</a></dd>
<dt>Author</dt> <dd>mattbaker@apple.com</dd>
<dt>Date</dt> <dd>2017-04-03 15:09:23 -0700 (Mon, 03 Apr 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Elements tab: show indicators for hidden DOM breakpoints
https://bugs.webkit.org/show_bug.cgi?id=168761
Reviewed by Timothy Hatcher.
* Localizations/en.lproj/localizedStrings.js:
New DOM breakpoint content menu item.
* UserInterface/Views/DOMTreeContentView.css:
(.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.subtree):
(.content-view.dom-tree .tree-outline.dom li.expanded .status-image.breakpoint.subtree):
New styles for collapsed breakpoint marker.
* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement):
(WebInspector.DOMTreeElement.prototype.set breakpointStatus):
If the status change indicates the only breakpoint was added or removed,
update subtree breakpoint counts on the element's parent chain.
(WebInspector.DOMTreeElement.prototype.revealAndHighlight):
Reveal the tree element, and add a highlighted line animation
identical to the one used used by TextEditor.
(WebInspector.DOMTreeElement.prototype.subtreeBreakpointCountDidChange):
(WebInspector.DOMTreeElement.prototype.updateSelectionArea):
Selection area should be updated when animating the element highlight.
(WebInspector.DOMTreeElement.prototype.onreveal):
Animate highlight if needed.
(WebInspector.DOMTreeElement.prototype._updateBreakpointStatus):
(WebInspector.DOMTreeElement.prototype._statusImageClicked):
Do nothing when clicking the collapsed breakpoint marker.
(WebInspector.DOMTreeElement.prototype._statusImageContextmenu):
Add "Reveal Breakpoint" menu item. Reveals the first descendant
with at least one breakpoint.
(WebInspector.DOMTreeElement.prototype._highlightAnimationEnd):
* UserInterface/Views/DOMTreeOutline.css:
(@keyframes dom-tree-outline-highlight-fadeout):
(.highlight .selection-area):
Styles for highlight fade animation.
* UserInterface/Views/TreeElement.js:
(WebInspector.TreeElement.prototype.selfOrDescendant):
* UserInterface/Views/TreeOutline.js:
(WebInspector.TreeOutline.prototype.selfOrDescendant):
Find a node matching a predicate.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeOutlinecss">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTreeOutlinejs">trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (214843 => 214844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2017-04-03 22:07:46 UTC (rev 214843)
+++ trunk/Source/WebInspectorUI/ChangeLog        2017-04-03 22:09:23 UTC (rev 214844)
</span><span class="lines">@@ -1,5 +1,55 @@
</span><span class="cx"> 2017-04-03 Matt Baker <mattbaker@apple.com>
</span><span class="cx">
</span><ins>+ Web Inspector: Elements tab: show indicators for hidden DOM breakpoints
+ https://bugs.webkit.org/show_bug.cgi?id=168761
+
+ Reviewed by Timothy Hatcher.
+
+ * Localizations/en.lproj/localizedStrings.js:
+ New DOM breakpoint content menu item.
+
+ * UserInterface/Views/DOMTreeContentView.css:
+ (.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.subtree):
+ (.content-view.dom-tree .tree-outline.dom li.expanded .status-image.breakpoint.subtree):
+ New styles for collapsed breakpoint marker.
+
+ * UserInterface/Views/DOMTreeElement.js:
+ (WebInspector.DOMTreeElement):
+ (WebInspector.DOMTreeElement.prototype.set breakpointStatus):
+ If the status change indicates the only breakpoint was added or removed,
+ update subtree breakpoint counts on the element's parent chain.
+
+ (WebInspector.DOMTreeElement.prototype.revealAndHighlight):
+ Reveal the tree element, and add a highlighted line animation
+ identical to the one used used by TextEditor.
+
+ (WebInspector.DOMTreeElement.prototype.subtreeBreakpointCountDidChange):
+ (WebInspector.DOMTreeElement.prototype.updateSelectionArea):
+ Selection area should be updated when animating the element highlight.
+ (WebInspector.DOMTreeElement.prototype.onreveal):
+ Animate highlight if needed.
+ (WebInspector.DOMTreeElement.prototype._updateBreakpointStatus):
+ (WebInspector.DOMTreeElement.prototype._statusImageClicked):
+ Do nothing when clicking the collapsed breakpoint marker.
+ (WebInspector.DOMTreeElement.prototype._statusImageContextmenu):
+ Add "Reveal Breakpoint" menu item. Reveals the first descendant
+ with at least one breakpoint.
+
+ (WebInspector.DOMTreeElement.prototype._highlightAnimationEnd):
+
+ * UserInterface/Views/DOMTreeOutline.css:
+ (@keyframes dom-tree-outline-highlight-fadeout):
+ (.highlight .selection-area):
+ Styles for highlight fade animation.
+
+ * UserInterface/Views/TreeElement.js:
+ (WebInspector.TreeElement.prototype.selfOrDescendant):
+ * UserInterface/Views/TreeOutline.js:
+ (WebInspector.TreeOutline.prototype.selfOrDescendant):
+ Find a node matching a predicate.
+
+2017-04-03 Matt Baker <mattbaker@apple.com>
+
</ins><span class="cx"> Web Inspector: DetailsSection should hide header "options" when collapsed
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=170029
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (214843 => 214844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2017-04-03 22:07:46 UTC (rev 214843)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2017-04-03 22:09:23 UTC (rev 214844)
</span><span class="lines">@@ -682,6 +682,7 @@
</span><span class="cx"> localizedStrings["Retained Size"] = "Retained Size";
</span><span class="cx"> localizedStrings["Return type for anonymous function"] = "Return type for anonymous function";
</span><span class="cx"> localizedStrings["Return type for function: %s"] = "Return type for function: %s";
</span><ins>+localizedStrings["Reveal Breakpoint"] = "Reveal Breakpoint";
</ins><span class="cx"> localizedStrings["Reveal in DOM Tree"] = "Reveal in DOM Tree";
</span><span class="cx"> localizedStrings["Reveal in Debugger Tab"] = "Reveal in Debugger Tab";
</span><span class="cx"> localizedStrings["Reveal in Original Resource"] = "Reveal in Original Resource";
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeContentViewcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.css (214843 => 214844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.css        2017-04-03 22:07:46 UTC (rev 214843)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.css        2017-04-03 22:09:23 UTC (rev 214844)
</span><span class="lines">@@ -84,3 +84,12 @@
</span><span class="cx"> fill: var(--breakpoint-unresolved-disabled-fill-color);
</span><span class="cx"> stroke: var(--breakpoint-unresolved-disabled-stroke-color);
</span><span class="cx"> }
</span><ins>+
+.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.subtree {
+ fill: none;
+ opacity: 0.6;
+}
+
+.content-view.dom-tree .tree-outline.dom li.expanded .status-image.breakpoint.subtree {
+ display: none;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js (214843 => 214844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js        2017-04-03 22:07:46 UTC (rev 214843)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js        2017-04-03 22:09:23 UTC (rev 214844)
</span><span class="lines">@@ -42,6 +42,10 @@
</span><span class="cx"> this._searchQuery = null;
</span><span class="cx"> this._expandedChildrenLimit = WebInspector.DOMTreeElement.InitialChildrenLimit;
</span><span class="cx"> this._breakpointStatus = WebInspector.DOMTreeElement.BreakpointStatus.None;
</span><ins>+ this._animatingHighlight = false;
+ this._shouldHighlightAfterReveal = false;
+ this._boundHighlightAnimationEnd = this._highlightAnimationEnd.bind(this);
+ this._subtreeBreakpointCount = 0;
</ins><span class="cx">
</span><span class="cx"> this._recentlyModifiedAttributes = [];
</span><span class="cx"> this._boundNodeChangedAnimationEnd = this._nodeChangedAnimationEnd.bind(this);
</span><span class="lines">@@ -75,10 +79,40 @@
</span><span class="cx"> if (this._breakpointStatus === status)
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+ let increment;
+ if (this._breakpointStatus === WebInspector.DOMTreeElement.BreakpointStatus.None)
+ increment = 1;
+ else if (status === WebInspector.DOMTreeElement.BreakpointStatus.None)
+ increment = -1;
+
</ins><span class="cx"> this._breakpointStatus = status;
</span><span class="cx"> this._updateBreakpointStatus();
</span><ins>+
+ if (!increment)
+ return;
+
+ let parentElement = this.parent;
+ while (parentElement && !parentElement.root) {
+ parentElement.subtreeBreakpointCountDidChange(increment);
+ parentElement = parentElement.parent;
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ revealAndHighlight()
+ {
+ if (this._animatingHighlight)
+ return;
+
+ this._shouldHighlightAfterReveal = true;
+ this.reveal();
+ }
+
+ subtreeBreakpointCountDidChange(increment)
+ {
+ this._subtreeBreakpointCount += increment;
+ this._updateBreakpointStatus();
+ }
+
</ins><span class="cx"> isCloseTag()
</span><span class="cx"> {
</span><span class="cx"> return this._elementCloseTag;
</span><span class="lines">@@ -298,7 +332,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // If there's no reason to have a selection area, remove the DOM element.
</span><del>- let indicatesTreeOutlineState = this.treeOutline && (this.treeOutline.dragOverTreeElement === this || this.treeOutline.selectedTreeElement === this);
</del><ins>+ let indicatesTreeOutlineState = this.treeOutline && (this.treeOutline.dragOverTreeElement === this || this.treeOutline.selectedTreeElement === this || this._animatingHighlight);
</ins><span class="cx"> if (!this.hovered && !this.pseudoClassesEnabled && !indicatesTreeOutlineState) {
</span><span class="cx"> if (this._selectionElement) {
</span><span class="cx"> this._selectionElement.remove();
</span><span class="lines">@@ -534,13 +568,26 @@
</span><span class="cx">
</span><span class="cx"> onreveal()
</span><span class="cx"> {
</span><del>- if (this.listItemElement) {
- var tagSpans = this.listItemElement.getElementsByClassName("html-tag-name");
- if (tagSpans.length)
- tagSpans[0].scrollIntoViewIfNeeded(false);
- else
- this.listItemElement.scrollIntoViewIfNeeded(false);
- }
</del><ins>+ let listItemElement = this.listItemElement;
+ if (!listItemElement)
+ return;
+
+ let tagSpans = listItemElement.getElementsByClassName("html-tag-name");
+ if (tagSpans.length)
+ tagSpans[0].scrollIntoViewIfNeeded(false);
+ else
+ listItemElement.scrollIntoViewIfNeeded(false);
+
+ if (!this._shouldHighlightAfterReveal)
+ return;
+
+ this._shouldHighlightAfterReveal = false;
+ this._animatingHighlight = true;
+
+ this.updateSelectionArea();
+
+ listItemElement.addEventListener("animationend", this._boundHighlightAnimationEnd);
+ listItemElement.classList.add(WebInspector.DOMTreeElement.HighlightStyleClassName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> onselect(treeElement, selectedByUser)
</span><span class="lines">@@ -1675,7 +1722,10 @@
</span><span class="cx"> if (!listItemElement)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (this._breakpointStatus === WebInspector.DOMTreeElement.BreakpointStatus.None) {
</del><ins>+ let hasBreakpoint = this._breakpointStatus !== WebInspector.DOMTreeElement.BreakpointStatus.None;
+ let hasSubtreeBreakpoints = !!this._subtreeBreakpointCount;
+
+ if (!hasBreakpoint && !hasSubtreeBreakpoints) {
</ins><span class="cx"> if (this._statusImageElement)
</span><span class="cx"> this._statusImageElement.remove();
</span><span class="cx"> return;
</span><span class="lines">@@ -1689,6 +1739,8 @@
</span><span class="cx"> this._statusImageElement.addEventListener("mousedown", (event) => { event.stopPropagation(); });
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ this._statusImageElement.classList.toggle("subtree", !hasBreakpoint && hasSubtreeBreakpoints);
+
</ins><span class="cx"> this.listItemElement.insertBefore(this._statusImageElement, this.listItemElement.firstChild);
</span><span class="cx">
</span><span class="cx"> let disabled = this._breakpointStatus === WebInspector.DOMTreeElement.BreakpointStatus.DisabledBreakpoint;
</span><span class="lines">@@ -1697,6 +1749,9 @@
</span><span class="cx">
</span><span class="cx"> _statusImageClicked(event)
</span><span class="cx"> {
</span><ins>+ if (this._breakpointStatus === WebInspector.DOMTreeElement.BreakpointStatus.None)
+ return;
+
</ins><span class="cx"> if (event.button !== 0 || event.ctrlKey)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -1710,11 +1765,39 @@
</span><span class="cx">
</span><span class="cx"> _statusImageContextmenu(event)
</span><span class="cx"> {
</span><del>- const allowEditing = true;
</del><ins>+ let hasBreakpoint = this._breakpointStatus !== WebInspector.DOMTreeElement.BreakpointStatus.None;
+ let hasSubtreeBreakpoints = !!this._subtreeBreakpointCount;
+ if (!hasBreakpoint && !hasSubtreeBreakpoints)
+ return;
</ins><span class="cx">
</span><span class="cx"> let contextMenu = WebInspector.ContextMenu.createFromEvent(event);
</span><del>- WebInspector.DOMBreakpointTreeController.appendBreakpointContextMenuItems(contextMenu, this.representedObject, allowEditing);
</del><ins>+ if (hasBreakpoint) {
+ const allowEditing = true;
+ WebInspector.DOMBreakpointTreeController.appendBreakpointContextMenuItems(contextMenu, this.representedObject, allowEditing);
+ return;
+ }
+
+ contextMenu.appendItem(WebInspector.UIString("Reveal Breakpoint"), () => {
+ let breakpointTreeElement = this.selfOrDescendant((treeElement) => treeElement.breakpointStatus && treeElement.breakpointStatus !== WebInspector.DOMTreeElement.BreakpointStatus.None);
+ console.assert(breakpointTreeElement, "Missing breakpoint descendant.", this)
+ if (!breakpointTreeElement)
+ return;
+
+ breakpointTreeElement.revealAndHighlight();
+ });
</ins><span class="cx"> }
</span><ins>+
+ _highlightAnimationEnd()
+ {
+ let listItemElement = this.listItemElement;
+ if (!listItemElement)
+ return;
+
+ listItemElement.removeEventListener("animationend", this._boundHighlightAnimationEnd);
+ listItemElement.classList.remove(WebInspector.DOMTreeElement.HighlightStyleClassName);
+
+ this._animatingHighlight = false;
+ }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.DOMTreeElement.InitialChildrenLimit = 500;
</span><span class="lines">@@ -1743,5 +1826,6 @@
</span><span class="cx"> DisabledBreakpoint: Symbol("disabled-breakpoint"),
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+WebInspector.DOMTreeElement.HighlightStyleClassName = "highlight";
</ins><span class="cx"> WebInspector.DOMTreeElement.SearchHighlightStyleClassName = "search-highlight";
</span><span class="cx"> WebInspector.DOMTreeElement.BouncyHighlightStyleClassName = "bouncy-highlight";
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeOutlinecss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css (214843 => 214844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css        2017-04-03 22:07:46 UTC (rev 214843)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css        2017-04-03 22:09:23 UTC (rev 214844)
</span><span class="lines">@@ -295,3 +295,11 @@
</span><span class="cx"> .node-state-changed {
</span><span class="cx"> animation: node-state-changed 1s cubic-bezier(0.25, 0, 0.25, 1);
</span><span class="cx"> }
</span><ins>+
+@keyframes dom-tree-outline-highlight-fadeout {
+ from { background-color: highlight; }
+}
+
+.highlight .selection-area {
+ animation: "dom-tree-outline-highlight-fadeout" 2s;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js (214843 => 214844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js        2017-04-03 22:07:46 UTC (rev 214843)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js        2017-04-03 22:09:23 UTC (rev 214844)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx"> removeChildAtIndex() { return WebInspector.TreeOutline.prototype.removeChildAtIndex.apply(this, arguments); }
</span><span class="cx"> removeChildren() { return WebInspector.TreeOutline.prototype.removeChildren.apply(this, arguments); }
</span><span class="cx"> removeChildrenRecursive() { return WebInspector.TreeOutline.prototype.removeChildrenRecursive.apply(this, arguments); }
</span><ins>+ selfOrDescendant() { return WebInspector.TreeOutline.prototype.selfOrDescendant.apply(this, arguments); }
</ins><span class="cx">
</span><span class="cx"> get arrowToggleWidth()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTreeOutlinejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js (214843 => 214844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js        2017-04-03 22:07:46 UTC (rev 214843)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js        2017-04-03 22:09:23 UTC (rev 214844)
</span><span class="lines">@@ -397,6 +397,20 @@
</span><span class="cx"> return null;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ selfOrDescendant(predicate)
+ {
+ let treeElements = [this];
+ while (treeElements.length) {
+ let treeElement = treeElements.shift();
+ if (predicate(treeElement))
+ return treeElement;
+
+ treeElements = treeElements.concat(treeElement.children);
+ }
+
+ return false;
+ }
+
</ins><span class="cx"> findTreeElement(representedObject, isAncestor, getParent)
</span><span class="cx"> {
</span><span class="cx"> if (!representedObject)
</span></span></pre>
</div>
</div>
</body>
</html>