summaryrefslogtreecommitdiff
path: root/layout
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-10-03 12:45:27 +0000
committerMoonchild <moonchild@palemoon.org>2020-10-03 12:45:27 +0000
commit8e18743ab871bed1e1858ed2714a81f017433a2d (patch)
treea87331b71a4b5abd85ea07f53d4043c1f2b0cb7a /layout
parent15acac52b1f92410f9c0e46737dd5e8413eb6c46 (diff)
downloaduxp-8e18743ab871bed1e1858ed2714a81f017433a2d.tar.gz
Issue #1665 - Take overflow-wrap into account when calculating min-content intrinsic size.
Diffstat (limited to 'layout')
-rw-r--r--layout/generic/nsTextFrame.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp
index ec1034204c..9cf152873f 100644
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -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) {