mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 03:49:42 +00:00
Optimized Reflow() some more. In the case where we're not measuring text but
we need to peek ahead and so we need to know the length of the last word, if there's only one word in the text run then we can avoid measuring
This commit is contained in:
parent
2c5c80b40d
commit
f004ab4be8
@ -2611,7 +2611,11 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
|
||||
if (!measureText) {
|
||||
// We didn't measure any text so we don't know lastWordWidth.
|
||||
// We have to compute it now
|
||||
if (ts.mSmallCaps) {
|
||||
if (prevOffset == startingOffset) {
|
||||
// There's only one word, so we don't have to measure after all
|
||||
lastWordWidth = x;
|
||||
}
|
||||
else if (ts.mSmallCaps) {
|
||||
MeasureSmallCapsText(aReflowState, ts, tx.GetTextAt(prevOffset),
|
||||
lastWordLen, &lastWordWidth);
|
||||
}
|
||||
|
@ -2611,7 +2611,11 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
|
||||
if (!measureText) {
|
||||
// We didn't measure any text so we don't know lastWordWidth.
|
||||
// We have to compute it now
|
||||
if (ts.mSmallCaps) {
|
||||
if (prevOffset == startingOffset) {
|
||||
// There's only one word, so we don't have to measure after all
|
||||
lastWordWidth = x;
|
||||
}
|
||||
else if (ts.mSmallCaps) {
|
||||
MeasureSmallCapsText(aReflowState, ts, tx.GetTextAt(prevOffset),
|
||||
lastWordLen, &lastWordWidth);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user