From 35c37fb0de11618dc75fc17074268adb3cba49d8 Mon Sep 17 00:00:00 2001 From: "pierre%netscape.com" Date: Wed, 2 May 2001 10:24:57 +0000 Subject: [PATCH] 63502 Content-Style-Type don't ignore parameters. r=attinasi --- content/html/content/src/nsGenericHTMLElement.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index 4b1c01b63986..d9582cbdc74d 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -2857,7 +2857,8 @@ nsGenericHTMLElement::ParseStyleAttribute(const nsAReadableString& aValue, nsHTM nsAutoString styleType; mDocument->GetHeaderData(nsHTMLAtoms::headerContentStyleType, styleType); if (0 < styleType.Length()) { - isCSS = styleType.EqualsIgnoreCase("text/css"); + static const char* textCssStr = "text/css"; + isCSS = styleType.EqualsIgnoreCase(textCssStr, sizeof(textCssStr)); } if (isCSS) { @@ -2872,6 +2873,14 @@ nsGenericHTMLElement::ParseStyleAttribute(const nsAReadableString& aValue, nsHTM } if (NS_SUCCEEDED(result) && cssLoader) { result = cssLoader->GetParserFor(nsnull, &cssParser); + + static const char* charsetStr = "charset="; + PRInt32 charsetOffset = styleType.Find(charsetStr,PR_TRUE); + if (charsetOffset > 0) { + nsString charset; + styleType.Mid(charset, charsetOffset + sizeof(charsetStr), -1); + (void)cssLoader->SetCharset(charset); + } } else { result = NS_NewCSSParser(&cssParser);