From abf1d5a099ea8c3fbd6912ff7b199791994cb932 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 3 Oct 2020 12:45:27 +0000 Subject: Issue #1665 - Take overflow-wrap into account when calculating min-content intrinsic size. --- layout/generic/nsTextFrame.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'layout/generic') diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 4bc542626..a9ed168fb 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -8245,6 +8245,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 hyphBuffer; bool *hyphBreakBefore = nullptr; if (hyphenating) { -- cgit v1.2.3