summaryrefslogtreecommitdiffstats
path: root/layout/generic
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-10-03 12:45:27 +0000
committerMoonchild <moonchild@palemoon.org>2020-10-06 09:31:40 +0000
commitabf1d5a099ea8c3fbd6912ff7b199791994cb932 (patch)
treecba4982ed3a2bc5edf4e4b7a83540c3319480bf0 /layout/generic
parentb7dac18c0e70c6f0e825ce2a7d44fdaa2cc2ad70 (diff)
downloadUXP-abf1d5a099ea8c3fbd6912ff7b199791994cb932.tar
UXP-abf1d5a099ea8c3fbd6912ff7b199791994cb932.tar.gz
UXP-abf1d5a099ea8c3fbd6912ff7b199791994cb932.tar.lz
UXP-abf1d5a099ea8c3fbd6912ff7b199791994cb932.tar.xz
UXP-abf1d5a099ea8c3fbd6912ff7b199791994cb932.zip
Issue #1665 - Take overflow-wrap into account when calculating min-content intrinsic size.
Diffstat (limited to 'layout/generic')
-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 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<bool,BIG_TEXT_NODE_SIZE> hyphBuffer;
bool *hyphBreakBefore = nullptr;
if (hyphenating) {