Follow-up cleanup b=375403 r+sr=roc

This commit is contained in:
2007-05-13 03:06:57 -07:00
parent 8be7168ccf
commit 0922eb8669
2 changed files with 2 additions and 27 deletions

View File

@@ -394,12 +394,6 @@ nsContainerFrame::PositionFrameView(nsIFrame* aKidFrame)
vm->MoveViewTo(view, pt.x, pt.y);
}
static PRBool
HasNonZeroBorderRadius(nsStyleContext* aStyleContext) {
const nsStyleBorder* border = aStyleContext->GetStyleBorder();
return nsLayoutUtils::HasNonZeroSide(border->mBorderRadius);
}
static void
SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
nsIFrame* aFrame,
@@ -414,26 +408,10 @@ SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
PRBool hasBG =
nsCSSRendering::FindBackground(aPresContext, aFrame, &bg, &isCanvas);
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) &&
!display->mAppearance && bg->mBackgroundClip == NS_STYLE_BG_CLIP_BORDER &&
!HasNonZeroBorderRadius(aStyleContext));
if (isCanvas) {
nsIView* rootView;
vm->GetRootView(rootView);
nsIView* rootParent = rootView->GetParent();
if (!rootParent) {
// We're the root of a view manager hierarchy. We will have to
// paint something. NOTE: this can be overridden below.
viewHasTransparentContent = PR_FALSE;
}
nsIDocument *doc = aPresContext->PresShell()->GetDocument();
if (doc) {
@@ -446,13 +424,11 @@ SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
// don't proceed unless this is the root view
// (sometimes the non-root-view is a canvas)
if (aView->HasWidget() && aView == rootView) {
viewHasTransparentContent = nsLayoutUtils::FrameHasTransparency(aFrame);
aView->GetWidget()->SetWindowTranslucency(viewHasTransparentContent);
aView->GetWidget()->SetWindowTranslucency(nsLayoutUtils::FrameHasTransparency(aFrame));
}
}
}
}
// XXX we should also set widget transparency for XUL popups
}
void