зеркало из https://github.com/mozilla/pjs.git
Follow-up cleanup b=375403 r+sr=roc
This commit is contained in:
Родитель
20daf662dd
Коммит
6ac8dc33c1
|
@ -2210,8 +2210,7 @@ nsLayoutUtils::FrameHasTransparency(nsIFrame* aFrame) {
|
||||||
if (aFrame->GetStyleContext()->GetStyleDisplay()->mOpacity < 1.0f)
|
if (aFrame->GetStyleContext()->GetStyleDisplay()->mOpacity < 1.0f)
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
|
|
||||||
const nsStyleBorder* border = aFrame->GetStyleContext()->GetStyleBorder();
|
if (HasNonZeroSide(aFrame->GetStyleContext()->GetStyleBorder()->mBorderRadius))
|
||||||
if (HasNonZeroSide(border->mBorderRadius))
|
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
|
|
||||||
if (aFrame->IsThemed())
|
if (aFrame->IsThemed())
|
||||||
|
|
|
@ -394,12 +394,6 @@ nsContainerFrame::PositionFrameView(nsIFrame* aKidFrame)
|
||||||
vm->MoveViewTo(view, pt.x, pt.y);
|
vm->MoveViewTo(view, pt.x, pt.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PRBool
|
|
||||||
HasNonZeroBorderRadius(nsStyleContext* aStyleContext) {
|
|
||||||
const nsStyleBorder* border = aStyleContext->GetStyleBorder();
|
|
||||||
return nsLayoutUtils::HasNonZeroSide(border->mBorderRadius);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
|
SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
|
@ -414,26 +408,10 @@ SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
|
||||||
PRBool hasBG =
|
PRBool hasBG =
|
||||||
nsCSSRendering::FindBackground(aPresContext, aFrame, &bg, &isCanvas);
|
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) {
|
if (isCanvas) {
|
||||||
nsIView* rootView;
|
nsIView* rootView;
|
||||||
vm->GetRootView(rootView);
|
vm->GetRootView(rootView);
|
||||||
nsIView* rootParent = rootView->GetParent();
|
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();
|
nsIDocument *doc = aPresContext->PresShell()->GetDocument();
|
||||||
if (doc) {
|
if (doc) {
|
||||||
|
@ -446,13 +424,11 @@ SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
|
||||||
// don't proceed unless this is the root view
|
// don't proceed unless this is the root view
|
||||||
// (sometimes the non-root-view is a canvas)
|
// (sometimes the non-root-view is a canvas)
|
||||||
if (aView->HasWidget() && aView == rootView) {
|
if (aView->HasWidget() && aView == rootView) {
|
||||||
viewHasTransparentContent = nsLayoutUtils::FrameHasTransparency(aFrame);
|
aView->GetWidget()->SetWindowTranslucency(nsLayoutUtils::FrameHasTransparency(aFrame));
|
||||||
aView->GetWidget()->SetWindowTranslucency(viewHasTransparentContent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// XXX we should also set widget transparency for XUL popups
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Загрузка…
Ссылка в новой задаче