don't bail on bg drawing when moz-appearance is set on a root. r=bryner/sr=hyatt. bug#119736

This commit is contained in:
pinkerton%netscape.com 2002-02-20 02:14:18 +00:00
Родитель 142410b896
Коммит a718639cf9
2 изменённых файлов: 46 добавлений и 4 удалений

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

@ -2547,8 +2547,29 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext,
PRBool isCanvas;
const nsStyleBackground *color;
if (!FindBackground(aPresContext, aForFrame, &color, &isCanvas))
return;
if (!FindBackground(aPresContext, aForFrame, &color, &isCanvas)) {
// we don't want to bail out of moz-appearance is set on a root
// node. If it has a parent content node, bail because it's not
// a root, other wise keep going in order to let the theme stuff
// draw the background. The canvas really should be drawing the
// bg, but there's no way to hook that up via css.
const nsStyleDisplay* displayData = nsnull;
aForFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct*&)displayData));
if (displayData->mAppearance) {
nsCOMPtr<nsIContent> content;
aForFrame->GetContent(getter_AddRefs(content));
if ( content ) {
nsCOMPtr<nsIContent> parent;
content->GetParent(*getter_AddRefs(parent));
if ( parent )
return;
}
else
return;
}
else
return;
}
if (!isCanvas) {
PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame,
aDirtyRect, aBorderArea, *color, aBorder, aDX, aDY, aUsePrintSettings);

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

@ -2547,8 +2547,29 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext,
PRBool isCanvas;
const nsStyleBackground *color;
if (!FindBackground(aPresContext, aForFrame, &color, &isCanvas))
return;
if (!FindBackground(aPresContext, aForFrame, &color, &isCanvas)) {
// we don't want to bail out of moz-appearance is set on a root
// node. If it has a parent content node, bail because it's not
// a root, other wise keep going in order to let the theme stuff
// draw the background. The canvas really should be drawing the
// bg, but there's no way to hook that up via css.
const nsStyleDisplay* displayData = nsnull;
aForFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct*&)displayData));
if (displayData->mAppearance) {
nsCOMPtr<nsIContent> content;
aForFrame->GetContent(getter_AddRefs(content));
if ( content ) {
nsCOMPtr<nsIContent> parent;
content->GetParent(*getter_AddRefs(parent));
if ( parent )
return;
}
else
return;
}
else
return;
}
if (!isCanvas) {
PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame,
aDirtyRect, aBorderArea, *color, aBorder, aDX, aDY, aUsePrintSettings);