зеркало из https://github.com/mozilla/gecko-dev.git
Backing out latest change, apprunner menus were totally screwed up. a=shaver, r=ramiro,pavlov
This commit is contained in:
Родитель
83f70bfb2c
Коммит
414e7107ef
|
@ -6431,52 +6431,27 @@ SyncAndInvalidateView(nsIView* aView, nsIFrame* aFrame,
|
||||||
aFrame->GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&) color);
|
aFrame->GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&) color);
|
||||||
aFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) disp);
|
aFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) disp);
|
||||||
|
|
||||||
// Set the view's opacity
|
|
||||||
aViewManager->SetViewOpacity(aView, color->mOpacity);
|
aViewManager->SetViewOpacity(aView, color->mOpacity);
|
||||||
|
PRBool viewVisible = (NS_STYLE_VISIBILITY_VISIBLE == disp->mVisible);
|
||||||
|
// XXX Troy, you need to hook in the leaf node logic here.
|
||||||
|
|
||||||
// See if the view should be hidden or visible
|
// XXX also need to set transparency in the view
|
||||||
PRBool viewIsVisible = PR_TRUE;
|
if (! viewVisible) {
|
||||||
PRBool viewHasTransparentContent = (color->mBackgroundFlags &
|
nsIView* parentView = nsnull;
|
||||||
NS_STYLE_BG_COLOR_TRANSPARENT) == NS_STYLE_BG_COLOR_TRANSPARENT;
|
aView->GetParent(parentView);
|
||||||
|
if (parentView) {
|
||||||
if (NS_STYLE_VISIBILITY_HIDDEN == disp->mVisible) {
|
nsRect bounds;
|
||||||
// If it's a scroll frame, then hide the view. This means that
|
aView->GetBounds(bounds);
|
||||||
// child elements can't override their parent's visibility, but
|
aViewManager->UpdateView(parentView, bounds, NS_VMREFRESH_NO_SYNC);
|
||||||
// it's not practical to leave it visible in all cases because
|
|
||||||
// the scrollbars will be showing
|
|
||||||
nsIAtom* frameType;
|
|
||||||
aFrame->GetFrameType(&frameType);
|
|
||||||
|
|
||||||
if (frameType == nsLayoutAtoms::scrollFrame) {
|
|
||||||
viewIsVisible = PR_FALSE;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// If it's a container element, then leave the view visible, but
|
|
||||||
// mark it as having transparent content. The reason we need to
|
|
||||||
// do this is that child elements can override their parent's
|
|
||||||
// hidden visibility and be visible anyway
|
|
||||||
nsIFrame* firstChild;
|
|
||||||
|
|
||||||
aFrame->FirstChild(nsnull, &firstChild);
|
|
||||||
if (firstChild) {
|
|
||||||
// It's not a left frame, so the view needs to be visible, but
|
|
||||||
// marked as having transparent content
|
|
||||||
viewHasTransparentContent = PR_TRUE;
|
|
||||||
} else {
|
|
||||||
// It's a leaf frame so go ahead and hide the view
|
|
||||||
viewIsVisible = PR_FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
NS_IF_RELEASE(frameType);
|
else {
|
||||||
|
// XXX??? how to deal with this??? Do we even have to?
|
||||||
|
}
|
||||||
|
aView->SetVisibility(nsViewVisibility_kHide);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
// Make sure visibility is correct
|
aView->SetVisibility(nsViewVisibility_kShow);
|
||||||
aViewManager->SetViewVisibility(aView, viewIsVisible ? nsViewVisibility_kShow :
|
aViewManager->UpdateView(aView, nsnull, NS_VMREFRESH_NO_SYNC);
|
||||||
nsViewVisibility_kHide);
|
|
||||||
|
|
||||||
// Make sure content transparency is correct
|
|
||||||
if (viewIsVisible) {
|
|
||||||
aViewManager->SetViewContentTransparency(aView, viewHasTransparentContent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6431,52 +6431,27 @@ SyncAndInvalidateView(nsIView* aView, nsIFrame* aFrame,
|
||||||
aFrame->GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&) color);
|
aFrame->GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&) color);
|
||||||
aFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) disp);
|
aFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) disp);
|
||||||
|
|
||||||
// Set the view's opacity
|
|
||||||
aViewManager->SetViewOpacity(aView, color->mOpacity);
|
aViewManager->SetViewOpacity(aView, color->mOpacity);
|
||||||
|
PRBool viewVisible = (NS_STYLE_VISIBILITY_VISIBLE == disp->mVisible);
|
||||||
|
// XXX Troy, you need to hook in the leaf node logic here.
|
||||||
|
|
||||||
// See if the view should be hidden or visible
|
// XXX also need to set transparency in the view
|
||||||
PRBool viewIsVisible = PR_TRUE;
|
if (! viewVisible) {
|
||||||
PRBool viewHasTransparentContent = (color->mBackgroundFlags &
|
nsIView* parentView = nsnull;
|
||||||
NS_STYLE_BG_COLOR_TRANSPARENT) == NS_STYLE_BG_COLOR_TRANSPARENT;
|
aView->GetParent(parentView);
|
||||||
|
if (parentView) {
|
||||||
if (NS_STYLE_VISIBILITY_HIDDEN == disp->mVisible) {
|
nsRect bounds;
|
||||||
// If it's a scroll frame, then hide the view. This means that
|
aView->GetBounds(bounds);
|
||||||
// child elements can't override their parent's visibility, but
|
aViewManager->UpdateView(parentView, bounds, NS_VMREFRESH_NO_SYNC);
|
||||||
// it's not practical to leave it visible in all cases because
|
|
||||||
// the scrollbars will be showing
|
|
||||||
nsIAtom* frameType;
|
|
||||||
aFrame->GetFrameType(&frameType);
|
|
||||||
|
|
||||||
if (frameType == nsLayoutAtoms::scrollFrame) {
|
|
||||||
viewIsVisible = PR_FALSE;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// If it's a container element, then leave the view visible, but
|
|
||||||
// mark it as having transparent content. The reason we need to
|
|
||||||
// do this is that child elements can override their parent's
|
|
||||||
// hidden visibility and be visible anyway
|
|
||||||
nsIFrame* firstChild;
|
|
||||||
|
|
||||||
aFrame->FirstChild(nsnull, &firstChild);
|
|
||||||
if (firstChild) {
|
|
||||||
// It's not a left frame, so the view needs to be visible, but
|
|
||||||
// marked as having transparent content
|
|
||||||
viewHasTransparentContent = PR_TRUE;
|
|
||||||
} else {
|
|
||||||
// It's a leaf frame so go ahead and hide the view
|
|
||||||
viewIsVisible = PR_FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
NS_IF_RELEASE(frameType);
|
else {
|
||||||
|
// XXX??? how to deal with this??? Do we even have to?
|
||||||
|
}
|
||||||
|
aView->SetVisibility(nsViewVisibility_kHide);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
// Make sure visibility is correct
|
aView->SetVisibility(nsViewVisibility_kShow);
|
||||||
aViewManager->SetViewVisibility(aView, viewIsVisible ? nsViewVisibility_kShow :
|
aViewManager->UpdateView(aView, nsnull, NS_VMREFRESH_NO_SYNC);
|
||||||
nsViewVisibility_kHide);
|
|
||||||
|
|
||||||
// Make sure content transparency is correct
|
|
||||||
if (viewIsVisible) {
|
|
||||||
aViewManager->SetViewContentTransparency(aView, viewHasTransparentContent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче