mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Parse and propagate text-wrap-mode
CSS property
This commit is contained in:
parent
ea30356fba
commit
50bdd2cb85
Notes:
github-actions[bot]
2025-05-29 10:06:06 +00:00
Author: https://github.com/Calme1709
Commit: 50bdd2cb85
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4832
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/gmta ✅
16 changed files with 333 additions and 183 deletions
|
@ -1180,6 +1180,12 @@ Vector<ShadowData> ComputedProperties::text_shadow(Layout::Node const& layout_no
|
|||
return shadow(PropertyID::TextShadow, layout_node);
|
||||
}
|
||||
|
||||
TextWrapMode ComputedProperties::text_wrap_mode() const
|
||||
{
|
||||
auto const& value = property(PropertyID::TextWrapMode);
|
||||
return keyword_to_text_wrap_mode(value.to_keyword()).release_value();
|
||||
}
|
||||
|
||||
BoxSizing ComputedProperties::box_sizing() const
|
||||
{
|
||||
auto const& value = property(PropertyID::BoxSizing);
|
||||
|
|
|
@ -111,6 +111,7 @@ public:
|
|||
TextDecorationStyle text_decoration_style() const;
|
||||
TextTransform text_transform() const;
|
||||
Vector<ShadowData> text_shadow(Layout::Node const&) const;
|
||||
TextWrapMode text_wrap_mode() const;
|
||||
ListStyleType list_style_type() const;
|
||||
ListStylePosition list_style_position() const;
|
||||
FlexDirection flex_direction() const;
|
||||
|
|
|
@ -115,6 +115,7 @@ public:
|
|||
static CSS::TextTransform text_transform() { return CSS::TextTransform::None; }
|
||||
static CSS::TextOverflow text_overflow() { return CSS::TextOverflow::Clip; }
|
||||
static CSS::LengthPercentage text_indent() { return CSS::Length::make_px(0); }
|
||||
static CSS::TextWrapMode text_wrap_mode() { return CSS::TextWrapMode::Wrap; }
|
||||
static CSS::Display display() { return CSS::Display { CSS::DisplayOutside::Inline, CSS::DisplayInside::Flow }; }
|
||||
static Color color() { return Color::Black; }
|
||||
static Color stop_color() { return Color::Black; }
|
||||
|
@ -415,6 +416,7 @@ public:
|
|||
CSS::TextAlign text_align() const { return m_inherited.text_align; }
|
||||
CSS::TextJustify text_justify() const { return m_inherited.text_justify; }
|
||||
CSS::LengthPercentage const& text_indent() const { return m_inherited.text_indent; }
|
||||
CSS::TextWrapMode text_wrap_mode() const { return m_inherited.text_wrap_mode; }
|
||||
Vector<CSS::TextDecorationLine> const& text_decoration_line() const { return m_noninherited.text_decoration_line; }
|
||||
CSS::LengthPercentage const& text_decoration_thickness() const { return m_noninherited.text_decoration_thickness; }
|
||||
CSS::TextDecorationStyle text_decoration_style() const { return m_noninherited.text_decoration_style; }
|
||||
|
@ -617,6 +619,7 @@ protected:
|
|||
CSS::TextJustify text_justify { InitialValues::text_justify() };
|
||||
CSS::TextTransform text_transform { InitialValues::text_transform() };
|
||||
CSS::LengthPercentage text_indent { InitialValues::text_indent() };
|
||||
CSS::TextWrapMode text_wrap_mode { InitialValues::text_wrap_mode() };
|
||||
CSS::WhiteSpace white_space { InitialValues::white_space() };
|
||||
CSS::WhiteSpaceCollapse white_space_collapse { InitialValues::white_space_collapse() };
|
||||
CSS::WordBreak word_break { InitialValues::word_break() };
|
||||
|
@ -818,6 +821,7 @@ public:
|
|||
void set_text_transform(CSS::TextTransform value) { m_inherited.text_transform = value; }
|
||||
void set_text_shadow(Vector<ShadowData>&& value) { m_inherited.text_shadow = move(value); }
|
||||
void set_text_indent(CSS::LengthPercentage value) { m_inherited.text_indent = move(value); }
|
||||
void set_text_wrap_mode(CSS::TextWrapMode value) { m_inherited.text_wrap_mode = value; }
|
||||
void set_text_overflow(CSS::TextOverflow value) { m_noninherited.text_overflow = value; }
|
||||
void set_webkit_text_fill_color(Color value) { m_inherited.webkit_text_fill_color = value; }
|
||||
void set_position(CSS::Positioning position) { m_noninherited.position = position; }
|
||||
|
|
|
@ -617,6 +617,10 @@
|
|||
"none",
|
||||
"uppercase"
|
||||
],
|
||||
"text-wrap-mode": [
|
||||
"wrap",
|
||||
"nowrap"
|
||||
],
|
||||
"touch-action": [
|
||||
"auto",
|
||||
"manipulation",
|
||||
|
|
|
@ -2937,6 +2937,14 @@
|
|||
"text-transform"
|
||||
]
|
||||
},
|
||||
"text-wrap-mode": {
|
||||
"animation-type": "discrete",
|
||||
"inherited": true,
|
||||
"initial": "wrap",
|
||||
"valid-types": [
|
||||
"text-wrap-mode"
|
||||
]
|
||||
},
|
||||
"top": {
|
||||
"animation-type": "by-computed-value",
|
||||
"inherited": false,
|
||||
|
|
|
@ -640,6 +640,7 @@ void NodeWithStyle::apply_style(CSS::ComputedProperties const& computed_style)
|
|||
if (auto text_indent = computed_style.length_percentage(CSS::PropertyID::TextIndent); text_indent.has_value())
|
||||
computed_values.set_text_indent(text_indent.release_value());
|
||||
|
||||
computed_values.set_text_wrap_mode(computed_style.text_wrap_mode());
|
||||
computed_values.set_tab_size(computed_style.tab_size());
|
||||
|
||||
computed_values.set_white_space(computed_style.white_space());
|
||||
|
|
|
@ -433,7 +433,7 @@ bool pseudo_element_supports_property(PseudoElement pseudo_element, PropertyID p
|
|||
// FIXME: text-spacing-trim
|
||||
append_property("text-transform"sv);
|
||||
// FIXME: text-wrap
|
||||
// FIXME: text-wrap-mode
|
||||
append_property("text-wrap-mode"sv);
|
||||
// FIXME: text-wrap-style
|
||||
append_property("white-space"sv);
|
||||
append_property("white-space-collapse"sv);
|
||||
|
|
|
@ -56,186 +56,187 @@ All properties associated with getComputedStyle(document.body):
|
|||
"53": "text-justify",
|
||||
"54": "text-shadow",
|
||||
"55": "text-transform",
|
||||
"56": "visibility",
|
||||
"57": "white-space",
|
||||
"58": "white-space-collapse",
|
||||
"59": "word-break",
|
||||
"60": "word-spacing",
|
||||
"61": "word-wrap",
|
||||
"62": "writing-mode",
|
||||
"63": "align-content",
|
||||
"64": "align-items",
|
||||
"65": "align-self",
|
||||
"66": "animation-delay",
|
||||
"67": "animation-direction",
|
||||
"68": "animation-duration",
|
||||
"69": "animation-fill-mode",
|
||||
"70": "animation-iteration-count",
|
||||
"71": "animation-name",
|
||||
"72": "animation-play-state",
|
||||
"73": "animation-timing-function",
|
||||
"74": "appearance",
|
||||
"75": "aspect-ratio",
|
||||
"76": "backdrop-filter",
|
||||
"77": "background-attachment",
|
||||
"78": "background-blend-mode",
|
||||
"79": "background-clip",
|
||||
"80": "background-color",
|
||||
"81": "background-image",
|
||||
"82": "background-origin",
|
||||
"83": "background-position-x",
|
||||
"84": "background-position-y",
|
||||
"85": "background-repeat",
|
||||
"86": "background-size",
|
||||
"87": "block-size",
|
||||
"88": "border-block-end-color",
|
||||
"89": "border-block-end-style",
|
||||
"90": "border-block-end-width",
|
||||
"91": "border-block-start-color",
|
||||
"92": "border-block-start-style",
|
||||
"93": "border-block-start-width",
|
||||
"94": "border-bottom-color",
|
||||
"95": "border-bottom-left-radius",
|
||||
"96": "border-bottom-right-radius",
|
||||
"97": "border-bottom-style",
|
||||
"98": "border-bottom-width",
|
||||
"99": "border-inline-end-color",
|
||||
"100": "border-inline-end-style",
|
||||
"101": "border-inline-end-width",
|
||||
"102": "border-inline-start-color",
|
||||
"103": "border-inline-start-style",
|
||||
"104": "border-inline-start-width",
|
||||
"105": "border-left-color",
|
||||
"106": "border-left-style",
|
||||
"107": "border-left-width",
|
||||
"108": "border-right-color",
|
||||
"109": "border-right-style",
|
||||
"110": "border-right-width",
|
||||
"111": "border-top-color",
|
||||
"112": "border-top-left-radius",
|
||||
"113": "border-top-right-radius",
|
||||
"114": "border-top-style",
|
||||
"115": "border-top-width",
|
||||
"116": "bottom",
|
||||
"117": "box-shadow",
|
||||
"118": "box-sizing",
|
||||
"119": "clear",
|
||||
"120": "clip",
|
||||
"121": "clip-path",
|
||||
"122": "column-count",
|
||||
"123": "column-gap",
|
||||
"124": "column-span",
|
||||
"125": "column-width",
|
||||
"126": "contain",
|
||||
"127": "content",
|
||||
"128": "content-visibility",
|
||||
"129": "counter-increment",
|
||||
"130": "counter-reset",
|
||||
"131": "counter-set",
|
||||
"132": "cx",
|
||||
"133": "cy",
|
||||
"134": "display",
|
||||
"135": "filter",
|
||||
"136": "flex-basis",
|
||||
"137": "flex-direction",
|
||||
"138": "flex-grow",
|
||||
"139": "flex-shrink",
|
||||
"140": "flex-wrap",
|
||||
"141": "float",
|
||||
"142": "grid-auto-columns",
|
||||
"143": "grid-auto-flow",
|
||||
"144": "grid-auto-rows",
|
||||
"145": "grid-column-end",
|
||||
"146": "grid-column-start",
|
||||
"147": "grid-row-end",
|
||||
"148": "grid-row-start",
|
||||
"149": "grid-template-areas",
|
||||
"150": "grid-template-columns",
|
||||
"151": "grid-template-rows",
|
||||
"152": "height",
|
||||
"153": "inline-size",
|
||||
"154": "inset-block-end",
|
||||
"155": "inset-block-start",
|
||||
"156": "inset-inline-end",
|
||||
"157": "inset-inline-start",
|
||||
"158": "isolation",
|
||||
"159": "justify-content",
|
||||
"160": "justify-items",
|
||||
"161": "justify-self",
|
||||
"162": "left",
|
||||
"163": "margin-block-end",
|
||||
"164": "margin-block-start",
|
||||
"165": "margin-bottom",
|
||||
"166": "margin-inline-end",
|
||||
"167": "margin-inline-start",
|
||||
"168": "margin-left",
|
||||
"169": "margin-right",
|
||||
"170": "margin-top",
|
||||
"171": "mask-image",
|
||||
"172": "mask-type",
|
||||
"173": "max-block-size",
|
||||
"174": "max-height",
|
||||
"175": "max-inline-size",
|
||||
"176": "max-width",
|
||||
"177": "min-block-size",
|
||||
"178": "min-height",
|
||||
"179": "min-inline-size",
|
||||
"180": "min-width",
|
||||
"181": "mix-blend-mode",
|
||||
"182": "object-fit",
|
||||
"183": "object-position",
|
||||
"184": "opacity",
|
||||
"185": "order",
|
||||
"186": "outline-color",
|
||||
"187": "outline-offset",
|
||||
"188": "outline-style",
|
||||
"189": "outline-width",
|
||||
"190": "overflow-x",
|
||||
"191": "overflow-y",
|
||||
"192": "padding-block-end",
|
||||
"193": "padding-block-start",
|
||||
"194": "padding-bottom",
|
||||
"195": "padding-inline-end",
|
||||
"196": "padding-inline-start",
|
||||
"197": "padding-left",
|
||||
"198": "padding-right",
|
||||
"199": "padding-top",
|
||||
"200": "position",
|
||||
"201": "r",
|
||||
"202": "right",
|
||||
"203": "rotate",
|
||||
"204": "row-gap",
|
||||
"205": "rx",
|
||||
"206": "ry",
|
||||
"207": "scale",
|
||||
"208": "scrollbar-gutter",
|
||||
"209": "scrollbar-width",
|
||||
"210": "stop-color",
|
||||
"211": "stop-opacity",
|
||||
"212": "table-layout",
|
||||
"213": "text-decoration-color",
|
||||
"214": "text-decoration-style",
|
||||
"215": "text-decoration-thickness",
|
||||
"216": "text-overflow",
|
||||
"217": "top",
|
||||
"218": "touch-action",
|
||||
"219": "transform",
|
||||
"220": "transform-box",
|
||||
"221": "transform-origin",
|
||||
"222": "transition-behavior",
|
||||
"223": "transition-delay",
|
||||
"224": "transition-duration",
|
||||
"225": "transition-property",
|
||||
"226": "transition-timing-function",
|
||||
"227": "translate",
|
||||
"228": "unicode-bidi",
|
||||
"229": "user-select",
|
||||
"230": "vertical-align",
|
||||
"231": "view-transition-name",
|
||||
"232": "width",
|
||||
"233": "x",
|
||||
"234": "y",
|
||||
"235": "z-index"
|
||||
"56": "text-wrap-mode",
|
||||
"57": "visibility",
|
||||
"58": "white-space",
|
||||
"59": "white-space-collapse",
|
||||
"60": "word-break",
|
||||
"61": "word-spacing",
|
||||
"62": "word-wrap",
|
||||
"63": "writing-mode",
|
||||
"64": "align-content",
|
||||
"65": "align-items",
|
||||
"66": "align-self",
|
||||
"67": "animation-delay",
|
||||
"68": "animation-direction",
|
||||
"69": "animation-duration",
|
||||
"70": "animation-fill-mode",
|
||||
"71": "animation-iteration-count",
|
||||
"72": "animation-name",
|
||||
"73": "animation-play-state",
|
||||
"74": "animation-timing-function",
|
||||
"75": "appearance",
|
||||
"76": "aspect-ratio",
|
||||
"77": "backdrop-filter",
|
||||
"78": "background-attachment",
|
||||
"79": "background-blend-mode",
|
||||
"80": "background-clip",
|
||||
"81": "background-color",
|
||||
"82": "background-image",
|
||||
"83": "background-origin",
|
||||
"84": "background-position-x",
|
||||
"85": "background-position-y",
|
||||
"86": "background-repeat",
|
||||
"87": "background-size",
|
||||
"88": "block-size",
|
||||
"89": "border-block-end-color",
|
||||
"90": "border-block-end-style",
|
||||
"91": "border-block-end-width",
|
||||
"92": "border-block-start-color",
|
||||
"93": "border-block-start-style",
|
||||
"94": "border-block-start-width",
|
||||
"95": "border-bottom-color",
|
||||
"96": "border-bottom-left-radius",
|
||||
"97": "border-bottom-right-radius",
|
||||
"98": "border-bottom-style",
|
||||
"99": "border-bottom-width",
|
||||
"100": "border-inline-end-color",
|
||||
"101": "border-inline-end-style",
|
||||
"102": "border-inline-end-width",
|
||||
"103": "border-inline-start-color",
|
||||
"104": "border-inline-start-style",
|
||||
"105": "border-inline-start-width",
|
||||
"106": "border-left-color",
|
||||
"107": "border-left-style",
|
||||
"108": "border-left-width",
|
||||
"109": "border-right-color",
|
||||
"110": "border-right-style",
|
||||
"111": "border-right-width",
|
||||
"112": "border-top-color",
|
||||
"113": "border-top-left-radius",
|
||||
"114": "border-top-right-radius",
|
||||
"115": "border-top-style",
|
||||
"116": "border-top-width",
|
||||
"117": "bottom",
|
||||
"118": "box-shadow",
|
||||
"119": "box-sizing",
|
||||
"120": "clear",
|
||||
"121": "clip",
|
||||
"122": "clip-path",
|
||||
"123": "column-count",
|
||||
"124": "column-gap",
|
||||
"125": "column-span",
|
||||
"126": "column-width",
|
||||
"127": "contain",
|
||||
"128": "content",
|
||||
"129": "content-visibility",
|
||||
"130": "counter-increment",
|
||||
"131": "counter-reset",
|
||||
"132": "counter-set",
|
||||
"133": "cx",
|
||||
"134": "cy",
|
||||
"135": "display",
|
||||
"136": "filter",
|
||||
"137": "flex-basis",
|
||||
"138": "flex-direction",
|
||||
"139": "flex-grow",
|
||||
"140": "flex-shrink",
|
||||
"141": "flex-wrap",
|
||||
"142": "float",
|
||||
"143": "grid-auto-columns",
|
||||
"144": "grid-auto-flow",
|
||||
"145": "grid-auto-rows",
|
||||
"146": "grid-column-end",
|
||||
"147": "grid-column-start",
|
||||
"148": "grid-row-end",
|
||||
"149": "grid-row-start",
|
||||
"150": "grid-template-areas",
|
||||
"151": "grid-template-columns",
|
||||
"152": "grid-template-rows",
|
||||
"153": "height",
|
||||
"154": "inline-size",
|
||||
"155": "inset-block-end",
|
||||
"156": "inset-block-start",
|
||||
"157": "inset-inline-end",
|
||||
"158": "inset-inline-start",
|
||||
"159": "isolation",
|
||||
"160": "justify-content",
|
||||
"161": "justify-items",
|
||||
"162": "justify-self",
|
||||
"163": "left",
|
||||
"164": "margin-block-end",
|
||||
"165": "margin-block-start",
|
||||
"166": "margin-bottom",
|
||||
"167": "margin-inline-end",
|
||||
"168": "margin-inline-start",
|
||||
"169": "margin-left",
|
||||
"170": "margin-right",
|
||||
"171": "margin-top",
|
||||
"172": "mask-image",
|
||||
"173": "mask-type",
|
||||
"174": "max-block-size",
|
||||
"175": "max-height",
|
||||
"176": "max-inline-size",
|
||||
"177": "max-width",
|
||||
"178": "min-block-size",
|
||||
"179": "min-height",
|
||||
"180": "min-inline-size",
|
||||
"181": "min-width",
|
||||
"182": "mix-blend-mode",
|
||||
"183": "object-fit",
|
||||
"184": "object-position",
|
||||
"185": "opacity",
|
||||
"186": "order",
|
||||
"187": "outline-color",
|
||||
"188": "outline-offset",
|
||||
"189": "outline-style",
|
||||
"190": "outline-width",
|
||||
"191": "overflow-x",
|
||||
"192": "overflow-y",
|
||||
"193": "padding-block-end",
|
||||
"194": "padding-block-start",
|
||||
"195": "padding-bottom",
|
||||
"196": "padding-inline-end",
|
||||
"197": "padding-inline-start",
|
||||
"198": "padding-left",
|
||||
"199": "padding-right",
|
||||
"200": "padding-top",
|
||||
"201": "position",
|
||||
"202": "r",
|
||||
"203": "right",
|
||||
"204": "rotate",
|
||||
"205": "row-gap",
|
||||
"206": "rx",
|
||||
"207": "ry",
|
||||
"208": "scale",
|
||||
"209": "scrollbar-gutter",
|
||||
"210": "scrollbar-width",
|
||||
"211": "stop-color",
|
||||
"212": "stop-opacity",
|
||||
"213": "table-layout",
|
||||
"214": "text-decoration-color",
|
||||
"215": "text-decoration-style",
|
||||
"216": "text-decoration-thickness",
|
||||
"217": "text-overflow",
|
||||
"218": "top",
|
||||
"219": "touch-action",
|
||||
"220": "transform",
|
||||
"221": "transform-box",
|
||||
"222": "transform-origin",
|
||||
"223": "transition-behavior",
|
||||
"224": "transition-delay",
|
||||
"225": "transition-duration",
|
||||
"226": "transition-property",
|
||||
"227": "transition-timing-function",
|
||||
"228": "translate",
|
||||
"229": "unicode-bidi",
|
||||
"230": "user-select",
|
||||
"231": "vertical-align",
|
||||
"232": "view-transition-name",
|
||||
"233": "width",
|
||||
"234": "x",
|
||||
"235": "y",
|
||||
"236": "z-index"
|
||||
}
|
||||
All properties associated with document.body.style by default:
|
||||
{}
|
||||
|
|
|
@ -615,6 +615,8 @@ All supported properties and their default values exposed from CSSStylePropertie
|
|||
'text-shadow': 'none'
|
||||
'textTransform': 'none'
|
||||
'text-transform': 'none'
|
||||
'textWrapMode': 'wrap'
|
||||
'text-wrap-mode': 'wrap'
|
||||
'top': 'auto'
|
||||
'touchAction': 'auto'
|
||||
'touch-action': 'auto'
|
||||
|
|
|
@ -54,6 +54,7 @@ text-indent: 0px
|
|||
text-justify: auto
|
||||
text-shadow: none
|
||||
text-transform: none
|
||||
text-wrap-mode: wrap
|
||||
visibility: visible
|
||||
white-space: normal
|
||||
white-space-collapse: collapse
|
||||
|
@ -85,7 +86,7 @@ background-position-x: 0%
|
|||
background-position-y: 0%
|
||||
background-repeat: repeat
|
||||
background-size: auto auto
|
||||
block-size: 1305px
|
||||
block-size: 1320px
|
||||
border-block-end-color: rgb(0, 0, 0)
|
||||
border-block-end-style: none
|
||||
border-block-end-width: medium
|
||||
|
@ -150,7 +151,7 @@ grid-row-start: auto
|
|||
grid-template-areas: none
|
||||
grid-template-columns: none
|
||||
grid-template-rows: none
|
||||
height: 2280px
|
||||
height: 2295px
|
||||
inline-size: 784px
|
||||
inset-block-end: auto
|
||||
inset-block-start: auto
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 2 tests
|
||||
|
||||
2 Pass
|
||||
Pass Property text-wrap-mode value 'wrap'
|
||||
Pass Property text-wrap-mode value 'nowrap'
|
|
@ -0,0 +1,23 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 18 tests
|
||||
|
||||
18 Pass
|
||||
Pass e.style['text-wrap-mode'] = "auto" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "normal" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "none" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "balance" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "pretty" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "stable" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "wrap stable" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "nowrap stable" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "wrap auto" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "balance balance" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "pretty pretty" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "stable stable" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "wrap nowrap" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "pretty balance" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "balance stable" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "stable pretty" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "delicious wrap" should not set the property value
|
||||
Pass e.style['text-wrap-mode'] = "5px" should not set the property value
|
|
@ -0,0 +1,12 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 7 tests
|
||||
|
||||
7 Pass
|
||||
Pass e.style['text-wrap-mode'] = "wrap" should set the property value
|
||||
Pass e.style['text-wrap-mode'] = "nowrap" should set the property value
|
||||
Pass e.style['text-wrap-mode'] = "initial" should set the property value
|
||||
Pass e.style['text-wrap-mode'] = "inherit" should set the property value
|
||||
Pass e.style['text-wrap-mode'] = "unset" should set the property value
|
||||
Pass e.style['text-wrap-mode'] = "revert" should set the property value
|
||||
Pass e.style['text-wrap-mode'] = "revert-layer" should set the property value
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedStyle().textWrapMode</title>
|
||||
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap-mode">
|
||||
<meta name="assert" content="text-wrap-mode computed value is wrap | nowrap">
|
||||
<script src="../../../resources/testharness.js"></script>
|
||||
<script src="../../../resources/testharnessreport.js"></script>
|
||||
<script src="../../../css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("text-wrap-mode", "wrap");
|
||||
test_computed_value("text-wrap-mode", "nowrap");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text Module Test: parsing text-wrap-mode with invalid values</title>
|
||||
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap-mode">
|
||||
<meta name="assert" content="text-wrap-mode supports only the grammar '<text-wrap-mode>'.">
|
||||
<script src="../../../resources/testharness.js"></script>
|
||||
<script src="../../../resources/testharnessreport.js"></script>
|
||||
<script src="../../../css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value("text-wrap-mode", "auto");
|
||||
test_invalid_value("text-wrap-mode", "normal");
|
||||
test_invalid_value("text-wrap-mode", "none");
|
||||
test_invalid_value("text-wrap-mode", "balance");
|
||||
test_invalid_value("text-wrap-mode", "pretty");
|
||||
test_invalid_value("text-wrap-mode", "stable");
|
||||
test_invalid_value("text-wrap-mode", "wrap stable");
|
||||
test_invalid_value("text-wrap-mode", "nowrap stable");
|
||||
test_invalid_value("text-wrap-mode", "wrap auto");
|
||||
test_invalid_value("text-wrap-mode", "balance balance");
|
||||
test_invalid_value("text-wrap-mode", "pretty pretty");
|
||||
test_invalid_value("text-wrap-mode", "stable stable");
|
||||
test_invalid_value("text-wrap-mode", "wrap nowrap");
|
||||
test_invalid_value("text-wrap-mode", "pretty balance");
|
||||
test_invalid_value("text-wrap-mode", "balance stable");
|
||||
test_invalid_value("text-wrap-mode", "stable pretty");
|
||||
test_invalid_value("text-wrap-mode", "delicious wrap");
|
||||
test_invalid_value("text-wrap-mode", "5px");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text Module Test: parsing text-wrap-mode with valid values</title>
|
||||
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap-mode">
|
||||
<meta name="assert" content="text-wrap-mode supports the full grammar.">
|
||||
<script src="../../../resources/testharness.js"></script>
|
||||
<script src="../../../resources/testharnessreport.js"></script>
|
||||
<script src="../../../css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value("text-wrap-mode", "wrap");
|
||||
test_valid_value("text-wrap-mode", "nowrap");
|
||||
|
||||
test_valid_value("text-wrap-mode", "initial");
|
||||
test_valid_value("text-wrap-mode", "inherit");
|
||||
test_valid_value("text-wrap-mode", "unset");
|
||||
test_valid_value("text-wrap-mode", "revert");
|
||||
test_valid_value("text-wrap-mode", "revert-layer");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue