Changeset 83699 in webkit
- Timestamp:
- Apr 12, 2011 10:07:59 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r83696 r83699 1 2011-04-12 Sergey Glazunov <serg.glazunov@gmail.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 Element::setAttribute should check the namespace of an id attribute 6 https://bugs.webkit.org/show_bug.cgi?id=58359 7 8 * fast/dom/id-attribute-with-namespace-crash-expected.txt: Added. 9 * fast/dom/id-attribute-with-namespace-crash.html: Added. 10 1 11 2011-04-12 Andrey Kosyakov <caseq@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r83698 r83699 1 2011-04-12 Sergey Glazunov <serg.glazunov@gmail.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 Element::setAttribute should check the namespace of an id attribute 6 https://bugs.webkit.org/show_bug.cgi?id=58359 7 8 Test: fast/dom/id-attribute-with-namespace-crash.html 9 10 * dom/Element.cpp: 11 (WebCore::Element::setAttribute): 12 1 13 2011-04-12 Mike Lawther <mikelawther@chromium.org> 2 14 -
trunk/Source/WebCore/dom/Element.cpp
r83256 r83699 658 658 659 659 const AtomicString& localName = shouldIgnoreAttributeCase(this) ? name.lower() : name; 660 660 QualifiedName attributeName(nullAtom, localName, nullAtom); 661 661 662 // Allocate attribute map if necessary. 662 663 Attribute* old = attributes(false)->getAttributeItem(localName, false); … … 664 665 document()->incDOMTreeVersion(); 665 666 666 // FIXME: This check is probably not correct for the case where the document has an id attribute 667 // with a non-null namespace, because it will return true if the local name happens to match 668 // but the namespace does not. 669 if (localName == document()->idAttributeName().localName()) 667 if (isIdAttributeName(old ? old->name() : attributeName)) 670 668 updateId(old ? old->value() : nullAtom, value); 671 669 … … 673 671 m_attributeMap->removeAttribute(old->name()); 674 672 else if (!old && !value.isNull()) 675 m_attributeMap->addAttribute(createAttribute( QualifiedName(nullAtom, localName, nullAtom), value));673 m_attributeMap->addAttribute(createAttribute(attributeName, value)); 676 674 else if (old && !value.isNull()) { 677 675 if (Attr* attrNode = old->attr())
Note: See TracChangeset
for help on using the changeset viewer.