diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp index feba14e6814..c3275750a3f 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp @@ -2618,11 +2618,14 @@ nsGenericHTMLElement::ParseStyleAttribute(nsIContent* aContent, if (doc) { PRBool isCSS = PR_TRUE; // assume CSS until proven otherwise - nsAutoString styleType; - doc->GetHeaderData(nsHTMLAtoms::headerContentStyleType, styleType); - if (!styleType.IsEmpty()) { - static const char textCssStr[] = "text/css"; - isCSS = (styleType.EqualsIgnoreCase(textCssStr, sizeof(textCssStr) - 1)); + if (!aContent->IsNativeAnonymous()) { // native anonymous content + // always assumes CSS + nsAutoString styleType; + doc->GetHeaderData(nsHTMLAtoms::headerContentStyleType, styleType); + if (!styleType.IsEmpty()) { + static const char textCssStr[] = "text/css"; + isCSS = (styleType.EqualsIgnoreCase(textCssStr, sizeof(textCssStr) - 1)); + } } if (isCSS) { diff --git a/mozilla/layout/forms/nsTextControlFrame.cpp b/mozilla/layout/forms/nsTextControlFrame.cpp index 5c7e644cc06..e132eee442c 100644 --- a/mozilla/layout/forms/nsTextControlFrame.cpp +++ b/mozilla/layout/forms/nsTextControlFrame.cpp @@ -1675,6 +1675,9 @@ nsTextControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, if (!divContent) return NS_ERROR_FAILURE; + // Set the div native anonymous, so CSS will be its style language + // no matter what. + divContent->SetNativeAnonymous(PR_TRUE); // Set the neccessary style attributes on the text control. diff --git a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp index 5c7e644cc06..e132eee442c 100644 --- a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp @@ -1675,6 +1675,9 @@ nsTextControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, if (!divContent) return NS_ERROR_FAILURE; + // Set the div native anonymous, so CSS will be its style language + // no matter what. + divContent->SetNativeAnonymous(PR_TRUE); // Set the neccessary style attributes on the text control.