From 71c396f2c69c19a996073a930e8242a679850060 Mon Sep 17 00:00:00 2001 From: "buster%netscape.com" Date: Sat, 14 Oct 2000 05:25:41 +0000 Subject: [PATCH] bug 53974 r=attinasi a=waterson git-svn-id: svn://10.0.0.236/trunk@81209 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 31 ++++++++++--------- .../html/style/src/nsCSSFrameConstructor.cpp | 31 ++++++++++--------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index eec1e0eb14f..db2dc325e5f 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -5080,15 +5080,15 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresShell* aPresShell, // If we succeeded in creating a frame then initialize it, process its // children (if requested), and set the initial child list if (NS_SUCCEEDED(rv) && (nsnull != newFrame)) { - // XXX: may want to special case this for HR's if we don't want - // to advertise full support of :before and :after for release 1 // first, create it's "before" generated content - nsIFrame* generatedFrame; - if (CreateGeneratedContentFrame(aPresShell, aPresContext, aState, aParentFrame, aContent, - aStyleContext, nsCSSAtoms::beforePseudo, - PR_FALSE, &generatedFrame)) { - // Add the generated frame to the child list - aFrameItems.AddChild(generatedFrame); + if (nsLayoutAtoms::textTagName != aTag) { // see bug 53974. text nodes never match + nsIFrame* generatedFrame; + if (CreateGeneratedContentFrame(aPresShell, aPresContext, aState, aParentFrame, aContent, + aStyleContext, nsCSSAtoms::beforePseudo, + PR_FALSE, &generatedFrame)) { + // Add the generated frame to the child list + aFrameItems.AddChild(generatedFrame); + } } // If the frame is a replaced element, then set the frame state bit @@ -5220,11 +5220,14 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresShell* aPresShell, } // finally, create it's "after" generated content - if (CreateGeneratedContentFrame(aPresShell, aPresContext, aState, aParentFrame, aContent, - aStyleContext, nsCSSAtoms::afterPseudo, - PR_FALSE, &generatedFrame)) { - // Add the generated frame to the child list - aFrameItems.AddChild(generatedFrame); + if (nsLayoutAtoms::textTagName != aTag) { // see bug 53974. text nodes never match + nsIFrame* generatedFrame; + if (CreateGeneratedContentFrame(aPresShell, aPresContext, aState, aParentFrame, aContent, + aStyleContext, nsCSSAtoms::afterPseudo, + PR_FALSE, &generatedFrame)) { + // Add the generated frame to the child list + aFrameItems.AddChild(generatedFrame); + } } } @@ -10640,7 +10643,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresShell, // XXX remove this code and the above checks. We don't want to replicate // the caption (that is what the thead is for). This code is not executed // anyway, because the caption was put in a different child list. - nsIContent* caption; + nsIContent* caption; nsIStyleContext* captionStyle; const nsStyleDisplay* display; diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index eec1e0eb14f..db2dc325e5f 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -5080,15 +5080,15 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresShell* aPresShell, // If we succeeded in creating a frame then initialize it, process its // children (if requested), and set the initial child list if (NS_SUCCEEDED(rv) && (nsnull != newFrame)) { - // XXX: may want to special case this for HR's if we don't want - // to advertise full support of :before and :after for release 1 // first, create it's "before" generated content - nsIFrame* generatedFrame; - if (CreateGeneratedContentFrame(aPresShell, aPresContext, aState, aParentFrame, aContent, - aStyleContext, nsCSSAtoms::beforePseudo, - PR_FALSE, &generatedFrame)) { - // Add the generated frame to the child list - aFrameItems.AddChild(generatedFrame); + if (nsLayoutAtoms::textTagName != aTag) { // see bug 53974. text nodes never match + nsIFrame* generatedFrame; + if (CreateGeneratedContentFrame(aPresShell, aPresContext, aState, aParentFrame, aContent, + aStyleContext, nsCSSAtoms::beforePseudo, + PR_FALSE, &generatedFrame)) { + // Add the generated frame to the child list + aFrameItems.AddChild(generatedFrame); + } } // If the frame is a replaced element, then set the frame state bit @@ -5220,11 +5220,14 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresShell* aPresShell, } // finally, create it's "after" generated content - if (CreateGeneratedContentFrame(aPresShell, aPresContext, aState, aParentFrame, aContent, - aStyleContext, nsCSSAtoms::afterPseudo, - PR_FALSE, &generatedFrame)) { - // Add the generated frame to the child list - aFrameItems.AddChild(generatedFrame); + if (nsLayoutAtoms::textTagName != aTag) { // see bug 53974. text nodes never match + nsIFrame* generatedFrame; + if (CreateGeneratedContentFrame(aPresShell, aPresContext, aState, aParentFrame, aContent, + aStyleContext, nsCSSAtoms::afterPseudo, + PR_FALSE, &generatedFrame)) { + // Add the generated frame to the child list + aFrameItems.AddChild(generatedFrame); + } } } @@ -10640,7 +10643,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresShell, // XXX remove this code and the above checks. We don't want to replicate // the caption (that is what the thead is for). This code is not executed // anyway, because the caption was put in a different child list. - nsIContent* caption; + nsIContent* caption; nsIStyleContext* captionStyle; const nsStyleDisplay* display;