Changeset 148614 in webkit
- Timestamp:
- Apr 17, 2013 9:14:37 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r148612 r148614 1 2013-04-17 Arpita Bahuguna <a.bah@samsung.com> 2 3 getAttribute does not behave correctly for mixed-case attributes on HTML elements 4 https://bugs.webkit.org/show_bug.cgi?id=105713 5 6 Reviewed by Andreas Kling. 7 8 * fast/dom/Element/getAttribute-case-insensitivity-expected.txt: Added. 9 * fast/dom/Element/getAttribute-case-insensitivity.html: Added. 10 Layout test added for verifying that getAttribute() and getAttributeNode() 11 APIs convert the passed attribute name to lowercase before comparing 12 against the existing attributes. 13 1 14 2013-04-17 Zoltan Arvai <zarvai@inf.u-szeged.hu> 2 15 -
trunk/Source/WebCore/ChangeLog
r148613 r148614 1 2013-04-17 Arpita Bahuguna <a.bah@samsung.com> 2 3 getAttribute does not behave correctly for mixed-case attributes on HTML elements 4 https://bugs.webkit.org/show_bug.cgi?id=105713 5 6 Reviewed by Andreas Kling. 7 8 getAttribute() and getAttributeNode() APIs do not convert the 9 passed attribute name to lowercase before comparing against the 10 existing attributes. 11 The specification however states that the passed name should 12 be converted to ASCII lowercase before checking for the existence 13 of the given attribute. [www.w3.org/TR/domcore/#dom-element-getattribute] 14 15 Test: fast/dom/Element/getAttribute-case-insensitivity.html 16 17 * dom/Element.h: 18 (WebCore::ElementData::getAttributeItemIndex): 19 getAttributeItemIndex() accepts a bool param 'shouldIgnoreAttributeCase' 20 which specifies whether or not the attribute's case should be ignored 21 before comparison but we don't really convert the passed name to lowercase 22 before carrying out the comparison. 23 24 Thus, when called from APIs such as getAttribute() and getAttributeNode() 25 which do not explicitally convert the attribute name to lowercase 26 before calling on this method, it fails to carry out a case-insensitive 27 search. 28 29 Have thus made changes to convert the passed attribute's name to 30 lowercase if 'shouldIgnoreAttributeCase' is true. 31 1 32 2013-04-17 John Griggs <jgriggs@blackberry.com> 2 33 -
trunk/Source/WebCore/dom/Element.h
r147983 r148614 976 976 bool doSlowCheck = shouldIgnoreAttributeCase; 977 977 978 const AtomicString caseAdjustedName = shouldIgnoreAttributeCase ? name.lower() : name; 978 979 // Optimize for the case where the attribute exists and its name exactly matches. 979 980 for (unsigned i = 0; i < len; ++i) { 980 981 const Attribute* attribute = attributeItem(i); 981 982 if (!attribute->name().hasPrefix()) { 982 if ( name == attribute->localName())983 if (caseAdjustedName == attribute->localName()) 983 984 return i; 984 985 } else
Note: See TracChangeset
for help on using the changeset viewer.