W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2013

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

From: Elliott Sprehn <esprehn@chromium.org>
Date: Wed, 1 May 2013 03:52:04 -0700
Message-ID: <CAO9Q3iJkb2qug_tF3WT6nBRpckSzDy36a0y+y_FzVpoURczxOw@mail.gmail.com>
To: robert@ocallahan.org
Cc: Peter Occil <poccil14@gmail.com>, WHATWG <whatwg@whatwg.org>
On Wed, May 1, 2013 at 1:49 AM, Robert O'Callahan <robert@ocallahan.org>wrote:

> On Wed, May 1, 2013 at 8:01 PM, Elliott Sprehn <esprehn@chromium.org>wrote:
>> fwiw WebKit (and Blink) implement this through CSS inheritance since you
>> need to know the lang for all kinds of things and walking up the DOM
>> repeatedly would be expensive.
>> -webkit-locale is inherited by default and contains the enclosing @lang
>> value. You can query it through getComputedStyle(node).webkitLocale. That
>> doesn't help your custom parser though.
> Interesting. What does "body:lang(en) { -webkit-locale:fr; }" do? :-)
Nothing sensible. :) We still walk up the tree when doing selector
matching, but you'll confuse some render tree operations. Looking through
the code again we don't use -webkit-locale as much as I thought, though
perhaps we should and prevent user CSS from tampering with it.

- E
Received on Wednesday, 1 May 2013 10:53:12 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:58 UTC