Detecting inherited language

Can anyone tell me whether there's a way to detect the inherited 
language of an element, other than by recursing up the tree looking for 
lang attributes? (I'm looking for something like computedvalue.)

I'm asking because I'd like to know whether i can improve some tests 
that try to discover whether content-language, lang, and xml:lang are 
recognised by a browser[1].

Currently I use :lang to detect whether a language has been set. But I'm 
curious to know whether I can detect the language directly using 
javascript, since :lang may not be supported by some browsers.  (If the 
language is detectable by javascript, of course it must reflect the 
language if obtained from content-language etc too - not just a lang 
attribute.)

Thanks in advance,
RI


[1] 
http://www.w3.org/International/tests/html-css/language-declarations/results-language-declarations

-- 
Richard Ishida, W3C
http://rishida.net/

Received on Wednesday, 10 July 2013 08:38:54 UTC