From 6ac8dc33c1f5af6fd16be133cef5bff616db9dbc Mon Sep 17 00:00:00 2001 From: "neil@parkwaycc.co.uk" Date: Sun, 13 May 2007 03:06:57 -0700 Subject: [PATCH] Follow-up cleanup b=375403 r+sr=roc --- layout/base/nsLayoutUtils.cpp | 3 +-- layout/generic/nsContainerFrame.cpp | 26 +------------------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index a9612ef7e3a..4dc8a9feef9 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -2210,8 +2210,7 @@ nsLayoutUtils::FrameHasTransparency(nsIFrame* aFrame) { if (aFrame->GetStyleContext()->GetStyleDisplay()->mOpacity < 1.0f) return PR_TRUE; - const nsStyleBorder* border = aFrame->GetStyleContext()->GetStyleBorder(); - if (HasNonZeroSide(border->mBorderRadius)) + if (HasNonZeroSide(aFrame->GetStyleContext()->GetStyleBorder()->mBorderRadius)) return PR_TRUE; if (aFrame->IsThemed()) diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index 2339aa4c5bb..2b88074af4c 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -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