From 2ea5ceca9c8975c8aea8b4453a38fd68c233b3ae Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Wed, 8 Dec 1999 04:49:20 +0000 Subject: [PATCH] Changed to respect 'z-index' of 'auto' and call SetViewAutoZIndex() git-svn-id: svn://10.0.0.236/trunk@55713 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsContainerFrame.cpp | 16 ++++++++++++++++ mozilla/layout/generic/nsHTMLContainerFrame.cpp | 11 +++++++++++ .../layout/html/base/src/nsContainerFrame.cpp | 16 ++++++++++++++++ .../html/base/src/nsHTMLContainerFrame.cpp | 11 +++++++++++ 4 files changed, 54 insertions(+) diff --git a/mozilla/layout/generic/nsContainerFrame.cpp b/mozilla/layout/generic/nsContainerFrame.cpp index 7db54d6150f..1dea0123653 100644 --- a/mozilla/layout/generic/nsContainerFrame.cpp +++ b/mozilla/layout/generic/nsContainerFrame.cpp @@ -519,6 +519,22 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext, vm->SetViewContentTransparency(aView, viewHasTransparentContent); } + // Make sure z-index is correct + PRInt32 zIndex = 0; + PRBool autoZIndex = PR_FALSE; + const nsStylePosition* position; + + aFrame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position); + if (position->mZIndex.GetUnit() == eStyleUnit_Integer) { + zIndex = position->mZIndex.GetIntValue(); + + } else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) { + autoZIndex = PR_TRUE; + } + + vm->SetViewZIndex(aView, zIndex); + vm->SetViewAutoZIndex(aView, autoZIndex); + // Clip applies to block-level and replaced elements with overflow // set to other than 'visible' if (display->IsBlockLevel()) { diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.cpp b/mozilla/layout/generic/nsHTMLContainerFrame.cpp index ab4863a8c39..bb94bb9ed74 100644 --- a/mozilla/layout/generic/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/generic/nsHTMLContainerFrame.cpp @@ -300,6 +300,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // If we don't yet have a view, see if we need a view if (nsnull == view) { PRInt32 zIndex = 0; + PRBool autoZIndex = PR_FALSE; PRBool fixedBackgroundAttachment = PR_FALSE; // Get nsStyleColor and nsStyleDisplay @@ -336,6 +337,9 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // Get the z-index to use if (position->mZIndex.GetUnit() == eStyleUnit_Integer) { zIndex = position->mZIndex.GetIntValue(); + + } else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) { + autoZIndex = PR_TRUE; } } else if (position->IsAbsolutelyPositioned()) { @@ -347,6 +351,9 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // Get the z-index to use if (position->mZIndex.GetUnit() == eStyleUnit_Integer) { zIndex = position->mZIndex.GetIntValue(); + + } else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) { + autoZIndex = PR_TRUE; } } } @@ -407,6 +414,10 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, scrollingView->SetScrolledView(view); } else { viewManager->InsertChild(parentView, view, zIndex); + + if (autoZIndex) { + viewManager->SetViewAutoZIndex(view, PR_TRUE); + } } // See if the view should be hidden diff --git a/mozilla/layout/html/base/src/nsContainerFrame.cpp b/mozilla/layout/html/base/src/nsContainerFrame.cpp index 7db54d6150f..1dea0123653 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsContainerFrame.cpp @@ -519,6 +519,22 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext, vm->SetViewContentTransparency(aView, viewHasTransparentContent); } + // Make sure z-index is correct + PRInt32 zIndex = 0; + PRBool autoZIndex = PR_FALSE; + const nsStylePosition* position; + + aFrame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position); + if (position->mZIndex.GetUnit() == eStyleUnit_Integer) { + zIndex = position->mZIndex.GetIntValue(); + + } else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) { + autoZIndex = PR_TRUE; + } + + vm->SetViewZIndex(aView, zIndex); + vm->SetViewAutoZIndex(aView, autoZIndex); + // Clip applies to block-level and replaced elements with overflow // set to other than 'visible' if (display->IsBlockLevel()) { diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp index ab4863a8c39..bb94bb9ed74 100644 --- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp @@ -300,6 +300,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // If we don't yet have a view, see if we need a view if (nsnull == view) { PRInt32 zIndex = 0; + PRBool autoZIndex = PR_FALSE; PRBool fixedBackgroundAttachment = PR_FALSE; // Get nsStyleColor and nsStyleDisplay @@ -336,6 +337,9 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // Get the z-index to use if (position->mZIndex.GetUnit() == eStyleUnit_Integer) { zIndex = position->mZIndex.GetIntValue(); + + } else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) { + autoZIndex = PR_TRUE; } } else if (position->IsAbsolutelyPositioned()) { @@ -347,6 +351,9 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // Get the z-index to use if (position->mZIndex.GetUnit() == eStyleUnit_Integer) { zIndex = position->mZIndex.GetIntValue(); + + } else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) { + autoZIndex = PR_TRUE; } } } @@ -407,6 +414,10 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, scrollingView->SetScrolledView(view); } else { viewManager->InsertChild(parentView, view, zIndex); + + if (autoZIndex) { + viewManager->SetViewAutoZIndex(view, PR_TRUE); + } } // See if the view should be hidden