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
</div>
==== after ====
- <div id="testEditScript">
- <script id="node-to-edit-script">
var i = 0;\n var j = 0;\n
</script>
<script id="node-to-edit-script">var i = 0;\n var j = 0;\n</script>
</div>
Running: testEditSVGAttribute
......
......@@ -34,6 +34,7 @@ Running: testSetTextContent
//*[@id="textTest"]/text() "Text"
Running: testSetTextNodeTextContent
//*[@id="textTest"]
//*[@id="textTest"]/text() "NewText"
Running: testRemoveInlineTextNode
......@@ -44,6 +45,7 @@ Running: testSetTextContentWithEmptyText
//*[@id="textTest"]/text() "Text"
Running: testClearTextNodeTextContent
//*[@id="textTest"]
//*[@id="textTest"]/text() ""
Running: testAppendChildWhenHidden
......
......@@ -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);
},
/**
......
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