Open Bug 564571 Opened 15 years ago Updated 2 years ago

Multiple languages inside Content-Language header/pragma should be treated as HTML5 requires

Categories

(Core :: DOM: Core & HTML, defect, P5)

defect

Tracking

()

People

(Reporter: xn--mlform-iua, Unassigned)

References

()

Details

(Keywords: helpwanted, html5, student-project)

User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_8; nn-no) AppleWebKit/531.22.7 (KHTML, like Gecko) iCab/4.7 Safari/525.27.1 Build Identifier: Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.3a2pre) Gecko/20100217 Minefield/3.7a2pre HTML5 defines a different treatment of Content-Lanuage (HTTP header or META element) compared to Gecko. Gecko allows each language tag to take part in the fallback language behavior. While HTML5 requires that no fallback language should be defined whenever Content-Langauge contains contains a comma [since the comma is a separated between the tags]. Instead when the META containes multiple tags, then the user agent should look at the HTTP header with the same eyes: if HTTP contains multiple tags the no language gets set, if it contains one tag, then that is the language. Reproducible: Always Steps to Reproduce: 1. Create document with the element <meta http-equiv="Content-Language" content="en,fr,de,ru" > Make sure that the page doesn't use the lang attribut anyhere. 2. Create the CSS style html:lang(en),html:lang(fr),html:lang(de),html:lang(ru){color:red} 3. Check how Gecko treats it Actual Results: The page gets colored red Expected Results: The CSS style should not have any effect at all, according to HTML5 HTML5 defines same behaviour for Content-Language that contains multiple languages as for a Content-Language meta elment which contains the empty string. Gecko currently implements the empty string behaviour that HTML5 requires. Namely: If the Content-Language meta is empty or contains multiple languages, then HTML5 requires the UA to not use the Content-Language, but instead pay a visit to the HTTP Content-Langauge header.
(In reply to comment #0) > Gecko currently implements the empty string behaviour that HTML5 requires. > Namely: If the Content-Language meta is empty or contains multiple languages, > then HTML5 requires the UA to not use the Content-Language, but instead pay a > visit to the HTTP Content-Langauge header. I meant to say that you can use how Gecko treats the empty string inside the Content-Language <meta>, as a pattern: Implement the same behaviour for multiple langauge tags.
Status: UNCONFIRMED → NEW
Ever confirmed: true
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven't been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML

Wow i just tried this, it still happens ten years later :D

Can I fix this by ignore the content property as soon as i see a comma inside it?

( i'm new here, so i'm not very sure how to approach these bugs )

Flags: needinfo?(htsai)

That would be correct per the processing algorithm defined at https://html.spec.whatwg.org/#attr-meta-http-equiv-content-language. However, adding a test to ensure that Chrome and Safari follow that requirement would be good.

Edit: https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=8248 shows they follow the requirement (at least with a basic test).

Flags: needinfo?(htsai)

Yes you are right, I'm still a little confused, where to make the change,
https://dxr.mozilla.org/mozilla-central/source/dom/html/HTMLMetaElement.cpp do i make a change in the meta tag or in the http part?

Flags: needinfo?(annevk)

(In reply to yohaan from comment #5)

Yes you are right, I'm still a little confused, where to make the change,
https://dxr.mozilla.org/mozilla-central/source/dom/html/HTMLMetaElement.cpp do i make a change in the meta tag or in the http part?

https://dxr.mozilla.org/mozilla-central/source/dom/html/test/test_meta_attributes_reflection.html#27 this is a test for the attributes but nowhere in the /dom/html can i find http-equiv="Content-Language" it is always used with "Content-Type" where is the code implementing http-equiv is what i wanted to know sorry, thanks

I think the changes have to be made in https://dxr.mozilla.org/mozilla-central/source/dom/base/Document.cpp, but it looks like we might handle http-equiv and HTTP headers through the same code path? Henri, do you know how we handle this?

Flags: needinfo?(annevk) → needinfo?(hsivonen)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.