Changeset 21934 in webkit
- Timestamp:
- Jun 1, 2007, 1:13:25 AM (18 years ago)
- Location:
- branches/feature-branch
- Files:
-
- 5 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-branch/LayoutTests/ChangeLog
r21920 r21934 1 2007-06-01 Eric Seidel <eric@webkit.org> 2 3 Reviewed by hyatt. 4 5 Add tests to document attribute case sensitivity prior to fixing: 6 http://bugs.webkit.org/show_bug.cgi?id=12187 7 8 * fast/dom/attribute-case-sensitivity-expected.txt: Added. 9 * fast/dom/attribute-case-sensitivity.html: Added. 10 * fast/dom/attribute-case-sensitivity2-expected.txt: Added. 11 * fast/dom/attribute-case-sensitivity2.xhtml: Added. 12 * fast/dom/resources/attr-case-sensitivity.js: Added. 13 1 14 2007-05-31 Eric Seidel <eric@webkit.org> 2 15 -
branches/feature-branch/WebCore/ChangeLog
r21920 r21934 1 2007-06-01 Eric Seidel <eric@webkit.org> 2 3 Reviewed by hyatt. 4 5 Fix for: http://bugs.webkit.org/show_bug.cgi?id=12187 6 7 Tests: fast/dom/attribute-case-sensitivity.html, fast/dom/attribute-case-sensitivity2.xhtml 8 9 * dom/Element.cpp: 10 (WebCore::shouldIgnoreAttributeCase): check to make sure element is an HTMLElement 11 (WebCore::Element::getAttribute): 12 (WebCore::Element::setAttribute): 13 (WebCore::Element::removeAttribute): 14 (WebCore::Element::getAttributeNode): 15 (WebCore::Element::hasAttribute): 16 * dom/NamedAttrMap.cpp: 17 (WebCore::shouldIgnoreAttributeCase): 18 (WebCore::NamedAttrMap::getNamedItem): 19 (WebCore::NamedAttrMap::removeNamedItem): 20 1 21 2007-05-31 Eric Seidel <eric@webkit.org> 2 22 -
branches/feature-branch/WebCore/dom/Element.cpp
r21278 r21934 5 5 * (C) 2001 Dirk Mueller (mueller@kde.org) 6 6 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 7 * (C) 2007 Eric Seidel (eric@webkit.org) 7 8 * 8 9 * This library is free software; you can redistribute it and/or … … 394 395 } 395 396 396 static inline bool inHTMLDocument(const Element* e)397 { 398 return e && e->document()->isHTMLDocument() ;397 static inline bool shouldIgnoreAttributeCase(const Element* e) 398 { 399 return e && e->document()->isHTMLDocument() && e->isHTMLElement(); 399 400 } 400 401 401 402 const AtomicString& Element::getAttribute(const String& name) const 402 403 { 403 String localName = inHTMLDocument(this) ? name.lower() : name;404 String localName = shouldIgnoreAttributeCase(this) ? name.lower() : name; 404 405 if (localName == styleAttr.localName()) 405 406 updateStyleAttributeIfNeeded(); … … 424 425 } 425 426 426 String localName = inHTMLDocument(this) ? name.lower() : name;427 String localName = shouldIgnoreAttributeCase(this) ? name.lower() : name; 427 428 428 429 // allocate attributemap if necessary … … 910 911 void Element::removeAttribute(const String& name, ExceptionCode& ec) 911 912 { 912 String localName = inHTMLDocument(this) ? name.lower() : name;913 String localName = shouldIgnoreAttributeCase(this) ? name.lower() : name; 913 914 914 915 if (namedAttrMap) { … … 929 930 if (!attrs) 930 931 return 0; 931 String localName = inHTMLDocument(this) ? name.lower() : name;932 String localName = shouldIgnoreAttributeCase(this) ? name.lower() : name; 932 933 return static_pointer_cast<Attr>(attrs->getNamedItem(localName)); 933 934 } … … 946 947 if (!attrs) 947 948 return false; 948 String localName = inHTMLDocument(this) ? name.lower() : name;949 String localName = shouldIgnoreAttributeCase(this) ? name.lower() : name; 949 950 return attrs->getAttributeItem(localName); 950 951 } -
branches/feature-branch/WebCore/dom/NamedAttrMap.cpp
r21184 r21934 5 5 * (C) 2001 Dirk Mueller (mueller@kde.org) 6 6 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 7 * (C) 2007 Eric Seidel (eric@webkit.org) 7 8 * 8 9 * This library is free software; you can redistribute it and/or … … 34 35 using namespace HTMLNames; 35 36 36 static inline bool inHTMLDocument(const Element* e)37 { 38 return e && e->document()->isHTMLDocument() ;37 static inline bool shouldIgnoreAttributeCase(const Element* e) 38 { 39 return e && e->document()->isHTMLDocument() && e->isHTMLElement(); 39 40 } 40 41 … … 58 59 PassRefPtr<Node> NamedAttrMap::getNamedItem(const String& name) const 59 60 { 60 String localName = inHTMLDocument(element) ? name.lower() : name;61 String localName = shouldIgnoreAttributeCase(element) ? name.lower() : name; 61 62 Attribute* a = getAttributeItem(localName); 62 63 if (!a) … … 73 74 PassRefPtr<Node> NamedAttrMap::removeNamedItem(const String& name, ExceptionCode& ec) 74 75 { 75 String localName = inHTMLDocument(element) ? name.lower() : name;76 String localName = shouldIgnoreAttributeCase(element) ? name.lower() : name; 76 77 Attribute* a = getAttributeItem(localName); 77 78 if (!a) {
Note:
See TracChangeset
for help on using the changeset viewer.