diff --git a/mozilla/content/base/src/nsHTMLContentSerializer.cpp b/mozilla/content/base/src/nsHTMLContentSerializer.cpp index acc14d7782c..ff51a37b5e9 100644 --- a/mozilla/content/base/src/nsHTMLContentSerializer.cpp +++ b/mozilla/content/base/src/nsHTMLContentSerializer.cpp @@ -634,9 +634,9 @@ nsHTMLContentSerializer::AppendElementStart(nsIDOMElement *aElement, nsIAtom *name = content->Tag(); + // We need too skip any meta tags that set the content type + // becase we set our own later. if (name == nsGkAtoms::meta) { - // We need too skip any meta tags that set the content type - // becase we set our own later. nsAutoString header; content->GetAttr(kNameSpaceID_None, nsGkAtoms::httpEquiv, header); if (header.LowerCaseEqualsLiteral("content-type")) { @@ -739,16 +739,13 @@ nsHTMLContentSerializer::AppendElementStart(nsIDOMElement *aElement, } if (name == nsGkAtoms::head) { - // We should also obey the line break rules set for a normal meta tag here. - // We add a line break before and after the tag's opening. AppendToString(mLineBreak, aStr); AppendToString(NS_LITERAL_STRING(""), aStr); - AppendToString(mLineBreak, aStr); - } + } return NS_OK; } @@ -767,6 +764,15 @@ nsHTMLContentSerializer::AppendElementEnd(nsIDOMElement *aElement, nsIAtom *name = content->Tag(); + // So that we don't mess up the line breaks. + if (name == nsGkAtoms::meta) { + nsAutoString header; + content->GetAttr(kNameSpaceID_None, nsGkAtoms::httpEquiv, header); + if (header.LowerCaseEqualsLiteral("content-type")) { + return NS_OK; + } + } + if (name == nsGkAtoms::script) { nsCOMPtr script = do_QueryInterface(aElement); NS_ASSERTION(script, "What kind of weird script element is this?");