This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21780 - A DOM attribute that returns the language of a node
Summary: A DOM attribute that returns the language of a node
Status: RESOLVED DUPLICATE of bug 16489
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: Unsorted
Assignee: aardi79
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-23 05:07 UTC by Peter Occil
Modified: 2014-04-11 03:43 UTC (History)
3 users (show)

See Also:


Attachments

Description Peter Occil 2013-04-23 05:07:18 UTC
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.
Comment 1 Peter Occil 2013-04-23 08:45:07 UTC
Issue posted to WHATWG mailing list.
Comment 2 Ian 'Hixie' Hickson 2013-06-04 21:49:20 UTC
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!)
Comment 3 Peter Occil 2013-06-04 22:16:56 UTC
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.
Comment 4 Peter Occil 2013-06-06 16:45:38 UTC

*** This bug has been marked as a duplicate of bug 16489 ***