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

Side by Side Diff: Source/devtools/front_end/ElementsTreeOutline.js

Issue 218703002: DevTools: [wip] move Elements panel off WebInspector.domModel and single tree outline. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 13 matching lines...) Expand all
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @extends {TreeOutline} 33 * @extends {TreeOutline}
34 * @param {!WebInspector.Target} target
34 * @param {boolean=} omitRootDOMNode 35 * @param {boolean=} omitRootDOMNode
35 * @param {boolean=} selectEnabled 36 * @param {boolean=} selectEnabled
36 * @param {function(!WebInspector.ContextMenu, !WebInspector.DOMNode)=} contextM enuCallback 37 * @param {function(!WebInspector.ContextMenu, !WebInspector.DOMNode)=} contextM enuCallback
37 * @param {function(!DOMAgent.NodeId, string, boolean)=} setPseudoClassCallback 38 * @param {function(!WebInspector.DOMNode, string, boolean)=} setPseudoClassCall back
38 */ 39 */
39 WebInspector.ElementsTreeOutline = function(omitRootDOMNode, selectEnabled, cont extMenuCallback, setPseudoClassCallback) 40 WebInspector.ElementsTreeOutline = function(target, omitRootDOMNode, selectEnabl ed, contextMenuCallback, setPseudoClassCallback)
40 { 41 {
42 this._target = target;
43 this._domModel = target.domModel;
41 this.element = document.createElement("ol"); 44 this.element = document.createElement("ol");
42 this.element.className = "elements-tree-outline"; 45 this.element.className = "elements-tree-outline";
43 this.element.addEventListener("mousedown", this._onmousedown.bind(this), fal se); 46 this.element.addEventListener("mousedown", this._onmousedown.bind(this), fal se);
44 this.element.addEventListener("mousemove", this._onmousemove.bind(this), fal se); 47 this.element.addEventListener("mousemove", this._onmousemove.bind(this), fal se);
45 this.element.addEventListener("mouseout", this._onmouseout.bind(this), false ); 48 this.element.addEventListener("mouseout", this._onmouseout.bind(this), false );
46 this.element.addEventListener("dragstart", this._ondragstart.bind(this), fal se); 49 this.element.addEventListener("dragstart", this._ondragstart.bind(this), fal se);
47 this.element.addEventListener("dragover", this._ondragover.bind(this), false ); 50 this.element.addEventListener("dragover", this._ondragover.bind(this), false );
48 this.element.addEventListener("dragleave", this._ondragleave.bind(this), fal se); 51 this.element.addEventListener("dragleave", this._ondragleave.bind(this), fal se);
49 this.element.addEventListener("drop", this._ondrop.bind(this), false); 52 this.element.addEventListener("drop", this._ondrop.bind(this), false);
50 this.element.addEventListener("dragend", this._ondragend.bind(this), false); 53 this.element.addEventListener("dragend", this._ondragend.bind(this), false);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 "\u200f": "rlm", 96 "\u200f": "rlm",
94 "\u202a": "#8234", // LRE 97 "\u202a": "#8234", // LRE
95 "\u202b": "#8235", // RLE 98 "\u202b": "#8235", // RLE
96 "\u202c": "#8236", // PDF 99 "\u202c": "#8236", // PDF
97 "\u202d": "#8237", // LRO 100 "\u202d": "#8237", // LRO
98 "\u202e": "#8238" // RLO 101 "\u202e": "#8238" // RLO
99 } 102 }
100 103
101 WebInspector.ElementsTreeOutline.prototype = { 104 WebInspector.ElementsTreeOutline.prototype = {
102 /** 105 /**
106 * @return {!WebInspector.Target}
107 */
108 target: function()
109 {
110 return this._target;
111 },
112
113 /**
114 * @return {!WebInspector.DOMModel}
115 */
116 domModel: function()
117 {
118 return this._domModel;
119 },
120
121 /**
103 * @param {number} width 122 * @param {number} width
104 */ 123 */
105 setVisibleWidth: function(width) 124 setVisibleWidth: function(width)
106 { 125 {
107 this._visibleWidth = width; 126 this._visibleWidth = width;
108 if (this._multilineEditing) 127 if (this._multilineEditing)
109 this._multilineEditing.setWidth(this._visibleWidth); 128 this._multilineEditing.setWidth(this._visibleWidth);
110 }, 129 },
111 130
112 _createNodeDecorators: function() 131 _createNodeDecorators: function()
113 { 132 {
114 this._nodeDecorators = []; 133 this._nodeDecorators = [];
115 this._nodeDecorators.push(new WebInspector.ElementsTreeOutline.PseudoSta teDecorator()); 134 this._nodeDecorators.push(new WebInspector.ElementsTreeOutline.PseudoSta teDecorator());
116 }, 135 },
117 136
118 wireToDomAgent: function() 137 wireToDOMModel: function()
119 { 138 {
120 this._elementsTreeUpdater = new WebInspector.ElementsTreeUpdater(this); 139 this._elementsTreeUpdater = new WebInspector.ElementsTreeUpdater(this._t arget.domModel, this);
121 }, 140 },
122 141
123 /** 142 /**
124 * @param {boolean} visible 143 * @param {boolean} visible
125 */ 144 */
126 setVisible: function(visible) 145 setVisible: function(visible)
127 { 146 {
128 this._visible = visible; 147 this._visible = visible;
129 if (!this._visible) 148 if (!this._visible)
130 return; 149 return;
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 if (this._previousHoveredElement) { 409 if (this._previousHoveredElement) {
391 this._previousHoveredElement.hovered = false; 410 this._previousHoveredElement.hovered = false;
392 delete this._previousHoveredElement; 411 delete this._previousHoveredElement;
393 } 412 }
394 413
395 if (element) { 414 if (element) {
396 element.hovered = true; 415 element.hovered = true;
397 this._previousHoveredElement = element; 416 this._previousHoveredElement = element;
398 } 417 }
399 418
400 WebInspector.domModel.highlightDOMNode(element && element._node ? elemen t._node.id : 0); 419 this._domModel.highlightDOMNode(element && element._node ? element._node .id : 0);
401 }, 420 },
402 421
403 _onmouseout: function(event) 422 _onmouseout: function(event)
404 { 423 {
405 var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY) ; 424 var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY) ;
406 if (nodeUnderMouse && nodeUnderMouse.isDescendant(this.element)) 425 if (nodeUnderMouse && nodeUnderMouse.isDescendant(this.element))
407 return; 426 return;
408 427
409 if (this._previousHoveredElement) { 428 if (this._previousHoveredElement) {
410 this._previousHoveredElement.hovered = false; 429 this._previousHoveredElement.hovered = false;
411 delete this._previousHoveredElement; 430 delete this._previousHoveredElement;
412 } 431 }
413 432
414 WebInspector.domModel.hideDOMNodeHighlight(); 433 this._domModel.hideDOMNodeHighlight();
415 }, 434 },
416 435
417 _ondragstart: function(event) 436 _ondragstart: function(event)
418 { 437 {
419 if (!window.getSelection().isCollapsed) 438 if (!window.getSelection().isCollapsed)
420 return false; 439 return false;
421 if (event.target.nodeName === "A") 440 if (event.target.nodeName === "A")
422 return false; 441 return false;
423 442
424 var treeElement = this._treeElementFromEvent(event); 443 var treeElement = this._treeElementFromEvent(event);
425 if (!treeElement) 444 if (!treeElement)
426 return false; 445 return false;
427 446
428 if (!this._isValidDragSourceOrTarget(treeElement)) 447 if (!this._isValidDragSourceOrTarget(treeElement))
429 return false; 448 return false;
430 449
431 if (treeElement._node.nodeName() === "BODY" || treeElement._node.nodeNam e() === "HEAD") 450 if (treeElement._node.nodeName() === "BODY" || treeElement._node.nodeNam e() === "HEAD")
432 return false; 451 return false;
433 452
434 event.dataTransfer.setData("text/plain", treeElement.listItemElement.tex tContent); 453 event.dataTransfer.setData("text/plain", treeElement.listItemElement.tex tContent);
435 event.dataTransfer.effectAllowed = "copyMove"; 454 event.dataTransfer.effectAllowed = "copyMove";
436 this._treeElementBeingDragged = treeElement; 455 this._treeElementBeingDragged = treeElement;
437 456
438 WebInspector.domModel.hideDOMNodeHighlight(); 457 this._domModel.hideDOMNodeHighlight();
439 458
440 return true; 459 return true;
441 }, 460 },
442 461
443 _ondragover: function(event) 462 _ondragover: function(event)
444 { 463 {
445 if (!this._treeElementBeingDragged) 464 if (!this._treeElementBeingDragged)
446 return false; 465 return false;
447 466
448 var treeElement = this._treeElementFromEvent(event); 467 var treeElement = this._treeElementFromEvent(event);
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 * @param {!DOMAgent.NodeId=} nodeId 678 * @param {!DOMAgent.NodeId=} nodeId
660 */ 679 */
661 _selectNodeAfterEdit: function(wasExpanded, error, nodeId) 680 _selectNodeAfterEdit: function(wasExpanded, error, nodeId)
662 { 681 {
663 if (error) 682 if (error)
664 return; 683 return;
665 684
666 // Select it and expand if necessary. We force tree update so that it pr ocesses dom events and is up to date. 685 // Select it and expand if necessary. We force tree update so that it pr ocesses dom events and is up to date.
667 this._updateModifiedNodes(); 686 this._updateModifiedNodes();
668 687
669 var newNode = nodeId ? WebInspector.domModel.nodeForId(nodeId) : null; 688 var newNode = nodeId ? this._domModel.nodeForId(nodeId) : null;
670 if (!newNode) 689 if (!newNode)
671 return; 690 return;
672 691
673 this.selectDOMNode(newNode, true); 692 this.selectDOMNode(newNode, true);
674 693
675 var newTreeItem = this.findTreeElement(newNode); 694 var newTreeItem = this.findTreeElement(newNode);
676 if (wasExpanded) { 695 if (wasExpanded) {
677 if (newTreeItem) 696 if (newTreeItem)
678 newTreeItem.expand(); 697 newTreeItem.expand();
679 } 698 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 783
765 /** 784 /**
766 * @constructor 785 * @constructor
767 * @implements {WebInspector.ElementsTreeOutline.ElementDecorator} 786 * @implements {WebInspector.ElementsTreeOutline.ElementDecorator}
768 */ 787 */
769 WebInspector.ElementsTreeOutline.PseudoStateDecorator = function() 788 WebInspector.ElementsTreeOutline.PseudoStateDecorator = function()
770 { 789 {
771 WebInspector.ElementsTreeOutline.ElementDecorator.call(this); 790 WebInspector.ElementsTreeOutline.ElementDecorator.call(this);
772 } 791 }
773 792
774 WebInspector.ElementsTreeOutline.PseudoStateDecorator.PropertyName = "pseudoStat e";
775
776 WebInspector.ElementsTreeOutline.PseudoStateDecorator.prototype = { 793 WebInspector.ElementsTreeOutline.PseudoStateDecorator.prototype = {
777 /** 794 /**
778 * @param {!WebInspector.DOMNode} node 795 * @param {!WebInspector.DOMNode} node
779 * @return {?string} 796 * @return {?string}
780 */ 797 */
781 decorate: function(node) 798 decorate: function(node)
782 { 799 {
783 if (node.nodeType() !== Node.ELEMENT_NODE) 800 if (node.nodeType() !== Node.ELEMENT_NODE)
784 return null; 801 return null;
785 var propertyValue = node.getUserProperty(WebInspector.ElementsTreeOutlin e.PseudoStateDecorator.PropertyName); 802 var propertyValue = node.getUserProperty(WebInspector.CSSStyleModel.Pseu doStatePropertyName);
786 if (!propertyValue) 803 if (!propertyValue)
787 return null; 804 return null;
788 return WebInspector.UIString("Element state: %s", ":" + propertyValue.jo in(", :")); 805 return WebInspector.UIString("Element state: %s", ":" + propertyValue.jo in(", :"));
789 }, 806 },
790 807
791 /** 808 /**
792 * @param {!WebInspector.DOMNode} node 809 * @param {!WebInspector.DOMNode} node
793 * @return {?string} 810 * @return {?string}
794 */ 811 */
795 decorateAncestor: function(node) 812 decorateAncestor: function(node)
796 { 813 {
797 if (node.nodeType() !== Node.ELEMENT_NODE) 814 if (node.nodeType() !== Node.ELEMENT_NODE)
798 return null; 815 return null;
799 816
800 var descendantCount = node.descendantUserPropertyCount(WebInspector.Elem entsTreeOutline.PseudoStateDecorator.PropertyName); 817 var descendantCount = node.descendantUserPropertyCount(WebInspector.CSSS tyleModel.PseudoStatePropertyName);
801 if (!descendantCount) 818 if (!descendantCount)
802 return null; 819 return null;
803 if (descendantCount === 1) 820 if (descendantCount === 1)
804 return WebInspector.UIString("%d descendant with forced state", desc endantCount); 821 return WebInspector.UIString("%d descendant with forced state", desc endantCount);
805 return WebInspector.UIString("%d descendants with forced state", descend antCount); 822 return WebInspector.UIString("%d descendants with forced state", descend antCount);
806 } 823 }
807 } 824 }
808 825
809 /** 826 /**
810 * @constructor 827 * @constructor
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 /** 1262 /**
1246 * @override 1263 * @override
1247 * @param {boolean=} selectedByUser 1264 * @param {boolean=} selectedByUser
1248 * @return {boolean} 1265 * @return {boolean}
1249 */ 1266 */
1250 onselect: function(selectedByUser) 1267 onselect: function(selectedByUser)
1251 { 1268 {
1252 this.treeOutline.suppressRevealAndSelect = true; 1269 this.treeOutline.suppressRevealAndSelect = true;
1253 this.treeOutline.selectDOMNode(this._node, selectedByUser); 1270 this.treeOutline.selectDOMNode(this._node, selectedByUser);
1254 if (selectedByUser) 1271 if (selectedByUser)
1255 WebInspector.domModel.highlightDOMNode(this._node.id); 1272 this.treeOutline._domModel.highlightDOMNode(this._node.id);
1256 this.updateSelection(); 1273 this.updateSelection();
1257 this.treeOutline.suppressRevealAndSelect = false; 1274 this.treeOutline.suppressRevealAndSelect = false;
1258 return true; 1275 return true;
1259 }, 1276 },
1260 1277
1261 /** 1278 /**
1262 * @override 1279 * @override
1263 * @return {boolean} 1280 * @return {boolean}
1264 */ 1281 */
1265 ondelete: function() 1282 ondelete: function()
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMe nuTitles() ? "Scroll into view" : "Scroll into View"), this._scrollIntoView.bind (this)); 1421 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMe nuTitles() ? "Scroll into view" : "Scroll into View"), this._scrollIntoView.bind (this));
1405 }, 1422 },
1406 1423
1407 _populateForcedPseudoStateItems: function(subMenu) 1424 _populateForcedPseudoStateItems: function(subMenu)
1408 { 1425 {
1409 const pseudoClasses = ["active", "hover", "focus", "visited"]; 1426 const pseudoClasses = ["active", "hover", "focus", "visited"];
1410 var node = this._node; 1427 var node = this._node;
1411 var forcedPseudoState = (node ? node.getUserProperty("pseudoState") : nu ll) || []; 1428 var forcedPseudoState = (node ? node.getUserProperty("pseudoState") : nu ll) || [];
1412 for (var i = 0; i < pseudoClasses.length; ++i) { 1429 for (var i = 0; i < pseudoClasses.length; ++i) {
1413 var pseudoClassForced = forcedPseudoState.indexOf(pseudoClasses[i]) >= 0; 1430 var pseudoClassForced = forcedPseudoState.indexOf(pseudoClasses[i]) >= 0;
1414 subMenu.appendCheckboxItem(":" + pseudoClasses[i], this.treeOutline. _setPseudoClassCallback.bind(null, node.id, pseudoClasses[i], !pseudoClassForced ), pseudoClassForced, false); 1431 subMenu.appendCheckboxItem(":" + pseudoClasses[i], this.treeOutline. _setPseudoClassCallback.bind(null, node, pseudoClasses[i], !pseudoClassForced), pseudoClassForced, false);
1415 } 1432 }
1416 }, 1433 },
1417 1434
1418 _populateTextContextMenu: function(contextMenu, textNode) 1435 _populateTextContextMenu: function(contextMenu, textNode)
1419 { 1436 {
1420 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMe nuTitles() ? "Edit text" : "Edit Text"), this._startEditingTextNode.bind(this, t extNode)); 1437 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMe nuTitles() ? "Edit text" : "Edit Text"), this._startEditingTextNode.bind(this, t extNode));
1421 this._populateNodeContextMenu(contextMenu); 1438 this._populateNodeContextMenu(contextMenu);
1422 }, 1439 },
1423 1440
1424 _populateNodeContextMenu: function(contextMenu) 1441 _populateNodeContextMenu: function(contextMenu)
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
2431 _updateHasChildren: function() 2448 _updateHasChildren: function()
2432 { 2449 {
2433 this.hasChildren = !this._elementCloseTag && !this._showInlineText() && this._visibleChildCount() > 0; 2450 this.hasChildren = !this._elementCloseTag && !this._showInlineText() && this._visibleChildCount() > 0;
2434 }, 2451 },
2435 2452
2436 __proto__: TreeElement.prototype 2453 __proto__: TreeElement.prototype
2437 } 2454 }
2438 2455
2439 /** 2456 /**
2440 * @constructor 2457 * @constructor
2458 * @param {!WebInspector.DOMModel} domModel
2441 * @param {!WebInspector.ElementsTreeOutline} treeOutline 2459 * @param {!WebInspector.ElementsTreeOutline} treeOutline
2442 */ 2460 */
2443 WebInspector.ElementsTreeUpdater = function(treeOutline) 2461 WebInspector.ElementsTreeUpdater = function(domModel, treeOutline)
2444 { 2462 {
2445 WebInspector.domModel.addEventListener(WebInspector.DOMModel.Events.NodeInse rted, this._nodeInserted, this); 2463 domModel.addEventListener(WebInspector.DOMModel.Events.NodeInserted, this._n odeInserted, this);
2446 WebInspector.domModel.addEventListener(WebInspector.DOMModel.Events.NodeRemo ved, this._nodeRemoved, this); 2464 domModel.addEventListener(WebInspector.DOMModel.Events.NodeRemoved, this._no deRemoved, this);
2447 WebInspector.domModel.addEventListener(WebInspector.DOMModel.Events.AttrModi fied, this._attributesUpdated, this); 2465 domModel.addEventListener(WebInspector.DOMModel.Events.AttrModified, this._a ttributesUpdated, this);
2448 WebInspector.domModel.addEventListener(WebInspector.DOMModel.Events.AttrRemo ved, this._attributesUpdated, this); 2466 domModel.addEventListener(WebInspector.DOMModel.Events.AttrRemoved, this._at tributesUpdated, this);
2449 WebInspector.domModel.addEventListener(WebInspector.DOMModel.Events.Characte rDataModified, this._characterDataModified, this); 2467 domModel.addEventListener(WebInspector.DOMModel.Events.CharacterDataModified , this._characterDataModified, this);
2450 WebInspector.domModel.addEventListener(WebInspector.DOMModel.Events.Document Updated, this._documentUpdated, this); 2468 domModel.addEventListener(WebInspector.DOMModel.Events.DocumentUpdated, this ._documentUpdated, this);
2451 WebInspector.domModel.addEventListener(WebInspector.DOMModel.Events.ChildNod eCountUpdated, this._childNodeCountUpdated, this); 2469 domModel.addEventListener(WebInspector.DOMModel.Events.ChildNodeCountUpdated , this._childNodeCountUpdated, this);
2452 2470
2471 this._domModel = domModel;
2453 this._treeOutline = treeOutline; 2472 this._treeOutline = treeOutline;
2454 /** @type {!Map.<!WebInspector.DOMNode, !WebInspector.ElementsTreeUpdater.Up dateEntry>} */ 2473 /** @type {!Map.<!WebInspector.DOMNode, !WebInspector.ElementsTreeUpdater.Up dateEntry>} */
2455 this._recentlyModifiedNodes = new Map(); 2474 this._recentlyModifiedNodes = new Map();
2456 } 2475 }
2457 2476
2458 WebInspector.ElementsTreeUpdater.prototype = { 2477 WebInspector.ElementsTreeUpdater.prototype = {
2459 /** 2478 /**
2460 * @param {!WebInspector.DOMNode} node 2479 * @param {!WebInspector.DOMNode} node
2461 * @param {boolean} isUpdated 2480 * @param {boolean} isUpdated
2462 * @param {!WebInspector.DOMNode=} parentNode 2481 * @param {!WebInspector.DOMNode=} parentNode
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
2582 } 2601 }
2583 this._recentlyModifiedNodes.clear(); 2602 this._recentlyModifiedNodes.clear();
2584 2603
2585 this._treeOutline._fireElementsTreeUpdated(nodes); 2604 this._treeOutline._fireElementsTreeUpdated(nodes);
2586 }, 2605 },
2587 2606
2588 _reset: function() 2607 _reset: function()
2589 { 2608 {
2590 this._treeOutline.rootDOMNode = null; 2609 this._treeOutline.rootDOMNode = null;
2591 this._treeOutline.selectDOMNode(null, false); 2610 this._treeOutline.selectDOMNode(null, false);
2592 WebInspector.domModel.hideDOMNodeHighlight(); 2611 this._domModel.hideDOMNodeHighlight();
2593 this._recentlyModifiedNodes.clear(); 2612 this._recentlyModifiedNodes.clear();
2594 } 2613 }
2595 } 2614 }
2596 2615
2597 /** 2616 /**
2598 * @constructor 2617 * @constructor
2599 * @param {boolean} isUpdated 2618 * @param {boolean} isUpdated
2600 * @param {!WebInspector.DOMNode=} parent 2619 * @param {!WebInspector.DOMNode=} parent
2601 */ 2620 */
2602 WebInspector.ElementsTreeUpdater.UpdateEntry = function(isUpdated, parent) 2621 WebInspector.ElementsTreeUpdater.UpdateEntry = function(isUpdated, parent)
(...skipping 13 matching lines...) Expand all
2616 2635
2617 WebInspector.ElementsTreeOutline.Renderer.prototype = { 2636 WebInspector.ElementsTreeOutline.Renderer.prototype = {
2618 /** 2637 /**
2619 * @param {!Object} object 2638 * @param {!Object} object
2620 * @return {?Element} 2639 * @return {?Element}
2621 */ 2640 */
2622 render: function(object) 2641 render: function(object)
2623 { 2642 {
2624 if (!(object instanceof WebInspector.DOMNode)) 2643 if (!(object instanceof WebInspector.DOMNode))
2625 return null; 2644 return null;
2626 var treeOutline = new WebInspector.ElementsTreeOutline(false, false); 2645 var node = /** @type {!WebInspector.DOMNode} */ (object);
2627 treeOutline.rootDOMNode = /** @type {!WebInspector.DOMNode} */ (object); 2646 var treeOutline = new WebInspector.ElementsTreeOutline(node.target(), fa lse, false);
2647 treeOutline.rootDOMNode = node;
2628 treeOutline.element.classList.add("outline-disclosure"); 2648 treeOutline.element.classList.add("outline-disclosure");
2629 if (!treeOutline.children[0].hasChildren) 2649 if (!treeOutline.children[0].hasChildren)
2630 treeOutline.element.classList.add("single-node"); 2650 treeOutline.element.classList.add("single-node");
2631 treeOutline.setVisible(true); 2651 treeOutline.setVisible(true);
2632 treeOutline.element.treeElementForTest = treeOutline.children[0]; 2652 treeOutline.element.treeElementForTest = treeOutline.children[0];
2633 return treeOutline.element; 2653 return treeOutline.element;
2634 } 2654 }
2635 } 2655 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698