Case-sensitivity of attribute values wrt Selectors

HTML 5 should define which attribute values should be treated  
case-insensitively with regards to Selectors, and whether that's ASCII  
case-insensitively or Unicode case-insensitively.

I tested what browsers do:

    http://simon.html5.org/test/selectors/case-sensitivity/

IE7 treats all attribute values case-sensitively.

When the document is served as XML, all attribute values are  
case-sensitive in Opera, Firefox and Safari.

When the document is served as text/html:

In Opera, for any HTML element, a given set of attributes (see below) are  
treated Unicode case-insensitively.

In Firefox, for any element (including non-HTML elements), a given set of  
attributes (see below) are treated Unicode case-insensitively.

In Safari, for any element (including non-HTML elements), all attributes  
are treated ASCII case-insensitively.

The set of attributes is (assuming I haven't missed some attribute to  
test):

accept, charset, disabled, align, alink, axis, bgcolor, charset, clear,  
codetype, color, compact, declare, defer, dir, disabled, enctype, face,  
frame, hreflang, http-equiv, ismap (missing in Firefox), language, link,  
media, method, multiple, noresize, noshade, nowrap, readonly, rel, rev,  
rules, scope, scrolling, selected, shape, target, text, type, valign  
(missing in Opera), valuetype, vlink.


Also see: http://rakaz.nl/item/css_selector_bugs_case_sensitivity


Personally, I think that whether the document was served as XML or  
text/html shouldn't matter here, and that the same set of attributes  
should be treated case-insensitively for both HTML and XHTML. Moreover, I  
think the set of attributes should only apply for elements in the HTML  
namespace (like in Opera). I don't mind that the set of attributes applies  
to all elements in the HTML namespace.

-- 
Simon Pieters
Opera Software

Received on Saturday, 5 January 2008 01:05:03 UTC