From 148bbbc8938987d4b13f4ee01861f427a223b1bb Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Wed, 1 Dec 1999 11:13:06 +0000 Subject: [PATCH] Prevent tree widget row groups from being added to the undisplayed content map twice. git-svn-id: svn://10.0.0.236/trunk@54898 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 20 +++++++++++++++++++ .../html/style/src/nsCSSFrameConstructor.cpp | 20 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index eec16312456..970da69f36f 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -9119,6 +9119,26 @@ nsCSSFrameConstructor::CreateTreeWidgetContent(nsIPresContext* aPresContext, nsFrameConstructorState state(aPresContext, mFixedContainingBlock, GetAbsoluteContainingBlock(aPresContext, aParentFrame), GetFloaterContainingBlock(aPresContext, aParentFrame)); + + // Get the element's tag + nsCOMPtr tag; + aChild->GetTag(*getter_AddRefs(tag)); + + nsCOMPtr styleContext; + rv = ResolveStyleContext(aPresContext, aParentFrame, aChild, tag, getter_AddRefs(styleContext)); + + if (NS_SUCCEEDED(rv)) { + // Pre-check for display "none" - only if we find that, do we create + // any frame at all + const nsStyleDisplay* display = (const nsStyleDisplay*) + styleContext->GetStyleData(eStyleStruct_Display); + + if (NS_STYLE_DISPLAY_NONE == display->mDisplay) { + *aNewFrame = nsnull; + return NS_OK; + } + } + rv = ConstructFrame(aPresContext, state, aChild, aParentFrame, frameItems); nsIFrame* newFrame = frameItems.childList; diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index eec16312456..970da69f36f 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -9119,6 +9119,26 @@ nsCSSFrameConstructor::CreateTreeWidgetContent(nsIPresContext* aPresContext, nsFrameConstructorState state(aPresContext, mFixedContainingBlock, GetAbsoluteContainingBlock(aPresContext, aParentFrame), GetFloaterContainingBlock(aPresContext, aParentFrame)); + + // Get the element's tag + nsCOMPtr tag; + aChild->GetTag(*getter_AddRefs(tag)); + + nsCOMPtr styleContext; + rv = ResolveStyleContext(aPresContext, aParentFrame, aChild, tag, getter_AddRefs(styleContext)); + + if (NS_SUCCEEDED(rv)) { + // Pre-check for display "none" - only if we find that, do we create + // any frame at all + const nsStyleDisplay* display = (const nsStyleDisplay*) + styleContext->GetStyleData(eStyleStruct_Display); + + if (NS_STYLE_DISPLAY_NONE == display->mDisplay) { + *aNewFrame = nsnull; + return NS_OK; + } + } + rv = ConstructFrame(aPresContext, state, aChild, aParentFrame, frameItems); nsIFrame* newFrame = frameItems.childList;