Fix for table color quirk bug. r=dbaron, sr=attinasi

This commit is contained in:
hyatt%netscape.com 2001-08-01 07:51:27 +00:00
parent f268a4e88d
commit 83c6db5ccf
3 changed files with 5 additions and 29 deletions

View File

@ -669,6 +669,8 @@ HTMLStyleSheetImpl::HTMLStyleSheetImpl(void)
{
NS_INIT_REFCNT();
mTableTHRule = new TableTHRule(this);
mDocumentColorRule = new HTMLDocumentColorRule(this);
NS_ADDREF(mDocumentColorRule);
NS_ADDREF(mTableTHRule);
}
@ -1117,13 +1119,6 @@ NS_IMETHODIMP HTMLStyleSheetImpl::SetVisitedLinkColor(nscolor aColor)
NS_IMETHODIMP HTMLStyleSheetImpl::SetDocumentForegroundColor(nscolor aColor)
{
if (nsnull == mDocumentColorRule) {
mDocumentColorRule = new HTMLDocumentColorRule(this);
if (nsnull == mDocumentColorRule) {
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(mDocumentColorRule);
}
mDocumentColorRule->mColor = aColor;
mDocumentColorRule->mForegroundSet = PR_TRUE;
return NS_OK;
@ -1131,13 +1126,6 @@ NS_IMETHODIMP HTMLStyleSheetImpl::SetDocumentForegroundColor(nscolor aColor)
NS_IMETHODIMP HTMLStyleSheetImpl::SetDocumentBackgroundColor(nscolor aColor)
{
if (nsnull == mDocumentColorRule) {
mDocumentColorRule = new HTMLDocumentColorRule(this);
if (nsnull == mDocumentColorRule) {
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(mDocumentColorRule);
}
mDocumentColorRule->mBackgroundColor = aColor;
mDocumentColorRule->mBackgroundSet = PR_TRUE;
return NS_OK;

View File

@ -892,7 +892,7 @@ nsRuleNode::WalkRuleTree(const nsStyleStructID& aSID, nsIStyleContext* aContext,
detail = eRulePartialMixed; // Treat as though some data is specified to avoid
// the optimizations and force data computation.
if (detail == eRuleNone && startStruct) {
if (detail == eRuleNone && startStruct && !aRuleData->mPostResolveCallback) {
// We specified absolutely no rule information, but a parent rule in the tree
// specified all the rule information. We set a bit along the branch from our
// node in the tree to the node that specified the data that tells nodes on that

View File

@ -669,6 +669,8 @@ HTMLStyleSheetImpl::HTMLStyleSheetImpl(void)
{
NS_INIT_REFCNT();
mTableTHRule = new TableTHRule(this);
mDocumentColorRule = new HTMLDocumentColorRule(this);
NS_ADDREF(mDocumentColorRule);
NS_ADDREF(mTableTHRule);
}
@ -1117,13 +1119,6 @@ NS_IMETHODIMP HTMLStyleSheetImpl::SetVisitedLinkColor(nscolor aColor)
NS_IMETHODIMP HTMLStyleSheetImpl::SetDocumentForegroundColor(nscolor aColor)
{
if (nsnull == mDocumentColorRule) {
mDocumentColorRule = new HTMLDocumentColorRule(this);
if (nsnull == mDocumentColorRule) {
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(mDocumentColorRule);
}
mDocumentColorRule->mColor = aColor;
mDocumentColorRule->mForegroundSet = PR_TRUE;
return NS_OK;
@ -1131,13 +1126,6 @@ NS_IMETHODIMP HTMLStyleSheetImpl::SetDocumentForegroundColor(nscolor aColor)
NS_IMETHODIMP HTMLStyleSheetImpl::SetDocumentBackgroundColor(nscolor aColor)
{
if (nsnull == mDocumentColorRule) {
mDocumentColorRule = new HTMLDocumentColorRule(this);
if (nsnull == mDocumentColorRule) {
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(mDocumentColorRule);
}
mDocumentColorRule->mBackgroundColor = aColor;
mDocumentColorRule->mBackgroundSet = PR_TRUE;
return NS_OK;