OLD | NEW |
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 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1830 // InUseAttributeError: Raised if node is an Attr that is already an attribu
te of another Element object. | 1830 // InUseAttributeError: Raised if node is an Attr that is already an attribu
te of another Element object. |
1831 // The DOM user must explicitly clone Attr nodes to re-use them in other ele
ments. | 1831 // The DOM user must explicitly clone Attr nodes to re-use them in other ele
ments. |
1832 if (attrNode->ownerElement()) { | 1832 if (attrNode->ownerElement()) { |
1833 es.throwDOMException(InUseAttributeError); | 1833 es.throwDOMException(InUseAttributeError); |
1834 return 0; | 1834 return 0; |
1835 } | 1835 } |
1836 | 1836 |
1837 synchronizeAllAttributes(); | 1837 synchronizeAllAttributes(); |
1838 UniqueElementData* elementData = ensureUniqueElementData(); | 1838 UniqueElementData* elementData = ensureUniqueElementData(); |
1839 | 1839 |
1840 size_t index = elementData->getAttributeItemIndex(attrNode->qualifiedName())
; | 1840 size_t index = elementData->getAttributeItemIndex(attrNode->qualifiedName(),
shouldIgnoreAttributeCase(this)); |
1841 if (index != notFound) { | 1841 if (index != notFound) { |
1842 if (oldAttrNode) | 1842 if (oldAttrNode) |
1843 detachAttrNodeFromElementWithValue(oldAttrNode.get(), elementData->a
ttributeItem(index)->value()); | 1843 detachAttrNodeFromElementWithValue(oldAttrNode.get(), elementData->a
ttributeItem(index)->value()); |
1844 else | 1844 else |
1845 oldAttrNode = Attr::create(document(), attrNode->qualifiedName(), el
ementData->attributeItem(index)->value()); | 1845 oldAttrNode = Attr::create(document(), attrNode->qualifiedName(), el
ementData->attributeItem(index)->value()); |
1846 } | 1846 } |
1847 | 1847 |
1848 setAttributeInternal(index, attrNode->qualifiedName(), attrNode->value(), No
tInSynchronizationOfLazyAttribute); | 1848 setAttributeInternal(index, attrNode->qualifiedName(), attrNode->value(), No
tInSynchronizationOfLazyAttribute); |
1849 | 1849 |
1850 attrNode->attachToElement(this); | 1850 attrNode->attachToElement(this); |
(...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3641 return 0; | 3641 return 0; |
3642 } | 3642 } |
3643 | 3643 |
3644 Attribute* UniqueElementData::attributeItem(unsigned index) | 3644 Attribute* UniqueElementData::attributeItem(unsigned index) |
3645 { | 3645 { |
3646 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); | 3646 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); |
3647 return &m_attributeVector.at(index); | 3647 return &m_attributeVector.at(index); |
3648 } | 3648 } |
3649 | 3649 |
3650 } // namespace WebCore | 3650 } // namespace WebCore |
OLD | NEW |