This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
I believe there should be a DOM attribute that returns the language of a node, as defined in section 3.2.3.3 "The lang and xml:lang attributes". While there is a "lang" DOM attribute, it's inadequate because it's only affected by the element's "lang" content attribute. Also, I don't see a way to get the "language of a node" otherwise, especially since it depends not only on "lang" and "xml:lang", but also on the HTTP Content-Language header, which may not be possible to retrieve with existing JavaScript methods, as far as I can tell.
Issue posted to WHATWG mailing list.
What's the use case? (If this is being discussed on the list, please close the bug. There's no need to track it in both places. Thanks!)
The use case is largely to ensure better conformance of browser-based JavaScript processors to the HTML+RDFa specification. I recently raised this issue in the RDFa Working Group mailing list, but no formal decision has been made yet. See <http://lists.w3.org/Archives/Public/public-rdfa-wg/2013May/0064.html>. HTML+RDFa indirectly relies on "language information from a higher-level protocol (such as HTTP)", and there is no current way to get that language information from browser-based JavaScript.
*** This bug has been marked as a duplicate of bug 16489 ***