mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
b=24343 r=karnaze@netscape.com Changes so we properly lay out after changing
the font using the pref UI. Block and table code changed to handle eReflowReason_StyleChange
This commit is contained in:
parent
b7899506e9
commit
4f7d1e3f2a
@ -1649,9 +1649,8 @@ PresShell::StyleChangeReflow()
|
||||
nsresult rv=CreateRenderingContext(rootFrame, &rcx);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// XXX We should be using eReflowReason_StyleChange
|
||||
nsHTMLReflowState reflowState(mPresContext, rootFrame,
|
||||
eReflowReason_Resize, rcx, maxSize);
|
||||
eReflowReason_StyleChange, rcx, maxSize);
|
||||
nsIView* view;
|
||||
|
||||
rootFrame->WillReflow(mPresContext);
|
||||
|
@ -1553,6 +1553,10 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
}
|
||||
break;
|
||||
|
||||
case eReflowReason_StyleChange:
|
||||
rv = PrepareStyleChangedReflow(state);
|
||||
break;
|
||||
|
||||
case eReflowReason_Resize:
|
||||
default:
|
||||
#ifdef NOISY_REFLOW_REASON
|
||||
|
@ -1553,6 +1553,10 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
}
|
||||
break;
|
||||
|
||||
case eReflowReason_StyleChange:
|
||||
rv = PrepareStyleChangedReflow(state);
|
||||
break;
|
||||
|
||||
case eReflowReason_Resize:
|
||||
default:
|
||||
#ifdef NOISY_REFLOW_REASON
|
||||
|
@ -1553,6 +1553,10 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
}
|
||||
break;
|
||||
|
||||
case eReflowReason_StyleChange:
|
||||
rv = PrepareStyleChangedReflow(state);
|
||||
break;
|
||||
|
||||
case eReflowReason_Resize:
|
||||
default:
|
||||
#ifdef NOISY_REFLOW_REASON
|
||||
|
@ -561,9 +561,11 @@ ViewportFrame::Reflow(nsIPresContext* aPresContext,
|
||||
aDesiredSize.descent = 0;
|
||||
}
|
||||
|
||||
// If this is a resize reflow or the initial reflow, then do a repaint
|
||||
// If this is an initial reflow, resize reflow, or style change reflow
|
||||
// then do a repaint
|
||||
if ((eReflowReason_Initial == aReflowState.reason) ||
|
||||
(eReflowReason_Resize == aReflowState.reason)) {
|
||||
(eReflowReason_Resize == aReflowState.reason) ||
|
||||
(eReflowReason_StyleChange == aReflowState.reason)) {
|
||||
nsRect damageRect(0, 0, aDesiredSize.width, aDesiredSize.height);
|
||||
Invalidate(aPresContext, damageRect, PR_FALSE);
|
||||
}
|
||||
|
@ -1553,6 +1553,10 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
}
|
||||
break;
|
||||
|
||||
case eReflowReason_StyleChange:
|
||||
rv = PrepareStyleChangedReflow(state);
|
||||
break;
|
||||
|
||||
case eReflowReason_Resize:
|
||||
default:
|
||||
#ifdef NOISY_REFLOW_REASON
|
||||
|
@ -1553,6 +1553,10 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
}
|
||||
break;
|
||||
|
||||
case eReflowReason_StyleChange:
|
||||
rv = PrepareStyleChangedReflow(state);
|
||||
break;
|
||||
|
||||
case eReflowReason_Resize:
|
||||
default:
|
||||
#ifdef NOISY_REFLOW_REASON
|
||||
|
@ -1553,6 +1553,10 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
}
|
||||
break;
|
||||
|
||||
case eReflowReason_StyleChange:
|
||||
rv = PrepareStyleChangedReflow(state);
|
||||
break;
|
||||
|
||||
case eReflowReason_Resize:
|
||||
default:
|
||||
#ifdef NOISY_REFLOW_REASON
|
||||
|
@ -1649,9 +1649,8 @@ PresShell::StyleChangeReflow()
|
||||
nsresult rv=CreateRenderingContext(rootFrame, &rcx);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// XXX We should be using eReflowReason_StyleChange
|
||||
nsHTMLReflowState reflowState(mPresContext, rootFrame,
|
||||
eReflowReason_Resize, rcx, maxSize);
|
||||
eReflowReason_StyleChange, rcx, maxSize);
|
||||
nsIView* view;
|
||||
|
||||
rootFrame->WillReflow(mPresContext);
|
||||
|
@ -561,9 +561,11 @@ ViewportFrame::Reflow(nsIPresContext* aPresContext,
|
||||
aDesiredSize.descent = 0;
|
||||
}
|
||||
|
||||
// If this is a resize reflow or the initial reflow, then do a repaint
|
||||
// If this is an initial reflow, resize reflow, or style change reflow
|
||||
// then do a repaint
|
||||
if ((eReflowReason_Initial == aReflowState.reason) ||
|
||||
(eReflowReason_Resize == aReflowState.reason)) {
|
||||
(eReflowReason_Resize == aReflowState.reason) ||
|
||||
(eReflowReason_StyleChange == aReflowState.reason)) {
|
||||
nsRect damageRect(0, 0, aDesiredSize.width, aDesiredSize.height);
|
||||
Invalidate(aPresContext, damageRect, PR_FALSE);
|
||||
}
|
||||
|
@ -1531,14 +1531,21 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
|
||||
rv = IncrementalReflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
}
|
||||
|
||||
// If this is a style change reflow, then invalidate the pass 1 cache
|
||||
if (eReflowReason_StyleChange == aReflowState.reason) {
|
||||
InvalidateFirstPassCache();
|
||||
}
|
||||
|
||||
// NeedsReflow and IsFirstPassValid take into account reflow type = Initial_Reflow
|
||||
if (NeedsReflow(aReflowState)) {
|
||||
PRBool needsRecalc = PR_FALSE;
|
||||
if ((NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) ||
|
||||
(PR_FALSE==IsFirstPassValid())) {
|
||||
nsReflowReason reason = aReflowState.reason;
|
||||
if (eReflowReason_Initial != reason)
|
||||
if ((eReflowReason_Initial != reason) &&
|
||||
(eReflowReason_StyleChange != reason)) {
|
||||
reason = eReflowReason_Resize;
|
||||
}
|
||||
if (mBorderCollapser) {
|
||||
mBorderCollapser->ComputeVerticalBorders(aPresContext, 0, -1);
|
||||
}
|
||||
|
@ -1531,14 +1531,21 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
|
||||
rv = IncrementalReflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
}
|
||||
|
||||
// If this is a style change reflow, then invalidate the pass 1 cache
|
||||
if (eReflowReason_StyleChange == aReflowState.reason) {
|
||||
InvalidateFirstPassCache();
|
||||
}
|
||||
|
||||
// NeedsReflow and IsFirstPassValid take into account reflow type = Initial_Reflow
|
||||
if (NeedsReflow(aReflowState)) {
|
||||
PRBool needsRecalc = PR_FALSE;
|
||||
if ((NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) ||
|
||||
(PR_FALSE==IsFirstPassValid())) {
|
||||
nsReflowReason reason = aReflowState.reason;
|
||||
if (eReflowReason_Initial != reason)
|
||||
if ((eReflowReason_Initial != reason) &&
|
||||
(eReflowReason_StyleChange != reason)) {
|
||||
reason = eReflowReason_Resize;
|
||||
}
|
||||
if (mBorderCollapser) {
|
||||
mBorderCollapser->ComputeVerticalBorders(aPresContext, 0, -1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user