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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after
1802 if (index != notFound) { 1802 if (index != notFound) {
1803 if (oldAttrNode) 1803 if (oldAttrNode)
1804 detachAttrNodeFromElementWithValue(oldAttrNode.get(), elementData->a ttributeItem(index)->value()); 1804 detachAttrNodeFromElementWithValue(oldAttrNode.get(), elementData->a ttributeItem(index)->value());
1805 else 1805 else
1806 oldAttrNode = Attr::create(document(), attrNode->qualifiedName(), el ementData->attributeItem(index)->value()); 1806 oldAttrNode = Attr::create(document(), attrNode->qualifiedName(), el ementData->attributeItem(index)->value());
1807 } 1807 }
1808 1808
1809 setAttributeInternal(index, attrNode->qualifiedName(), attrNode->value(), No tInSynchronizationOfLazyAttribute); 1809 setAttributeInternal(index, attrNode->qualifiedName(), attrNode->value(), No tInSynchronizationOfLazyAttribute);
1810 1810
1811 attrNode->attachToElement(this); 1811 attrNode->attachToElement(this);
1812 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.
1812 ensureAttrNodeListForElement(this)->append(attrNode); 1813 ensureAttrNodeListForElement(this)->append(attrNode);
1813 1814
1814 return oldAttrNode.release(); 1815 return oldAttrNode.release();
1815 } 1816 }
1816 1817
1817 PassRefPtr<Attr> Element::setAttributeNodeNS(Attr* attr, ExceptionCode& ec) 1818 PassRefPtr<Attr> Element::setAttributeNodeNS(Attr* attr, ExceptionCode& ec)
1818 { 1819 {
1819 return setAttributeNode(attr, ec); 1820 return setAttributeNode(attr, ec);
1820 } 1821 }
1821 1822
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after
3202 return 0; 3203 return 0;
3203 } 3204 }
3204 3205
3205 Attribute* UniqueElementData::attributeItem(unsigned index) 3206 Attribute* UniqueElementData::attributeItem(unsigned index)
3206 { 3207 {
3207 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3208 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3208 return &m_attributeVector.at(index); 3209 return &m_attributeVector.at(index);
3209 } 3210 }
3210 3211
3211 } // namespace WebCore 3212 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698