Bug 1260031 - Not force break before a block when calculating intrinsic width if the current line is empty and the block cannot intersect floats. r=dbaron
MozReview-Commit-ID: 9rNUDK5t5jg
This commit is contained in:
@@ -8347,6 +8347,7 @@ nsTextFrame::AddInlinePrefISizeForFlow(nsRenderingContext *aRenderingContext,
|
||||
if (StyleContext()->IsTextCombined()) {
|
||||
aData->mCurrentLine += provider.GetFontMetrics()->EmHeight();
|
||||
aData->mTrailingWhitespace = 0;
|
||||
aData->mLineIsEmpty = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8384,6 +8385,7 @@ nsTextFrame::AddInlinePrefISizeForFlow(nsRenderingContext *aRenderingContext,
|
||||
textRun->GetAdvanceWidth(Range(lineStart, i), &provider));
|
||||
width = std::max(0, width);
|
||||
aData->mCurrentLine = NSCoordSaturatingAdd(aData->mCurrentLine, width);
|
||||
aData->mLineIsEmpty = false;
|
||||
|
||||
if (collapseWhitespace) {
|
||||
uint32_t trimStart = GetEndOfTrimmedText(frag, textStyle, lineStart, i, &iter);
|
||||
@@ -8410,6 +8412,7 @@ nsTextFrame::AddInlinePrefISizeForFlow(nsRenderingContext *aRenderingContext,
|
||||
AdvanceToNextTab(aData->mCurrentLine, this,
|
||||
textRun, &tabWidth);
|
||||
aData->mCurrentLine = nscoord(afterTab + spacing.mAfter);
|
||||
aData->mLineIsEmpty = false;
|
||||
lineStart = i + 1;
|
||||
} else if (preformattedNewline) {
|
||||
aData->ForceBreak();
|
||||
|
||||
Reference in New Issue
Block a user