Replace the BodyFixupRule with code in nsCSSRendering to fix all the problems with dynamic style changes and backgrounds on the root element and the BODY element. Change the way the HTMLDocumentColorRule (for the table color quirk) is initialized since it used to depend on the BodyFixupRule. b=116161 (also fixes other bugs) r=attinasi sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@111511 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -2967,18 +2967,10 @@ nsHTMLDocument::GetBgColor(nsAWritableString& aBgColor)
|
||||
|
||||
aBgColor.Truncate();
|
||||
result = GetBodyElement(&body);
|
||||
if (NS_OK == result) {
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = body->GetBgColor(aBgColor);
|
||||
NS_RELEASE(body);
|
||||
}
|
||||
else if (nsnull != mAttrStyleSheet) {
|
||||
nscolor color;
|
||||
result = mAttrStyleSheet->GetDocumentBackgroundColor(color);
|
||||
if (NS_OK == result) {
|
||||
nsHTMLValue value(color);
|
||||
nsGenericHTMLElement::ColorToString(value, aBgColor);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -2990,16 +2982,11 @@ nsHTMLDocument::SetBgColor(const nsAReadableString& aBgColor)
|
||||
nsIDOMHTMLBodyElement* body;
|
||||
|
||||
result = GetBodyElement(&body);
|
||||
if (NS_OK == result) {
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = body->SetBgColor(aBgColor);
|
||||
NS_RELEASE(body);
|
||||
}
|
||||
else if (nsnull != mAttrStyleSheet) {
|
||||
nsHTMLValue value;
|
||||
if (nsGenericHTMLElement::ParseColor(aBgColor, this, value)) {
|
||||
mAttrStyleSheet->SetDocumentBackgroundColor(value.GetColorValue());
|
||||
}
|
||||
}
|
||||
// XXXldb And otherwise?
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -3012,18 +2999,10 @@ nsHTMLDocument::GetFgColor(nsAWritableString& aFgColor)
|
||||
|
||||
aFgColor.Truncate();
|
||||
result = GetBodyElement(&body);
|
||||
if (NS_OK == result) {
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = body->GetText(aFgColor);
|
||||
NS_RELEASE(body);
|
||||
}
|
||||
else if (nsnull != mAttrStyleSheet) {
|
||||
nscolor color;
|
||||
result = mAttrStyleSheet->GetDocumentForegroundColor(color);
|
||||
if (NS_OK == result) {
|
||||
nsHTMLValue value(color);
|
||||
nsGenericHTMLElement::ColorToString(value, aFgColor);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -3035,17 +3014,11 @@ nsHTMLDocument::SetFgColor(const nsAReadableString& aFgColor)
|
||||
nsIDOMHTMLBodyElement* body;
|
||||
|
||||
result = GetBodyElement(&body);
|
||||
if (NS_OK == result) {
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = body->SetText(aFgColor);
|
||||
NS_RELEASE(body);
|
||||
}
|
||||
else if (nsnull != mAttrStyleSheet) {
|
||||
nsHTMLValue value;
|
||||
|
||||
if (nsGenericHTMLElement::ParseColor(aFgColor, this, value)) {
|
||||
mAttrStyleSheet->SetDocumentForegroundColor(value.GetColorValue());
|
||||
}
|
||||
}
|
||||
// XXXldb And otherwise?
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user