mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibWeb: Add writing-mode
CSS property, and its values
Introduce the `writing-mode` property, as specified in https://drafts.csswg.org/css-writing-modes/#block-flow
This commit is contained in:
parent
755b83c01a
commit
c3f3e93b7e
Notes:
github-actions[bot]
2024-11-03 16:03:18 +00:00
Author: https://github.com/BenJilks
Commit: c3f3e93b7e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2135
Reviewed-by: https://github.com/kalenikaliaksandr ✅
8 changed files with 40 additions and 1 deletions
|
@ -49,6 +49,7 @@ white-space: normal
|
||||||
word-break: normal
|
word-break: normal
|
||||||
word-spacing: normal
|
word-spacing: normal
|
||||||
word-wrap: normal
|
word-wrap: normal
|
||||||
|
writing-mode: horizontal-tb
|
||||||
align-content: normal
|
align-content: normal
|
||||||
align-items: normal
|
align-items: normal
|
||||||
align-self: auto
|
align-self: auto
|
||||||
|
@ -123,7 +124,7 @@ grid-row-start: auto
|
||||||
grid-template-areas: none
|
grid-template-areas: none
|
||||||
grid-template-columns: auto
|
grid-template-columns: auto
|
||||||
grid-template-rows: auto
|
grid-template-rows: auto
|
||||||
height: 2125px
|
height: 2142px
|
||||||
inline-size: auto
|
inline-size: auto
|
||||||
inset-block-end: auto
|
inset-block-end: auto
|
||||||
inset-block-start: auto
|
inset-block-start: auto
|
||||||
|
|
|
@ -191,6 +191,7 @@ public:
|
||||||
static CSS::TransformBox transform_box() { return CSS::TransformBox::ViewBox; }
|
static CSS::TransformBox transform_box() { return CSS::TransformBox::ViewBox; }
|
||||||
static CSS::Direction direction() { return CSS::Direction::Ltr; }
|
static CSS::Direction direction() { return CSS::Direction::Ltr; }
|
||||||
static CSS::UnicodeBidi unicode_bidi() { return CSS::UnicodeBidi::Normal; }
|
static CSS::UnicodeBidi unicode_bidi() { return CSS::UnicodeBidi::Normal; }
|
||||||
|
static CSS::WritingMode writing_mode() { return CSS::WritingMode::HorizontalTb; }
|
||||||
|
|
||||||
// https://www.w3.org/TR/SVG/geometry.html
|
// https://www.w3.org/TR/SVG/geometry.html
|
||||||
static LengthPercentage cx() { return CSS::Length::make_px(0); }
|
static LengthPercentage cx() { return CSS::Length::make_px(0); }
|
||||||
|
@ -443,6 +444,7 @@ public:
|
||||||
CSS::ObjectPosition object_position() const { return m_noninherited.object_position; }
|
CSS::ObjectPosition object_position() const { return m_noninherited.object_position; }
|
||||||
CSS::Direction direction() const { return m_inherited.direction; }
|
CSS::Direction direction() const { return m_inherited.direction; }
|
||||||
CSS::UnicodeBidi unicode_bidi() const { return m_noninherited.unicode_bidi; }
|
CSS::UnicodeBidi unicode_bidi() const { return m_noninherited.unicode_bidi; }
|
||||||
|
CSS::WritingMode writing_mode() const { return m_inherited.writing_mode; }
|
||||||
|
|
||||||
CSS::LengthBox const& inset() const { return m_noninherited.inset; }
|
CSS::LengthBox const& inset() const { return m_noninherited.inset; }
|
||||||
const CSS::LengthBox& margin() const { return m_noninherited.margin; }
|
const CSS::LengthBox& margin() const { return m_noninherited.margin; }
|
||||||
|
@ -567,6 +569,7 @@ protected:
|
||||||
CSS::Visibility visibility { InitialValues::visibility() };
|
CSS::Visibility visibility { InitialValues::visibility() };
|
||||||
CSS::QuotesData quotes { InitialValues::quotes() };
|
CSS::QuotesData quotes { InitialValues::quotes() };
|
||||||
CSS::Direction direction { InitialValues::direction() };
|
CSS::Direction direction { InitialValues::direction() };
|
||||||
|
CSS::WritingMode writing_mode { InitialValues::writing_mode() };
|
||||||
|
|
||||||
Optional<SVGPaint> fill;
|
Optional<SVGPaint> fill;
|
||||||
CSS::FillRule fill_rule { InitialValues::fill_rule() };
|
CSS::FillRule fill_rule { InitialValues::fill_rule() };
|
||||||
|
@ -813,6 +816,7 @@ public:
|
||||||
void set_object_position(CSS::ObjectPosition value) { m_noninherited.object_position = value; }
|
void set_object_position(CSS::ObjectPosition value) { m_noninherited.object_position = value; }
|
||||||
void set_direction(CSS::Direction value) { m_inherited.direction = value; }
|
void set_direction(CSS::Direction value) { m_inherited.direction = value; }
|
||||||
void set_unicode_bidi(CSS::UnicodeBidi value) { m_noninherited.unicode_bidi = value; }
|
void set_unicode_bidi(CSS::UnicodeBidi value) { m_noninherited.unicode_bidi = value; }
|
||||||
|
void set_writing_mode(CSS::WritingMode value) { m_inherited.writing_mode = value; }
|
||||||
|
|
||||||
void set_fill(SVGPaint value) { m_inherited.fill = value; }
|
void set_fill(SVGPaint value) { m_inherited.fill = value; }
|
||||||
void set_stroke(SVGPaint value) { m_inherited.stroke = value; }
|
void set_stroke(SVGPaint value) { m_inherited.stroke = value; }
|
||||||
|
|
|
@ -510,5 +510,12 @@
|
||||||
"keep-all",
|
"keep-all",
|
||||||
"break-all",
|
"break-all",
|
||||||
"break-word"
|
"break-word"
|
||||||
|
],
|
||||||
|
"writing-mode": [
|
||||||
|
"horizontal-tb",
|
||||||
|
"vertical-rl",
|
||||||
|
"vertical-lr",
|
||||||
|
"sideways-rl",
|
||||||
|
"sideways-lr"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,6 +185,7 @@
|
||||||
"high-quality",
|
"high-quality",
|
||||||
"highlight",
|
"highlight",
|
||||||
"highlighttext",
|
"highlighttext",
|
||||||
|
"horizontal-tb",
|
||||||
"hover",
|
"hover",
|
||||||
"inactiveborder",
|
"inactiveborder",
|
||||||
"inactivecaption",
|
"inactivecaption",
|
||||||
|
@ -339,6 +340,8 @@
|
||||||
"semi-expanded",
|
"semi-expanded",
|
||||||
"separate",
|
"separate",
|
||||||
"serif",
|
"serif",
|
||||||
|
"sideways-lr",
|
||||||
|
"sideways-rl",
|
||||||
"slider-horizontal",
|
"slider-horizontal",
|
||||||
"slow",
|
"slow",
|
||||||
"small",
|
"small",
|
||||||
|
@ -403,6 +406,8 @@
|
||||||
"upper-latin",
|
"upper-latin",
|
||||||
"upper-roman",
|
"upper-roman",
|
||||||
"uppercase",
|
"uppercase",
|
||||||
|
"vertical-lr",
|
||||||
|
"vertical-rl",
|
||||||
"vertical-text",
|
"vertical-text",
|
||||||
"view-box",
|
"view-box",
|
||||||
"visible",
|
"visible",
|
||||||
|
|
|
@ -2799,6 +2799,18 @@
|
||||||
"normal"
|
"normal"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"writing-mode": {
|
||||||
|
"animation-type": "none",
|
||||||
|
"inherited": true,
|
||||||
|
"initial": "horizontal-tb",
|
||||||
|
"valid-identifiers": [
|
||||||
|
"horizontal-tb",
|
||||||
|
"vertical-rl",
|
||||||
|
"vertical-lr",
|
||||||
|
"sideways-rl",
|
||||||
|
"sideways-lr"
|
||||||
|
]
|
||||||
|
},
|
||||||
"x": {
|
"x": {
|
||||||
"__comment": "This is an SVG 2 geometry property, see: https://www.w3.org/TR/SVG/geometry.html#X.",
|
"__comment": "This is an SVG 2 geometry property, see: https://www.w3.org/TR/SVG/geometry.html#X.",
|
||||||
"animation-type": "by-computed-value",
|
"animation-type": "by-computed-value",
|
||||||
|
|
|
@ -1303,6 +1303,12 @@ Optional<CSS::UnicodeBidi> StyleProperties::unicode_bidi() const
|
||||||
return keyword_to_unicode_bidi(value->to_keyword());
|
return keyword_to_unicode_bidi(value->to_keyword());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Optional<CSS::WritingMode> StyleProperties::writing_mode() const
|
||||||
|
{
|
||||||
|
auto value = property(CSS::PropertyID::WritingMode);
|
||||||
|
return keyword_to_writing_mode(value->to_keyword());
|
||||||
|
}
|
||||||
|
|
||||||
Optional<CSS::MaskType> StyleProperties::mask_type() const
|
Optional<CSS::MaskType> StyleProperties::mask_type() const
|
||||||
{
|
{
|
||||||
auto value = property(CSS::PropertyID::MaskType);
|
auto value = property(CSS::PropertyID::MaskType);
|
||||||
|
|
|
@ -168,6 +168,7 @@ public:
|
||||||
Optional<CSS::TableLayout> table_layout() const;
|
Optional<CSS::TableLayout> table_layout() const;
|
||||||
Optional<CSS::Direction> direction() const;
|
Optional<CSS::Direction> direction() const;
|
||||||
Optional<CSS::UnicodeBidi> unicode_bidi() const;
|
Optional<CSS::UnicodeBidi> unicode_bidi() const;
|
||||||
|
Optional<CSS::WritingMode> writing_mode() const;
|
||||||
|
|
||||||
static Vector<CSS::Transformation> transformations_for_style_value(CSSStyleValue const& value);
|
static Vector<CSS::Transformation> transformations_for_style_value(CSSStyleValue const& value);
|
||||||
Vector<CSS::Transformation> transformations() const;
|
Vector<CSS::Transformation> transformations() const;
|
||||||
|
|
|
@ -925,6 +925,9 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
|
||||||
if (auto scrollbar_width = computed_style.scrollbar_width(); scrollbar_width.has_value())
|
if (auto scrollbar_width = computed_style.scrollbar_width(); scrollbar_width.has_value())
|
||||||
computed_values.set_scrollbar_width(scrollbar_width.value());
|
computed_values.set_scrollbar_width(scrollbar_width.value());
|
||||||
|
|
||||||
|
if (auto writing_mode = computed_style.writing_mode(); writing_mode.has_value())
|
||||||
|
computed_values.set_writing_mode(writing_mode.value());
|
||||||
|
|
||||||
propagate_style_to_anonymous_wrappers();
|
propagate_style_to_anonymous_wrappers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue