Use correct content when creating first-letter and related frames so that style resolution works beyond the first time

git-svn-id: svn://10.0.0.236/trunk@29629 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com 1999-04-28 00:55:11 +00:00
parent 89583b2234
commit 89df2f564f
2 changed files with 12 additions and 10 deletions

View File

@ -5726,14 +5726,12 @@ nsCSSFrameConstructor::WrapTextFrame(nsIPresContext* aPresContext,
}
nsIStyleContext* sc = GetFirstLetterStyle(aPresContext, correctContent,
parentStyleContext);
if (correctContent != aContent) {
NS_RELEASE(correctContent);
}
if (sc) {
const nsStyleDisplay* display = (const nsStyleDisplay*)
sc->GetStyleData(eStyleStruct_Display);
if (display->IsFloating()) {
CreateFloatingFirstLetterFrame(aPresContext, aTextFrame, aContent,
CreateFloatingFirstLetterFrame(aPresContext, aTextFrame,
correctContent,
aChildContent, aParentFrame,
aFrameItems, aFloatingItems, sc);
}
@ -5742,7 +5740,7 @@ nsCSSFrameConstructor::WrapTextFrame(nsIPresContext* aPresContext,
nsresult rv = NS_NewFirstLetterFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
// Initialize the first-letter-frame.
rv = newFrame->Init(*aPresContext, aContent, aParentFrame, sc,
rv = newFrame->Init(*aPresContext, correctContent, aParentFrame, sc,
nsnull);
newFrame->SetInitialChildList(*aPresContext, nsnull, aTextFrame);
aTextFrame->SetParent(newFrame);
@ -5755,6 +5753,9 @@ nsCSSFrameConstructor::WrapTextFrame(nsIPresContext* aPresContext,
}
NS_RELEASE(sc);
}
if (correctContent != aContent) {
NS_RELEASE(correctContent);
}
NS_RELEASE(parentStyleContext);
}
return NS_OK;

View File

@ -5726,14 +5726,12 @@ nsCSSFrameConstructor::WrapTextFrame(nsIPresContext* aPresContext,
}
nsIStyleContext* sc = GetFirstLetterStyle(aPresContext, correctContent,
parentStyleContext);
if (correctContent != aContent) {
NS_RELEASE(correctContent);
}
if (sc) {
const nsStyleDisplay* display = (const nsStyleDisplay*)
sc->GetStyleData(eStyleStruct_Display);
if (display->IsFloating()) {
CreateFloatingFirstLetterFrame(aPresContext, aTextFrame, aContent,
CreateFloatingFirstLetterFrame(aPresContext, aTextFrame,
correctContent,
aChildContent, aParentFrame,
aFrameItems, aFloatingItems, sc);
}
@ -5742,7 +5740,7 @@ nsCSSFrameConstructor::WrapTextFrame(nsIPresContext* aPresContext,
nsresult rv = NS_NewFirstLetterFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
// Initialize the first-letter-frame.
rv = newFrame->Init(*aPresContext, aContent, aParentFrame, sc,
rv = newFrame->Init(*aPresContext, correctContent, aParentFrame, sc,
nsnull);
newFrame->SetInitialChildList(*aPresContext, nsnull, aTextFrame);
aTextFrame->SetParent(newFrame);
@ -5755,6 +5753,9 @@ nsCSSFrameConstructor::WrapTextFrame(nsIPresContext* aPresContext,
}
NS_RELEASE(sc);
}
if (correctContent != aContent) {
NS_RELEASE(correctContent);
}
NS_RELEASE(parentStyleContext);
}
return NS_OK;