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

[selectors] How to handle unexpected hyphens in the language range of :lang()?

From: Benjamin Poulain <bpoulain@apple.com>
Date: Mon, 10 Nov 2014 21:17:33 -0800
Message-Id: <886F0AFB-6542-43ED-B60F-2D76A6223069@apple.com>
To: www-style list <www-style@w3.org>
Hi,

I am not sure what is the correct way to handle “invalid" language ranges with :lang().

The draft says that :lang() accepts valid CSS identifiers (http://dev.w3.org/csswg/selectors4/#the-lang-pseudo <http://dev.w3.org/csswg/selectors4/#the-lang-pseudo>). 

RFC4647 is significantly more restrictive.

Given the following values:
    en-
    en--us
It is no clear how to handle the step 3.3.2 of RFC4647.

We could either ignore empty groups:
    en- -> [“en”, “”] -> [“en”]
    en--us -> [“en”, “”, “us”] -> [“en”, “us”]

Or consider them part of the matching, in which case they always fail to match since the normalized element’s language would never contains the empty group.

Is this defined anywhere by any chance?
I assume they should always fail for compatibility with Level 3.

Benjamin
Received on Tuesday, 11 November 2014 05:18:18 UTC

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