summaryrefslogtreecommitdiffstats
path: root/layout
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-10-06 09:32:46 +0000
committerMoonchild <moonchild@palemoon.org>2020-10-06 09:32:46 +0000
commita98d06380fe706e3b1b602411c597b9882516b3e (patch)
tree60452c5f39b8dc60a8e97454d4103baf2cd194ae /layout
parent63a0006985036b062eed7e9e83324581d8ab247c (diff)
parent1e8d07cac205a5db3d7d416d7f414a213fd892ff (diff)
downloadUXP-a98d06380fe706e3b1b602411c597b9882516b3e.tar
UXP-a98d06380fe706e3b1b602411c597b9882516b3e.tar.gz
UXP-a98d06380fe706e3b1b602411c597b9882516b3e.tar.lz
UXP-a98d06380fe706e3b1b602411c597b9882516b3e.tar.xz
UXP-a98d06380fe706e3b1b602411c597b9882516b3e.zip
Merge branch 'redwood' into release
Diffstat (limited to 'layout')
-rw-r--r--layout/generic/nsTextFrame.cpp11
-rw-r--r--layout/style/nsCSSKeywordList.h1
-rw-r--r--layout/style/nsCSSProps.cpp1
-rw-r--r--layout/style/nsStyleConsts.h1
-rw-r--r--layout/style/nsStyleStruct.h7
5 files changed, 19 insertions, 2 deletions
diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp
index 4bc542626..a47b87e38 100644
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -8245,6 +8245,17 @@ nsTextFrame::AddInlineMinISizeForFlow(nsRenderingContext *aRenderingContext,
return;
}
+ // If overflow-wrap is 'anywhere', we can wrap everywhere.
+ if (textStyle->mOverflowWrap == NS_STYLE_OVERFLOWWRAP_ANYWHERE &&
+ 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) {
diff --git a/layout/style/nsCSSKeywordList.h b/layout/style/nsCSSKeywordList.h
index 9045da9ff..86ba59142 100644
--- a/layout/style/nsCSSKeywordList.h
+++ b/layout/style/nsCSSKeywordList.h
@@ -144,6 +144,7 @@ CSS_KEY(alternate, alternate)
CSS_KEY(alternate-reverse, alternate_reverse)
CSS_KEY(always, always)
CSS_KEY(annotation, annotation)
+CSS_KEY(anywhere, anywhere)
CSS_KEY(appworkspace, appworkspace)
CSS_KEY(auto, auto)
CSS_KEY(auto-fill, auto_fill)
diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp
index 24c97cf33..e0cda2488 100644
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -2284,6 +2284,7 @@ const KTableEntry nsCSSProps::kWordBreakKTable[] = {
const KTableEntry nsCSSProps::kOverflowWrapKTable[] = {
{ eCSSKeyword_normal, NS_STYLE_OVERFLOWWRAP_NORMAL },
{ eCSSKeyword_break_word, NS_STYLE_OVERFLOWWRAP_BREAK_WORD },
+ { eCSSKeyword_anywhere, NS_STYLE_OVERFLOWWRAP_ANYWHERE },
{ eCSSKeyword_UNKNOWN, -1 }
};
diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h
index f54387aa8..e6a0cc65a 100644
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -997,6 +997,7 @@ enum class StyleDisplay : uint8_t {
// See nsStyleText
#define NS_STYLE_OVERFLOWWRAP_NORMAL 0
#define NS_STYLE_OVERFLOWWRAP_BREAK_WORD 1
+#define NS_STYLE_OVERFLOWWRAP_ANYWHERE 2
// See nsStyleText
#define NS_STYLE_HYPHENS_NONE 0
diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h
index f49cdc43e..cca7bb8d4 100644
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -2134,8 +2134,11 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText
}
bool WordCanWrapStyle() const {
- return WhiteSpaceCanWrapStyle() &&
- mOverflowWrap == NS_STYLE_OVERFLOWWRAP_BREAK_WORD;
+ if (!WhiteSpaceCanWrapStyle()) {
+ return false;
+ }
+ return (mOverflowWrap == NS_STYLE_OVERFLOWWRAP_BREAK_WORD ||
+ mOverflowWrap == NS_STYLE_OVERFLOWWRAP_ANYWHERE);
}
bool HasTextEmphasis() const {