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

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

Issue 1311363007: DevTools: update DOM children when the only text child is modified. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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
« no previous file with comments | « LayoutTests/inspector/elements/highlight/highlight-dom-updates-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 this._updateModifiedNodesSoon(); 1192 this._updateModifiedNodesSoon();
1193 }, 1193 },
1194 1194
1195 /** 1195 /**
1196 * @param {!WebInspector.Event} event 1196 * @param {!WebInspector.Event} event
1197 */ 1197 */
1198 _characterDataModified: function(event) 1198 _characterDataModified: function(event)
1199 { 1199 {
1200 var node = /** @type {!WebInspector.DOMNode} */ (event.data); 1200 var node = /** @type {!WebInspector.DOMNode} */ (event.data);
1201 this._addUpdateRecord(node).charDataModified(); 1201 this._addUpdateRecord(node).charDataModified();
1202 // Text could be large and force us to render itself as the child in the tree outline.
1203 if (node.parentNode && node.parentNode.firstChild === node.parentNode.la stChild)
1204 this._addUpdateRecord(node.parentNode).childrenModified();
1202 this._updateModifiedNodesSoon(); 1205 this._updateModifiedNodesSoon();
1203 }, 1206 },
1204 1207
1205 /** 1208 /**
1206 * @param {!WebInspector.Event} event 1209 * @param {!WebInspector.Event} event
1207 */ 1210 */
1208 _nodeInserted: function(event) 1211 _nodeInserted: function(event)
1209 { 1212 {
1210 var node = /** @type {!WebInspector.DOMNode} */ (event.data); 1213 var node = /** @type {!WebInspector.DOMNode} */ (event.data);
1211 this._addUpdateRecord(/** @type {!WebInspector.DOMNode} */ (node.parentN ode)).nodeInserted(node); 1214 this._addUpdateRecord(/** @type {!WebInspector.DOMNode} */ (node.parentN ode)).nodeInserted(node);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 1382
1380 return visibleChildren; 1383 return visibleChildren;
1381 }, 1384 },
1382 1385
1383 /** 1386 /**
1384 * @param {!WebInspector.DOMNode} node 1387 * @param {!WebInspector.DOMNode} node
1385 * @return {boolean} 1388 * @return {boolean}
1386 */ 1389 */
1387 _hasVisibleChildren: function(node) 1390 _hasVisibleChildren: function(node)
1388 { 1391 {
1389 if (WebInspector.ElementsTreeElement.canShowInlineText(node))
1390 return false;
1391
1392 if (node.importedDocument()) 1392 if (node.importedDocument())
1393 return true; 1393 return true;
1394 if (node.templateContent()) 1394 if (node.templateContent())
1395 return true; 1395 return true;
1396 if (node.childNodeCount())
1397 return true;
1398 if (WebInspector.ElementsTreeElement.visibleShadowRoots(node).length) 1396 if (WebInspector.ElementsTreeElement.visibleShadowRoots(node).length)
1399 return true; 1397 return true;
1400 if (node.hasPseudoElements()) 1398 if (node.hasPseudoElements())
1401 return true; 1399 return true;
1402 if (node.isInsertionPoint()) 1400 if (node.isInsertionPoint())
1403 return true; 1401 return true;
1404 return false; 1402 return !!node.childNodeCount() && !WebInspector.ElementsTreeElement.canS howInlineText(node);
1405 }, 1403 },
1406 1404
1407 /** 1405 /**
1408 * @param {!WebInspector.ElementsTreeElement} treeElement 1406 * @param {!WebInspector.ElementsTreeElement} treeElement
1409 */ 1407 */
1410 _createExpandAllButtonTreeElement: function(treeElement) 1408 _createExpandAllButtonTreeElement: function(treeElement)
1411 { 1409 {
1412 var button = createTextButton("", handleLoadAllChildren.bind(this)); 1410 var button = createTextButton("", handleLoadAllChildren.bind(this));
1413 button.value = ""; 1411 button.value = "";
1414 var expandAllButtonElement = new TreeElement(button); 1412 var expandAllButtonElement = new TreeElement(button);
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 if (node) { 1822 if (node) {
1825 this.treeOutline._selectedDOMNode = node; 1823 this.treeOutline._selectedDOMNode = node;
1826 this.treeOutline._selectedNodeChanged(); 1824 this.treeOutline._selectedNodeChanged();
1827 } 1825 }
1828 } 1826 }
1829 return true; 1827 return true;
1830 }, 1828 },
1831 1829
1832 __proto__: TreeElement.prototype 1830 __proto__: TreeElement.prototype
1833 } 1831 }
OLDNEW
« no previous file with comments | « LayoutTests/inspector/elements/highlight/highlight-dom-updates-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698