mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Issue #1666 - Implement overflow-wrap: anywhere
This aligns with the current spec regarding overflow-wrap: break-word and overflow-wrap: anywhere in if it affects intrinsic sized due to considering soft-wrap opportunities or not. See CSS Text Module Level 3, Editor’s Draft, 1 October 2020, Section 5.5
This commit is contained in:
parent
6f8365a077
commit
d602cb077b
5 changed files with 11 additions and 4 deletions
|
|
@ -8243,8 +8243,9 @@ nsTextFrame::AddInlineMinISizeForFlow(nsRenderingContext *aRenderingContext,
|
|||
return;
|
||||
}
|
||||
|
||||
// If overflow-wrap is break-word, we can wrap everywhere.
|
||||
if (textStyle->WordCanWrap(this)) {
|
||||
// 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));
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -2133,8 +2133,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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue