diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index ba8776710bd..dc52c4e8264 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -2907,18 +2907,16 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsIPresShell* aPresShe } PRBool -nsCSSFrameConstructor::MustGeneratePseudoParent(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIAtom* aTag, - nsIContent* aContent) +nsCSSFrameConstructor::MustGeneratePseudoParent(nsIPresContext* aPresContext, + nsIFrame* aParentFrame, + nsIAtom* aTag, + nsIContent* aContent, + nsIStyleContext* aStyleContext) { - nsCOMPtr styleContext; - - nsresult rv = ResolveStyleContext(aPresContext, aParentFrame, aContent, aTag, getter_AddRefs(styleContext)); - if (NS_FAILED(rv)) return PR_FALSE; + if (!aStyleContext) return PR_FALSE; const nsStyleDisplay* display = (const nsStyleDisplay*) - styleContext->GetStyleData(eStyleStruct_Display); + aStyleContext->GetStyleData(eStyleStruct_Display); if (NS_STYLE_DISPLAY_NONE == display->mDisplay) return PR_FALSE; @@ -2986,7 +2984,7 @@ nsCSSFrameConstructor::ConstructTableForeignFrame(nsIPresShell* aPres } } // Do not construct pseudo frames for trees - else if (MustGeneratePseudoParent(aPresContext, aParentFrameIn, tag.get(), aContent)) { + else if (MustGeneratePseudoParent(aPresContext, aParentFrameIn, tag.get(), aContent, aStyleContext)) { // this frame may have a pseudo parent, use block frame type to trigger foreign GetParentFrame(aPresShell, aPresContext, aTableCreator, *aParentFrameIn, nsLayoutAtoms::blockFrame, aState, parentFrame, aIsPseudoParent); diff --git a/layout/base/nsCSSFrameConstructor.h b/layout/base/nsCSSFrameConstructor.h index 64d36d7b09a..c2a64c30137 100644 --- a/layout/base/nsCSSFrameConstructor.h +++ b/layout/base/nsCSSFrameConstructor.h @@ -298,10 +298,11 @@ protected: nsIFrame*& aNewCellInnerFrame, PRBool& aIsPseudoParent); - PRBool MustGeneratePseudoParent(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIAtom* aTag, - nsIContent* aContent); + PRBool MustGeneratePseudoParent(nsIPresContext* aPresContext, + nsIFrame* aParentFrame, + nsIAtom* aTag, + nsIContent* aContent, + nsIStyleContext* aContext); nsresult ConstructTableForeignFrame(nsIPresShell* aPresShell, nsIPresContext* aPresContext, diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index ba8776710bd..dc52c4e8264 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -2907,18 +2907,16 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsIPresShell* aPresShe } PRBool -nsCSSFrameConstructor::MustGeneratePseudoParent(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIAtom* aTag, - nsIContent* aContent) +nsCSSFrameConstructor::MustGeneratePseudoParent(nsIPresContext* aPresContext, + nsIFrame* aParentFrame, + nsIAtom* aTag, + nsIContent* aContent, + nsIStyleContext* aStyleContext) { - nsCOMPtr styleContext; - - nsresult rv = ResolveStyleContext(aPresContext, aParentFrame, aContent, aTag, getter_AddRefs(styleContext)); - if (NS_FAILED(rv)) return PR_FALSE; + if (!aStyleContext) return PR_FALSE; const nsStyleDisplay* display = (const nsStyleDisplay*) - styleContext->GetStyleData(eStyleStruct_Display); + aStyleContext->GetStyleData(eStyleStruct_Display); if (NS_STYLE_DISPLAY_NONE == display->mDisplay) return PR_FALSE; @@ -2986,7 +2984,7 @@ nsCSSFrameConstructor::ConstructTableForeignFrame(nsIPresShell* aPres } } // Do not construct pseudo frames for trees - else if (MustGeneratePseudoParent(aPresContext, aParentFrameIn, tag.get(), aContent)) { + else if (MustGeneratePseudoParent(aPresContext, aParentFrameIn, tag.get(), aContent, aStyleContext)) { // this frame may have a pseudo parent, use block frame type to trigger foreign GetParentFrame(aPresShell, aPresContext, aTableCreator, *aParentFrameIn, nsLayoutAtoms::blockFrame, aState, parentFrame, aIsPseudoParent); diff --git a/layout/html/style/src/nsCSSFrameConstructor.h b/layout/html/style/src/nsCSSFrameConstructor.h index 64d36d7b09a..c2a64c30137 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.h +++ b/layout/html/style/src/nsCSSFrameConstructor.h @@ -298,10 +298,11 @@ protected: nsIFrame*& aNewCellInnerFrame, PRBool& aIsPseudoParent); - PRBool MustGeneratePseudoParent(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIAtom* aTag, - nsIContent* aContent); + PRBool MustGeneratePseudoParent(nsIPresContext* aPresContext, + nsIFrame* aParentFrame, + nsIAtom* aTag, + nsIContent* aContent, + nsIStyleContext* aContext); nsresult ConstructTableForeignFrame(nsIPresShell* aPresShell, nsIPresContext* aPresContext,