diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 1d2a6c006af..d835c6f8467 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -243,6 +243,8 @@ public: nsBlockBandData mCurrentBand; nsRect mAvailSpaceRect; + + nscoord mMinLineHeight; }; // XXX This is vile. Make it go away @@ -852,11 +854,19 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, } lineLayout->Init(&state); - // Prepare inline-reflow engine + // Prepare inline-reflow engine. Note that we will almost always use + // the inline reflow engine so this setup is not wasted work: + // because most content has compressed white-space in it, we will + // use the inline reflow engine to get rid of it. nsInlineReflow inlineReflow(*lineLayout, state, this, PR_TRUE); state.mInlineReflow = &inlineReflow; lineLayout->PushInline(&inlineReflow); + // Compute the blocks minimum line-height the first time that its + // needed (which is now). + nscoord minLineHeight = state.CalcLineHeight(aPresContext, this); + inlineReflow.SetMinLineHeight(minLineHeight); + nsresult rv = NS_OK; nsIFrame* target; switch (state.reason) { diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index 1d2a6c006af..d835c6f8467 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -243,6 +243,8 @@ public: nsBlockBandData mCurrentBand; nsRect mAvailSpaceRect; + + nscoord mMinLineHeight; }; // XXX This is vile. Make it go away @@ -852,11 +854,19 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, } lineLayout->Init(&state); - // Prepare inline-reflow engine + // Prepare inline-reflow engine. Note that we will almost always use + // the inline reflow engine so this setup is not wasted work: + // because most content has compressed white-space in it, we will + // use the inline reflow engine to get rid of it. nsInlineReflow inlineReflow(*lineLayout, state, this, PR_TRUE); state.mInlineReflow = &inlineReflow; lineLayout->PushInline(&inlineReflow); + // Compute the blocks minimum line-height the first time that its + // needed (which is now). + nscoord minLineHeight = state.CalcLineHeight(aPresContext, this); + inlineReflow.SetMinLineHeight(minLineHeight); + nsresult rv = NS_OK; nsIFrame* target; switch (state.reason) { diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index 1d2a6c006af..d835c6f8467 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -243,6 +243,8 @@ public: nsBlockBandData mCurrentBand; nsRect mAvailSpaceRect; + + nscoord mMinLineHeight; }; // XXX This is vile. Make it go away @@ -852,11 +854,19 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, } lineLayout->Init(&state); - // Prepare inline-reflow engine + // Prepare inline-reflow engine. Note that we will almost always use + // the inline reflow engine so this setup is not wasted work: + // because most content has compressed white-space in it, we will + // use the inline reflow engine to get rid of it. nsInlineReflow inlineReflow(*lineLayout, state, this, PR_TRUE); state.mInlineReflow = &inlineReflow; lineLayout->PushInline(&inlineReflow); + // Compute the blocks minimum line-height the first time that its + // needed (which is now). + nscoord minLineHeight = state.CalcLineHeight(aPresContext, this); + inlineReflow.SetMinLineHeight(minLineHeight); + nsresult rv = NS_OK; nsIFrame* target; switch (state.reason) { diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 1d2a6c006af..d835c6f8467 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -243,6 +243,8 @@ public: nsBlockBandData mCurrentBand; nsRect mAvailSpaceRect; + + nscoord mMinLineHeight; }; // XXX This is vile. Make it go away @@ -852,11 +854,19 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, } lineLayout->Init(&state); - // Prepare inline-reflow engine + // Prepare inline-reflow engine. Note that we will almost always use + // the inline reflow engine so this setup is not wasted work: + // because most content has compressed white-space in it, we will + // use the inline reflow engine to get rid of it. nsInlineReflow inlineReflow(*lineLayout, state, this, PR_TRUE); state.mInlineReflow = &inlineReflow; lineLayout->PushInline(&inlineReflow); + // Compute the blocks minimum line-height the first time that its + // needed (which is now). + nscoord minLineHeight = state.CalcLineHeight(aPresContext, this); + inlineReflow.SetMinLineHeight(minLineHeight); + nsresult rv = NS_OK; nsIFrame* target; switch (state.reason) { diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index 1d2a6c006af..d835c6f8467 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -243,6 +243,8 @@ public: nsBlockBandData mCurrentBand; nsRect mAvailSpaceRect; + + nscoord mMinLineHeight; }; // XXX This is vile. Make it go away @@ -852,11 +854,19 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, } lineLayout->Init(&state); - // Prepare inline-reflow engine + // Prepare inline-reflow engine. Note that we will almost always use + // the inline reflow engine so this setup is not wasted work: + // because most content has compressed white-space in it, we will + // use the inline reflow engine to get rid of it. nsInlineReflow inlineReflow(*lineLayout, state, this, PR_TRUE); state.mInlineReflow = &inlineReflow; lineLayout->PushInline(&inlineReflow); + // Compute the blocks minimum line-height the first time that its + // needed (which is now). + nscoord minLineHeight = state.CalcLineHeight(aPresContext, this); + inlineReflow.SetMinLineHeight(minLineHeight); + nsresult rv = NS_OK; nsIFrame* target; switch (state.reason) { diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index 1d2a6c006af..d835c6f8467 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -243,6 +243,8 @@ public: nsBlockBandData mCurrentBand; nsRect mAvailSpaceRect; + + nscoord mMinLineHeight; }; // XXX This is vile. Make it go away @@ -852,11 +854,19 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, } lineLayout->Init(&state); - // Prepare inline-reflow engine + // Prepare inline-reflow engine. Note that we will almost always use + // the inline reflow engine so this setup is not wasted work: + // because most content has compressed white-space in it, we will + // use the inline reflow engine to get rid of it. nsInlineReflow inlineReflow(*lineLayout, state, this, PR_TRUE); state.mInlineReflow = &inlineReflow; lineLayout->PushInline(&inlineReflow); + // Compute the blocks minimum line-height the first time that its + // needed (which is now). + nscoord minLineHeight = state.CalcLineHeight(aPresContext, this); + inlineReflow.SetMinLineHeight(minLineHeight); + nsresult rv = NS_OK; nsIFrame* target; switch (state.reason) {