Implement overflow-wrap: anywhere.
parent
54c5407dc7
commit
7db19361b4
|
@ -7857,6 +7857,7 @@ exports.CSS_PROPERTIES = {
|
||||||
],
|
],
|
||||||
"supports": [],
|
"supports": [],
|
||||||
"values": [
|
"values": [
|
||||||
|
"anywhere",
|
||||||
"break-word",
|
"break-word",
|
||||||
"inherit",
|
"inherit",
|
||||||
"initial",
|
"initial",
|
||||||
|
@ -9317,6 +9318,7 @@ exports.CSS_PROPERTIES = {
|
||||||
],
|
],
|
||||||
"supports": [],
|
"supports": [],
|
||||||
"values": [
|
"values": [
|
||||||
|
"anywhere",
|
||||||
"break-word",
|
"break-word",
|
||||||
"inherit",
|
"inherit",
|
||||||
"initial",
|
"initial",
|
||||||
|
|
|
@ -8244,8 +8244,9 @@ nsTextFrame::AddInlineMinISizeForFlow(nsRenderingContext *aRenderingContext,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If overflow-wrap is break-word, we can wrap everywhere.
|
// If overflow-wrap is 'anywhere', we can wrap everywhere.
|
||||||
if (textStyle->WordCanWrap(this)) {
|
if (textStyle->mOverflowWrap == NS_STYLE_OVERFLOWWRAP_ANYWHERE &&
|
||||||
|
textStyle->WordCanWrap(this)) {
|
||||||
aData->OptionallyBreak();
|
aData->OptionallyBreak();
|
||||||
aData->mCurrentLine +=
|
aData->mCurrentLine +=
|
||||||
textRun->GetMinAdvanceWidth(Range(start, flowEndInTextRun));
|
textRun->GetMinAdvanceWidth(Range(start, flowEndInTextRun));
|
||||||
|
|
|
@ -144,6 +144,7 @@ CSS_KEY(alternate, alternate)
|
||||||
CSS_KEY(alternate-reverse, alternate_reverse)
|
CSS_KEY(alternate-reverse, alternate_reverse)
|
||||||
CSS_KEY(always, always)
|
CSS_KEY(always, always)
|
||||||
CSS_KEY(annotation, annotation)
|
CSS_KEY(annotation, annotation)
|
||||||
|
CSS_KEY(anywhere, anywhere)
|
||||||
CSS_KEY(appworkspace, appworkspace)
|
CSS_KEY(appworkspace, appworkspace)
|
||||||
CSS_KEY(auto, auto)
|
CSS_KEY(auto, auto)
|
||||||
CSS_KEY(auto-fill, auto_fill)
|
CSS_KEY(auto-fill, auto_fill)
|
||||||
|
|
|
@ -2284,6 +2284,7 @@ const KTableEntry nsCSSProps::kWordBreakKTable[] = {
|
||||||
const KTableEntry nsCSSProps::kOverflowWrapKTable[] = {
|
const KTableEntry nsCSSProps::kOverflowWrapKTable[] = {
|
||||||
{ eCSSKeyword_normal, NS_STYLE_OVERFLOWWRAP_NORMAL },
|
{ eCSSKeyword_normal, NS_STYLE_OVERFLOWWRAP_NORMAL },
|
||||||
{ eCSSKeyword_break_word, NS_STYLE_OVERFLOWWRAP_BREAK_WORD },
|
{ eCSSKeyword_break_word, NS_STYLE_OVERFLOWWRAP_BREAK_WORD },
|
||||||
|
{ eCSSKeyword_anywhere, NS_STYLE_OVERFLOWWRAP_ANYWHERE },
|
||||||
{ eCSSKeyword_UNKNOWN, -1 }
|
{ eCSSKeyword_UNKNOWN, -1 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -997,6 +997,7 @@ enum class StyleDisplay : uint8_t {
|
||||||
// See nsStyleText
|
// See nsStyleText
|
||||||
#define NS_STYLE_OVERFLOWWRAP_NORMAL 0
|
#define NS_STYLE_OVERFLOWWRAP_NORMAL 0
|
||||||
#define NS_STYLE_OVERFLOWWRAP_BREAK_WORD 1
|
#define NS_STYLE_OVERFLOWWRAP_BREAK_WORD 1
|
||||||
|
#define NS_STYLE_OVERFLOWWRAP_ANYWHERE 2
|
||||||
|
|
||||||
// See nsStyleText
|
// See nsStyleText
|
||||||
#define NS_STYLE_HYPHENS_NONE 0
|
#define NS_STYLE_HYPHENS_NONE 0
|
||||||
|
|
|
@ -2134,8 +2134,11 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WordCanWrapStyle() const {
|
bool WordCanWrapStyle() const {
|
||||||
return WhiteSpaceCanWrapStyle() &&
|
if (!WhiteSpaceCanWrapStyle()) {
|
||||||
mOverflowWrap == NS_STYLE_OVERFLOWWRAP_BREAK_WORD;
|
return false;
|
||||||
|
}
|
||||||
|
return (mOverflowWrap == NS_STYLE_OVERFLOWWRAP_BREAK_WORD ||
|
||||||
|
mOverflowWrap == NS_STYLE_OVERFLOWWRAP_ANYWHERE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HasTextEmphasis() const {
|
bool HasTextEmphasis() const {
|
||||||
|
|
Loading…
Reference in New Issue