summaryrefslogtreecommitdiffstats
path: root/layout/generic/nsTextFrame.cpp
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/generic/nsTextFrame.cpp
parent15acac52b1f92410f9c0e46737dd5e8413eb6c46 (diff)
downloadUXP-8e18743ab871bed1e1858ed2714a81f017433a2d.tar
UXP-8e18743ab871bed1e1858ed2714a81f017433a2d.tar.gz
UXP-8e18743ab871bed1e1858ed2714a81f017433a2d.tar.lz
UXP-8e18743ab871bed1e1858ed2714a81f017433a2d.tar.xz
UXP-8e18743ab871bed1e1858ed2714a81f017433a2d.zip
Issue #1665 - Take overflow-wrap into account when calculating min-content intrinsic size.
Diffstat (limited to 'layout/generic/nsTextFrame.cpp')
-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 ec1034204..9cf152873 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) {