Bug 296377. Frames that use -moz-appearance may be transparent even if their background color is set, because the background color is not painted. r+sr=dbaron,a=chofmann

This commit is contained in:
roc+%cs.cmu.edu 2005-06-21 21:53:10 +00:00
Родитель 49086f674d
Коммит 67f39e9bdd
1 изменённых файлов: 4 добавлений и 3 удалений

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

@ -483,12 +483,15 @@ SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
// view's contents should be repainted and not bitblt'd
vm->SetViewBitBltEnabled(aView, !fixedBackground);
const nsStyleDisplay* display = aStyleContext->GetStyleDisplay();
// If the frame has a solid background color, 'background-clip:border',
// and it's a kind of frame that paints its background, and rounded borders aren't
// clipping the background, then it's opaque.
// If the frame has a native theme appearance then its background
// color is actually not relevant.
PRBool viewHasTransparentContent =
!(hasBG && !(bg->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT) &&
bg->mBackgroundClip == NS_STYLE_BG_CLIP_BORDER &&
!display->mAppearance && bg->mBackgroundClip == NS_STYLE_BG_CLIP_BORDER &&
aFrame->CanPaintBackground() &&
!HasNonZeroBorderRadius(aStyleContext));
@ -547,9 +550,7 @@ SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
}
// XXX we should also set widget transparency for XUL popups
const nsStyleDisplay* display = aStyleContext->GetStyleDisplay();
nsFrameState kidState = aFrame->GetStateBits();
PRBool isBlockLevel =
display->IsBlockLevel() || (kidState & NS_FRAME_OUT_OF_FLOW);