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

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

Issue 17583003: Set Attr.ownerDocument in Element#setAttributeNode() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 941c660a172350af91c10c8e51d2f704c79794d4..5f0e0f66fd2929ef2562836ef10785be0b94c6d3 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1809,6 +1809,7 @@ PassRefPtr<Attr> Element::setAttributeNode(Attr* attrNode, ExceptionCode& ec)
setAttributeInternal(index, attrNode->qualifiedName(), attrNode->value(), NotInSynchronizationOfLazyAttribute);
attrNode->attachToElement(this);
+ treeScope()->adoptIfNeeded(attrNode);
tkent 2013/06/24 05:06:37 This is ok. However, should it be in Attr::attachT
Hajime Morrita 2013/06/24 05:24:09 I thought like that, but turned out that another a
tkent 2013/06/24 05:26:30 It makes sense.
ensureAttrNodeListForElement(this)->append(attrNode);
return oldAttrNode.release();

Powered by Google App Engine
This is Rietveld 408576698