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

On Wed, Apr 24, 2013 at 9:22 AM, Peter Occil <poccil14@gmail.com> wrote:

>
> I have no objection to the name "baseLang" rather than "language" as the
> name of the DOM attribute.
>
> But if there isn't more interest or you decide not to add this DOM
> attribute, I encourage you to at least:
>
>
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.

- E

Received on Wednesday, 1 May 2013 08:02:20 UTC