Bug 11389 - Attribute selectors should be case-sensitive by default and only be case-insensitive for certain attributes values
Summary: Attribute selectors should be case-sensitive by default and only be case-inse...
Status: RESOLVED DUPLICATE of bug 15470
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://www.css3.info/selectors-test/
Keywords:
Depends on:
Blocks: 11390
  Show dependency treegraph
 
Reported: 2006-10-23 03:53 PDT by Niels Leenheer (HTML5test)
Modified: 2008-01-28 09:15 PST (History)
2 users (show)

See Also:


Attachments
minimal test case (2.73 KB, text/html)
2007-11-16 12:50 PST, Robert Blaut
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Niels Leenheer (HTML5test) 2006-10-23 03:53:12 PDT
Current behavoir:
The values of all attributes are compared by using a case-insensitive method.

Correct behavoir:
The CSS specification says that the case-sensitivity is determined by the document language. The HTML specification specifically tells us which attributes are case-sensitive, case-neutral or case-insensitive. Because attributes values are case-sensitive by default, we should treat unknown attributes in a case-sensitive way. 

The list of case-insensitive attributes is as follows:
lang, dir, http-equiv, text, link, vlink, alink, compact, align, frame, rules,
valign, scope, axis, nowrap, hreflang, rel, rev, charset, codetype, declare,
valuetype, shape, nohref, media, bgcolor, clear, color, face, noshade,
noresize, scrolling, target, method, enctype, accept-charset, accept, checked,
multiple, selected, disabled, readonly, language, defer, type

See also the following bugs:
http://bugzilla.mozilla.org/show_bug.cgi?id=357614
http://bugzilla.mozilla.org/show_bug.cgi?id=356936
http://bugs.kde.org/show_bug.cgi?id=135505

and

http://rakaz.nl/item/css_selector_bugs_case_sensitivity
Comment 1 Eric Seidel (no email) 2007-10-01 08:37:39 PDT
The code which defines this behaivor is in:

CSSParser::parseContent

            if (fname == "attr(") {
                if (args->size() != 1)
                    return false;
                Value* a = args->current();
                String attrName = domString(a->string);
                if (document()->isHTMLDocument())
                    attrName = attrName.lower();
                parsedValue = new CSSPrimitiveValue(attrName, CSSPrimitiveValue::CSS_ATTR);


Note that that code will be changed slightly by the patch attached to bug 15302, since the mathml.css file (which contains attr selectors) is parsed before there is any document() set.
Comment 2 Robert Blaut 2007-11-16 12:50:15 PST
Created attachment 17316 [details]
minimal test case
Comment 3 Robert Blaut 2008-01-28 08:37:28 PST
Is this bg already fixed? I don't see error behavior.
Comment 4 Alexey Proskuryakov 2008-01-28 09:15:43 PST

*** This bug has been marked as a duplicate of 15470 ***