From 0578533a2b4d7ed1d5438b697dcfe3080913335d Mon Sep 17 00:00:00 2001 From: "buster%netscape.com" Date: Mon, 11 Sep 2000 21:25:43 +0000 Subject: [PATCH] forgot to check this in as part of my last checkin. bug 18754 r=karnaze git-svn-id: svn://10.0.0.236/trunk@78769 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 23 ++++++++++++++++++- .../html/style/src/nsCSSFrameConstructor.cpp | 23 ++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 260d5f3c2de..e6deca7c92d 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -4884,6 +4884,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresShell* aPresShell, rv = NS_NewImageFrame(aPresShell, &newFrame); } else if (nsHTMLAtoms::hr == aTag) { + isReplaced = PR_TRUE; if (!aState.mPseudoFrames.IsEmpty()) { // process pending pseudo frames ProcessPseudoFrames(aPresContext, aState.mPseudoFrames, aFrameItems); } @@ -5036,6 +5037,17 @@ 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, newFrame, 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 if (isReplaced) { nsFrameState state; @@ -5163,6 +5175,15 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresShell* aPresShell, // the placeholder frame aState.mFrameManager->SetPrimaryFrameFor(aContent, newFrame); } + + // finally, create it's "after" generated content + if (CreateGeneratedContentFrame(aPresShell, aPresContext, aState, newFrame, aContent, + aStyleContext, nsCSSAtoms::afterPseudo, + PR_FALSE, &generatedFrame)) { + // Add the generated frame to the child list + aFrameItems.AddChild(generatedFrame); + } + } return rv; @@ -12400,7 +12421,7 @@ nsCSSFrameConstructor::AreAllKidsInline(nsIFrame* aFrameList) } nsresult -nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, +nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, nsIPresContext* aPresContext, nsFrameConstructorState& aState, const nsStyleDisplay* aDisplay, diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index 260d5f3c2de..e6deca7c92d 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -4884,6 +4884,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresShell* aPresShell, rv = NS_NewImageFrame(aPresShell, &newFrame); } else if (nsHTMLAtoms::hr == aTag) { + isReplaced = PR_TRUE; if (!aState.mPseudoFrames.IsEmpty()) { // process pending pseudo frames ProcessPseudoFrames(aPresContext, aState.mPseudoFrames, aFrameItems); } @@ -5036,6 +5037,17 @@ 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, newFrame, 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 if (isReplaced) { nsFrameState state; @@ -5163,6 +5175,15 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresShell* aPresShell, // the placeholder frame aState.mFrameManager->SetPrimaryFrameFor(aContent, newFrame); } + + // finally, create it's "after" generated content + if (CreateGeneratedContentFrame(aPresShell, aPresContext, aState, newFrame, aContent, + aStyleContext, nsCSSAtoms::afterPseudo, + PR_FALSE, &generatedFrame)) { + // Add the generated frame to the child list + aFrameItems.AddChild(generatedFrame); + } + } return rv; @@ -12400,7 +12421,7 @@ nsCSSFrameConstructor::AreAllKidsInline(nsIFrame* aFrameList) } nsresult -nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, +nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, nsIPresContext* aPresContext, nsFrameConstructorState& aState, const nsStyleDisplay* aDisplay,