Bug 16489 - Retrieve element language
Summary: Retrieve element language
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: PC Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
: 21780 (view as bug list)
Depends on:
Reported: 2012-03-23 08:00 UTC by Anne
Modified: 2015-08-03 10:13 UTC (History)
6 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Anne 2012-03-23 08:00:57 UTC
Marcos asked for a way to get the language of the current element. The DOM would define the concept and an attribute, HTML / XML would define its details. Robin suggested "baseLang" as attribute name.
Comment 1 Manu Sporny 2013-06-06 14:54:05 UTC
This bug affects all JavaScript-based RDFa and Microdata processors. 

If the "de" BCP47 language code is set via the Content-Language HTTP header, and no language information is set in the HTML document, a JavaScript based implementation may think that the language is not set.

At present, it is impossible for a JavaScript implementation to deterministically retrieve an HTML5 element's language if no language information is provided in the document and the language was set via the Content-Language HTTP Header.

The HTML+RDFa 1.1 specification states that because of this, all HTML+RDFa 1.1 implementations implemented in JavaScript will be non-conforming in this specific case until the DOM exposes the language of an element. The guidance provided at this moment is that all HTML+RDFa and HTML+Microdata authors should specify the language of the document (if there is one) in the document itself to ensure that all Microdata/RDFa implementations are capable of retrieving the language of the element.

Once this bug is fixed, then one can perform a fully-conforming implementation of RDFa or Microdata in JavaScript.
Comment 2 Peter Occil 2013-06-06 16:45:38 UTC
*** Bug 21780 has been marked as a duplicate of this bug. ***
Comment 3 Anne 2014-05-22 13:49:18 UTC
Considerations here are:

* xml:lang vs lang
* Whether lang needs to be superglobal
* Content-Language (see :lang())
Comment 4 Anne 2015-08-03 10:13:13 UTC
Sufficient interest has not materialized.