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

Unified Diff: Source/core/dom/Node.cpp

Issue 1148003007: Never cast Attr to ContainerNode based on nodeType ATTRIBUTE_NODE (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: new deal: setTextContent(attr) does nothing Created 5 years, 7 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 | « Source/core/dom/AttrTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index eef69a897008bc9610bbd1a4f4d8e68ccaf53cd9..a4b328a4320a0dca87e8bd2de9aeed271ec44028 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -1402,7 +1402,6 @@ void Node::setTextContent(const String& text)
setNodeValue(text);
return;
case ELEMENT_NODE:
- case ATTRIBUTE_NODE:
case DOCUMENT_FRAGMENT_NODE: {
// FIXME: Merge this logic into replaceChildrenWithText.
RefPtrWillBeRawPtr<ContainerNode> container = toContainerNode(this);
@@ -1424,6 +1423,7 @@ void Node::setTextContent(const String& text)
}
return;
}
+ case ATTRIBUTE_NODE:
case DOCUMENT_NODE:
case DOCUMENT_TYPE_NODE:
// Do nothing.
@@ -2444,10 +2444,10 @@ unsigned Node::lengthOfContents() const
case Node::PROCESSING_INSTRUCTION_NODE:
return toProcessingInstruction(this)->data().length();
case Node::ELEMENT_NODE:
- case Node::ATTRIBUTE_NODE:
case Node::DOCUMENT_NODE:
case Node::DOCUMENT_FRAGMENT_NODE:
return toContainerNode(this)->countChildren();
+ case Node::ATTRIBUTE_NODE:
case Node::DOCUMENT_TYPE_NODE:
return 0;
}
« no previous file with comments | « Source/core/dom/AttrTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698