fix bug 10007 - when style change needs to regenerate frame do not set new context into frame
approved chofman
This commit is contained in:
peterl%netscape.com 1999-09-25 05:00:41 +00:00
Родитель e6538cbdd7
Коммит d1882ffe5e
2 изменённых файлов: 16 добавлений и 8 удалений

Просмотреть файл

@ -590,10 +590,10 @@ DumpContext(nsIFrame* aFrame, nsIStyleContext* aContext)
nsAutoString name;
aFrame->GetFrameName(name);
fputs(name, stdout);
fprintf(stdout, " (%08x)", aFrame);
fprintf(stdout, " (%p)", aFrame);
}
if (aContext) {
fprintf(stdout, " style: %08x ", aContext);
fprintf(stdout, " style: %p ", aContext);
nsIAtom* pseudoTag;
aContext->GetPseudoType(pseudoTag);
@ -893,7 +893,9 @@ FrameManager::ReResolveStyleContext(nsIPresContext& aPresContext,
if (newContext) {
if (newContext != oldContext) {
aMinChange = CaptureChange(oldContext, newContext, aFrame, aChangeList, aMinChange);
aFrame->SetStyleContext(&aPresContext, newContext);
if (aMinChange < NS_STYLE_HINT_FRAMECHANGE) { // if frame gets regenerated, let it keep old context
aFrame->SetStyleContext(&aPresContext, newContext);
}
}
NS_RELEASE(oldContext);
}
@ -919,7 +921,9 @@ FrameManager::ReResolveStyleContext(nsIPresContext& aPresContext,
if (oldExtraContext != newExtraContext) {
aMinChange = CaptureChange(oldExtraContext, newExtraContext, aFrame,
aChangeList, aMinChange);
aFrame->SetAdditionalStyleContext(contextIndex, newExtraContext);
if (aMinChange < NS_STYLE_HINT_FRAMECHANGE) {
aFrame->SetAdditionalStyleContext(contextIndex, newExtraContext);
}
}
NS_RELEASE(newExtraContext);
}

Просмотреть файл

@ -590,10 +590,10 @@ DumpContext(nsIFrame* aFrame, nsIStyleContext* aContext)
nsAutoString name;
aFrame->GetFrameName(name);
fputs(name, stdout);
fprintf(stdout, " (%08x)", aFrame);
fprintf(stdout, " (%p)", aFrame);
}
if (aContext) {
fprintf(stdout, " style: %08x ", aContext);
fprintf(stdout, " style: %p ", aContext);
nsIAtom* pseudoTag;
aContext->GetPseudoType(pseudoTag);
@ -893,7 +893,9 @@ FrameManager::ReResolveStyleContext(nsIPresContext& aPresContext,
if (newContext) {
if (newContext != oldContext) {
aMinChange = CaptureChange(oldContext, newContext, aFrame, aChangeList, aMinChange);
aFrame->SetStyleContext(&aPresContext, newContext);
if (aMinChange < NS_STYLE_HINT_FRAMECHANGE) { // if frame gets regenerated, let it keep old context
aFrame->SetStyleContext(&aPresContext, newContext);
}
}
NS_RELEASE(oldContext);
}
@ -919,7 +921,9 @@ FrameManager::ReResolveStyleContext(nsIPresContext& aPresContext,
if (oldExtraContext != newExtraContext) {
aMinChange = CaptureChange(oldExtraContext, newExtraContext, aFrame,
aChangeList, aMinChange);
aFrame->SetAdditionalStyleContext(contextIndex, newExtraContext);
if (aMinChange < NS_STYLE_HINT_FRAMECHANGE) {
aFrame->SetAdditionalStyleContext(contextIndex, newExtraContext);
}
}
NS_RELEASE(newExtraContext);
}