Closed Bug 313823 Opened 19 years ago Closed 19 years ago

<!meta ...> and <metaxyz ...> treated as <meta ...> when content=...charset

Categories

(Core :: DOM: HTML Parser, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: moz, Assigned: mrbkap)

Details

(Keywords: testcase)

Attachments

(3 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8b5) Gecko/20051006 Firefox/1.4.1 Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8b5) Gecko/20051006 Firefox/1.4.1 Constructs like this: <!meta http-equiv="content-type" content="text/html; charset=iso-8859-7"> and this: <metaXXX http-equiv="content-type" content="text/html; charset=iso-8859-7"> are handled same like this: <meta http-equiv="content-type" content="text/html; charset=iso-8859-7">, but must be ignored completely. Reproducible: Always Steps to Reproduce: 1. go to upcoming testcases Actual Results: displaying greek letters Expected Results: displaying german umlauts
Keywords: testcase
Ouch. I think the problem is in nsParser.cpp somewhere.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 98 → All
Priority: -- → P3
Hardware: PC → All
Target Milestone: --- → mozilla1.9alpha
It might also be in nsMetaCharsetObserver.cpp. We do support some common invalid forms of meta charset declarations for compatibility, but this is clearly going too far :)
Status: NEW → ASSIGNED
Attached patch Fix both forms (obsolete) — Splinter Review
This patch does two things: makes the meta charset sniffing code treat <!...> as a comment and refuse to treat anything other than <meta\s+> as a meta tag. The comment sniffing code is not foolproof, but I think that should be fine. The other test seems a bit strict, since it rejects <meta>, but that's OK, since we'd ignore such tags in this code anyway.
Attachment #201299 - Flags: review?(jst)
Comment on attachment 201299 [details] [diff] [review] Fix both forms Oops, this doesn't skip the "comment" quite as I thought it would.
Attachment #201299 - Attachment is obsolete: true
Attachment #201299 - Flags: review?(jst)
Attachment #201301 - Flags: review?(jst)
Comment on attachment 201301 [details] [diff] [review] Better comment skipping r+sr=jst
Attachment #201301 - Flags: superreview+
Attachment #201301 - Flags: review?(jst)
Attachment #201301 - Flags: review+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: