Re: test cases Re: xml:lang="" and lang=""

Karl Dubost wrote:
> Reading the Editor's Draft 21 August 2008 about xml:lang="" and lang="", 
> I was trying to figure out different test cases.
> http://dev.w3.org/html5/spec/
> 
> The most relevant part for these tests (in text/html) is:
> 
>     If both the xml:lang attribute and the lang attribute
>     are set on an element, user agents must use the xml:lang
>     attribute, and the lang attribute must be ignored for
>     the purposes of determining the element's language.

Note that this is referring to the lang attribute with the xml prefix in 
the "http://www.w3.org/XML/1998/namespace" namespace, not attribute with 
the localName "xml:lang" in no namespace.

> This is an improvement on the previous version which was giving 
> different results depending on the mime-type.

Actually, that is still the case.  It is impossible to specify the 
xml:lang attribute (in the XML namespace) in text/html, and if the 
serialisation does contain an "xml:lang" attribute, it is in no 
namespace and is ignored.

> This would need to be tested in browsers.
> 
> Case 2 - <html xml:lang="fr" and lang="ja">
>     2.a text/html
>         -> language fr  [10 June 2008 ja]

No, because that xml:lang attribute will be in no namespace, and thus 
ignored.  The correct language is ja, unchanged from the previous 
version of the spec.

> Case 3 - <html xml:lang="fr" and lang="">
>     3.a text/html
>         -> language fr  [10 June 2008 unknown]
> 
> Case 4 - <html xml:lang="" and lang="ja">
>     4.a text/html
>         -> language unknown [10 June 2008 ja]
> 
> Case 5 - <html xml:lang="fr" and lang="fr-CA">
>     5.a text/html
>         -> language fr [10 June 2008 fr-CA]

Those 3 are also incorrect for the same reason.

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/

Received on Wednesday, 27 August 2008 14:55:45 UTC