[whatwg] HTML: A DOM attribute that returns the language of a node
esprehn at chromium.org
Wed May 1 01:01:10 PDT 2013
On Wed, Apr 24, 2013 at 9:22 AM, Peter Occil <poccil14 at 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.
More information about the whatwg