Commit 3353a51f authored by pfeldman@chromium.org's avatar pfeldman@chromium.org

DevTools: update DOM children when the only text child is modified.

BUG=525109

Review URL: https://codereview.chromium.org/1311363007

git-svn-id: svn://svn.chromium.org/blink/trunk@201279 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent f32d4d8b
...@@ -142,9 +142,7 @@ Running: testEditScript ...@@ -142,9 +142,7 @@ Running: testEditScript
</div> </div>
==== after ==== ==== after ====
- <div id="testEditScript"> - <div id="testEditScript">
- <script id="node-to-edit-script"> <script id="node-to-edit-script">var i = 0;\n var j = 0;\n</script>
var i = 0;\n var j = 0;\n
</script>
</div> </div>
Running: testEditSVGAttribute Running: testEditSVGAttribute
......
...@@ -34,6 +34,7 @@ Running: testSetTextContent ...@@ -34,6 +34,7 @@ Running: testSetTextContent
//*[@id="textTest"]/text() "Text" //*[@id="textTest"]/text() "Text"
Running: testSetTextNodeTextContent Running: testSetTextNodeTextContent
//*[@id="textTest"]
//*[@id="textTest"]/text() "NewText" //*[@id="textTest"]/text() "NewText"
Running: testRemoveInlineTextNode Running: testRemoveInlineTextNode
...@@ -44,6 +45,7 @@ Running: testSetTextContentWithEmptyText ...@@ -44,6 +45,7 @@ Running: testSetTextContentWithEmptyText
//*[@id="textTest"]/text() "Text" //*[@id="textTest"]/text() "Text"
Running: testClearTextNodeTextContent Running: testClearTextNodeTextContent
//*[@id="textTest"]
//*[@id="textTest"]/text() "" //*[@id="textTest"]/text() ""
Running: testAppendChildWhenHidden Running: testAppendChildWhenHidden
......
...@@ -1199,6 +1199,9 @@ WebInspector.ElementsTreeOutline.prototype = { ...@@ -1199,6 +1199,9 @@ WebInspector.ElementsTreeOutline.prototype = {
{ {
var node = /** @type {!WebInspector.DOMNode} */ (event.data); var node = /** @type {!WebInspector.DOMNode} */ (event.data);
this._addUpdateRecord(node).charDataModified(); 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(); this._updateModifiedNodesSoon();
}, },
...@@ -1386,22 +1389,17 @@ WebInspector.ElementsTreeOutline.prototype = { ...@@ -1386,22 +1389,17 @@ WebInspector.ElementsTreeOutline.prototype = {
*/ */
_hasVisibleChildren: function(node) _hasVisibleChildren: function(node)
{ {
if (WebInspector.ElementsTreeElement.canShowInlineText(node))
return false;
if (node.importedDocument()) if (node.importedDocument())
return true; return true;
if (node.templateContent()) if (node.templateContent())
return true; return true;
if (node.childNodeCount())
return true;
if (WebInspector.ElementsTreeElement.visibleShadowRoots(node).length) if (WebInspector.ElementsTreeElement.visibleShadowRoots(node).length)
return true; return true;
if (node.hasPseudoElements()) if (node.hasPseudoElements())
return true; return true;
if (node.isInsertionPoint()) if (node.isInsertionPoint())
return true; return true;
return false; return !!node.childNodeCount() && !WebInspector.ElementsTreeElement.canShowInlineText(node);
}, },
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment