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

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

From: Anne van Kesteren <annevk@annevk.nl>
Date: Wed, 1 May 2013 12:43:36 +0100
Message-ID: <CADnb78j54nh5jcKXhmkR5hVg=jfyq878MgdwrVXtSi9=VOchbQ@mail.gmail.com>
To: Elliott Sprehn <esprehn@chromium.org>
Cc: Peter Occil <poccil14@gmail.com>, WHATWG <whatwg@whatwg.org>
On Wed, May 1, 2013 at 9:01 AM, 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.

What mechanism did you use for base URLs? Or is the cost there deemed

For direction you need to have a similar mechanism available. (And
you'll have the same problem roc pointed out with :lang() if you solve
that through CSS as :dir(ltr) and :dir(rtl) exist these days.)

If browsers already implement some kind of API for these things it
might be worth to expose them in the same way.

Received on Wednesday, 1 May 2013 11:44:01 UTC

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