Bug 298889 - iframe invisible when window is transparent; r+sr=roc

This commit is contained in:
XiaoXiaoHU 2009-02-24 17:53:32 +01:00
Родитель 311f3714fd
Коммит 0dddf58b3e
4 изменённых файлов: 30 добавлений и 18 удалений

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

@ -2226,7 +2226,7 @@ DocumentViewerImpl::MakeWindow(const nsSize& aSize)
if (container) {
container->GetSameTypeParent(getter_AddRefs(sameTypeParent));
}
if (!sameTypeParent) {
if (!sameTypeParent && mParentWidget->GetTransparencyMode() != eTransparencyTransparent) {
containerView = nsnull;
}
}

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

@ -525,7 +525,8 @@ void nsScrollPortView::Scroll(nsView *aScrolledView, nsPoint aTwipsDelta, nsIntP
nsRegion updateRegion;
PRBool canBitBlit = scrollWidget &&
((mScrollProperties & NS_SCROLL_PROPERTY_ALWAYS_BLIT) ||
mViewManager->CanScrollWithBitBlt(aScrolledView, aTwipsDelta, &updateRegion));
mViewManager->CanScrollWithBitBlt(aScrolledView, aTwipsDelta, &updateRegion)) &&
scrollWidget->GetTransparencyMode() != eTransparencyTransparent;
if (canBitBlit) {
// We're going to bit-blit. Let the viewmanager know so it can

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

@ -554,6 +554,10 @@ void nsViewManager::AddCoveringWidgetsToOpaqueRegion(nsRegion &aRgn, nsIDeviceCo
return;
}
if (widget->GetTransparencyMode() == eTransparencyTransparent) {
return;
}
for (nsIWidget* childWidget = widget->GetFirstChild();
childWidget;
childWidget = childWidget->GetNextSibling()) {
@ -813,22 +817,24 @@ nsViewManager::UpdateWidgetArea(nsView *aWidgetView, const nsRegion &aDamagedReg
// accumulate the union of all the child widget areas, or at least
// some subset of that.
nsRegion children;
for (nsIWidget* childWidget = widget->GetFirstChild();
childWidget;
childWidget = childWidget->GetNextSibling()) {
nsView* view = nsView::GetViewFor(childWidget);
NS_ASSERTION(view != aWidgetView, "will recur infinitely");
if (view && view->GetVisibility() == nsViewVisibility_kShow) {
// Don't mess with views that are in completely different view
// manager trees
if (view->GetViewManager()->RootViewManager() == RootViewManager()) {
// get the damage region into 'view's coordinate system
nsRegion damage = intersection;
nsPoint offset = view->GetOffsetTo(aWidgetView);
damage.MoveBy(-offset);
UpdateWidgetArea(view, damage, aIgnoreWidgetView);
children.Or(children, view->GetDimensions() + offset);
children.SimplifyInward(20);
if (widget->GetTransparencyMode() != eTransparencyTransparent) {
for (nsIWidget* childWidget = widget->GetFirstChild();
childWidget;
childWidget = childWidget->GetNextSibling()) {
nsView* view = nsView::GetViewFor(childWidget);
NS_ASSERTION(view != aWidgetView, "will recur infinitely");
if (view && view->GetVisibility() == nsViewVisibility_kShow) {
// Don't mess with views that are in completely different view
// manager trees
if (view->GetViewManager()->RootViewManager() == RootViewManager()) {
// get the damage region into 'view's coordinate system
nsRegion damage = intersection;
nsPoint offset = view->GetOffsetTo(aWidgetView);
damage.MoveBy(-offset);
UpdateWidgetArea(view, damage, aIgnoreWidgetView);
children.Or(children, view->GetDimensions() + offset);
children.SimplifyInward(20);
}
}
}
}

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

@ -8507,6 +8507,11 @@ void nsWindow::SetWindowTranslucencyInner(nsTransparencyMode aMode)
style |= topWindow->WindowStyle();
exStyle |= topWindow->WindowExStyle();
if (aMode == eTransparencyTransparent) {
style &= ~(WS_CAPTION | WS_THICKFRAME | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX);
exStyle &= ~(WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE);
}
VERIFY_WINDOW_STYLE(style);
::SetWindowLongPtrW(hWnd, GWL_STYLE, style);
::SetWindowLongPtrW(hWnd, GWL_EXSTYLE, exStyle);