Don't apply z-index to non-positioned elements. b=297425 r+sr=roc a=asa

This commit is contained in:
mats.palmgren%bredband.net 2005-06-14 23:53:56 +00:00
Родитель 26c3de4ba2
Коммит 774f7d6bed
1 изменённых файлов: 12 добавлений и 8 удалений

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

@ -778,21 +778,25 @@ nsContainerFrame::SyncFrameViewProperties(nsPresContext* aPresContext,
// See if the frame is being relatively positioned or absolutely
// positioned
PRBool isTopMostView = display->IsPositioned();
// Make sure z-index is correct
const nsStylePosition* position = aStyleContext->GetStylePosition();
PRBool isPositioned = display->IsPositioned();
PRInt32 zIndex = 0;
PRBool autoZIndex = PR_FALSE;
if (position->mZIndex.GetUnit() == eStyleUnit_Integer) {
zIndex = position->mZIndex.GetIntValue();
} else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) {
if (!isPositioned) {
autoZIndex = PR_TRUE;
} else {
// Make sure z-index is correct
const nsStylePosition* position = aStyleContext->GetStylePosition();
if (position->mZIndex.GetUnit() == eStyleUnit_Integer) {
zIndex = position->mZIndex.GetIntValue();
} else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) {
autoZIndex = PR_TRUE;
}
}
vm->SetViewZIndex(aView, autoZIndex, zIndex, isTopMostView);
vm->SetViewZIndex(aView, autoZIndex, zIndex, isPositioned);
SyncFrameViewGeometryDependentProperties(aPresContext, aFrame, aStyleContext, aView, aFlags);
}