W3C home > Mailing lists > Public > www-style@w3.org > December 2014

Re: [selectors] Improving the definition of language range in :lang()

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 11 Dec 2014 11:06:58 -0800
Message-ID: <CAAWBYDBGE+nD2YuCyfVgnHvoypitCGoVgtVPkecYP+KRELcVEA@mail.gmail.com>
To: "L. David Baron" <dbaron@dbaron.org>
Cc: www-style list <www-style@w3.org>
On Wed, Dec 10, 2014 at 11:14 PM, L. David Baron <dbaron@dbaron.org> wrote:
> On Wednesday 2014-12-10 09:28 -0800, fantasai wrote:
>> On 12/10/2014 08:41 AM, Tab Atkins Jr. wrote:
>> >As it stands, you can still write *-1996 in :lang() by escaping the
>> >dash, like `:lang(*\-1996)` - that turns it into an asterisk followed
>> >by an identifier.  This, of course, isn't great.  I think we assumed
>> >that language tags weren't ever composed of just numbers.  We should
>> >probably allow a string in :lang() as well, for when tokenization
>> >doesn't work well for the given language tag.
>>
>> To the extent that we allow escaped asterisks here, you can also
>> handle this issue via :lang(\*-1996), since that will also parse
>> as an identifier.
>
> I believe one of the things discussed in today's teleconference, and
> one that I support, was to add to the syntax for :lang() by allowing
> a string to be the argument, so that :lang("*-1996") can be used.
>
> (It's then worth considering exactly which non-identifier cases
> should be allowed, and which should require escaping or being
> written as strings.)

Yeah, I recommend, for simplicity, only allowing identifiers and
strings.  This means that, ignoring escaping for a moment, everything
valid in Selectors 3 is still valid, but the new stuff requires no
thinking about parsing.

People can still use escapes to get an ident with asterisks in it, and
that would work just fine, it's just unlikely to be done.

~TJ
Received on Thursday, 11 December 2014 19:07:56 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:26 UTC