Make sure to apply our styles to our anonymous content no matter what the

page's style language is.  Bug 234761, r=sicking, sr=jst
This commit is contained in:
bzbarsky%mit.edu 2004-04-14 02:05:52 +00:00
Родитель 43c1afc189
Коммит 14c6b02ec5
3 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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.

Просмотреть файл

@ -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.