W3C home > Mailing lists > Public > www-style@w3.org > July 2008

Re: [CSS21] [css3-selectors] case-sensitivity of :lang()

From: Bert Bos <bert@w3.org>
Date: Sat, 05 Jul 2008 11:44:26 +0200
Message-ID: <486F427A.5030301@w3.org>
CC: www-style@w3.org

fantasai wrote:
> 
> Currently :lang() is defined as doing |= match against the
> language string (normalized to RFC 3066 format per [1]).
> 
> It's not clear whether this match is case-sensitive or
> case-insensitive. Since language codes are case-insensitive,
> I believe this match should be case-insensitive. I've tested
> Opera, Safari, and Firefox, and they agree.
> 
> Proposed that in
>   http://www.w3.org/TR/CSS21/selector.html#lang
> and
>   http://www.w3.org/TR/css3-selectors/#lang-pseudo
> the phrase
>   "in the same way as if performed by the '|=' operator."
> be replaced by
>   "in the same way as if performed by the '|=' operator
>    except that in this case a case-insensitive match is
>    performed."

It's only case-insensitive if the document is. That's covered already by 
section 4.1.3, which says that text from the document is case-sensitive 
iff the document says it is.

So the ':lang()' applied to an HTML document is indeed case-sensitive, 
but there may be other documents for which it is different. (Which may 
be difficult to test in practice: anybody know of a document format that 
has the concept of language and doesn't use RFC 3066/RFC 4646?)



Bert
-- 
   Bert Bos                                ( W 3 C ) http://www.w3.org/
   http://www.w3.org/people/bos                               W3C/ERCIM
   bert@w3.org                             2004 Rt des Lucioles / BP 93
   +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Saturday, 5 July 2008 09:45:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:10 GMT