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

Unified 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, 4 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/inspector/elements/highlight/highlight-dom-updates-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/elements/ElementsTreeOutline.js
diff --git a/Source/devtools/front_end/elements/ElementsTreeOutline.js b/Source/devtools/front_end/elements/ElementsTreeOutline.js
index f0a56f568fc920883ab0abb6de72ce2e38edd7ef..84179ff928acafd5d6354af4d8629c35f20b6743 100644
--- a/Source/devtools/front_end/elements/ElementsTreeOutline.js
+++ b/Source/devtools/front_end/elements/ElementsTreeOutline.js
@@ -1199,6 +1199,9 @@ WebInspector.ElementsTreeOutline.prototype = {
{
var node = /** @type {!WebInspector.DOMNode} */ (event.data);
this._addUpdateRecord(node).charDataModified();
+ // Text could be large and force us to render itself as the child in the tree outline.
+ if (node.parentNode && node.parentNode.firstChild === node.parentNode.lastChild)
+ this._addUpdateRecord(node.parentNode).childrenModified();
this._updateModifiedNodesSoon();
},
@@ -1386,22 +1389,17 @@ WebInspector.ElementsTreeOutline.prototype = {
*/
_hasVisibleChildren: function(node)
{
- if (WebInspector.ElementsTreeElement.canShowInlineText(node))
- return false;
-
if (node.importedDocument())
return true;
if (node.templateContent())
return true;
- if (node.childNodeCount())
- return true;
if (WebInspector.ElementsTreeElement.visibleShadowRoots(node).length)
return true;
if (node.hasPseudoElements())
return true;
if (node.isInsertionPoint())
return true;
- return false;
+ return !!node.childNodeCount() && !WebInspector.ElementsTreeElement.canShowInlineText(node);
},
/**
« 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