Issue #1665 - Take overflow-wrap into account when calculating min-content intrinsic size.

This commit is contained in:
Moonchild 2020-10-03 12:45:27 +00:00 committed by roytam1
commit 6f8365a077
3 changed files with 44 additions and 0 deletions

View file

@ -8243,6 +8243,16 @@ nsTextFrame::AddInlineMinISizeForFlow(nsRenderingContext *aRenderingContext,
return;
}
// If overflow-wrap is break-word, we can wrap everywhere.
if (textStyle->WordCanWrap(this)) {
aData->OptionallyBreak();
aData->mCurrentLine +=
textRun->GetMinAdvanceWidth(Range(start, flowEndInTextRun));
aData->mTrailingWhitespace = 0;
aData->OptionallyBreak();
return;
}
AutoTArray<bool,BIG_TEXT_NODE_SIZE> hyphBuffer;
bool *hyphBreakBefore = nullptr;
if (hyphenating) {