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

Side by Side Diff: Source/core/dom/Element.cpp

Issue 22803008: setAttributeNode() does not properly normalize case. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: submitting patch with small name changes. Created 7 years, 4 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
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/QualifiedName.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/QualifiedName.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698