mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
LibWeb/CSS: Add the text-rendering
property
This commit is contained in:
parent
7152821c8f
commit
68035a2b8d
Notes:
github-actions[bot]
2025-06-27 15:53:08 +00:00
Author: https://github.com/tcl3
Commit: 68035a2b8d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5236
Reviewed-by: https://github.com/AtkinsSJ ✅
19 changed files with 106 additions and 10 deletions
|
@ -792,6 +792,12 @@ TextOverflow ComputedProperties::text_overflow() const
|
|||
return keyword_to_text_overflow(value.to_keyword()).release_value();
|
||||
}
|
||||
|
||||
TextRendering ComputedProperties::text_rendering() const
|
||||
{
|
||||
auto const& value = property(PropertyID::TextRendering);
|
||||
return keyword_to_text_rendering(value.to_keyword()).release_value();
|
||||
}
|
||||
|
||||
PointerEvents ComputedProperties::pointer_events() const
|
||||
{
|
||||
auto const& value = property(PropertyID::PointerEvents);
|
||||
|
|
|
@ -83,6 +83,7 @@ public:
|
|||
TextAlign text_align() const;
|
||||
TextJustify text_justify() const;
|
||||
TextOverflow text_overflow() const;
|
||||
TextRendering text_rendering() const;
|
||||
Length border_spacing_horizontal(Layout::Node const&) const;
|
||||
Length border_spacing_vertical(Layout::Node const&) const;
|
||||
CaptionSide caption_side() const;
|
||||
|
|
|
@ -121,6 +121,7 @@ public:
|
|||
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::TextRendering text_rendering() { return CSS::TextRendering::Auto; }
|
||||
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; }
|
||||
|
@ -437,6 +438,7 @@ public:
|
|||
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; }
|
||||
CSS::TextRendering text_rendering() const { return m_inherited.text_rendering; }
|
||||
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; }
|
||||
|
@ -645,6 +647,7 @@ protected:
|
|||
CSS::TextTransform text_transform { InitialValues::text_transform() };
|
||||
CSS::LengthPercentage text_indent { InitialValues::text_indent() };
|
||||
CSS::TextWrapMode text_wrap_mode { InitialValues::text_wrap_mode() };
|
||||
CSS::TextRendering text_rendering { InitialValues::text_rendering() };
|
||||
CSS::WhiteSpaceCollapse white_space_collapse { InitialValues::white_space_collapse() };
|
||||
CSS::WordBreak word_break { InitialValues::word_break() };
|
||||
CSS::LengthOrCalculated word_spacing { InitialValues::word_spacing() };
|
||||
|
@ -851,6 +854,7 @@ public:
|
|||
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_text_rendering(CSS::TextRendering value) { m_inherited.text_rendering = 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; }
|
||||
void set_white_space_collapse(CSS::WhiteSpaceCollapse value) { m_inherited.white_space_collapse = value; }
|
||||
|
|
|
@ -633,6 +633,12 @@
|
|||
"clip",
|
||||
"ellipsis"
|
||||
],
|
||||
"text-rendering": [
|
||||
"auto",
|
||||
"optimizespeed",
|
||||
"optimizelegibility",
|
||||
"geometricprecision"
|
||||
],
|
||||
"text-transform": [
|
||||
"capitalize",
|
||||
"full-size-kana",
|
||||
|
|
|
@ -216,6 +216,7 @@
|
|||
"full-size-kana",
|
||||
"full-width",
|
||||
"fullscreen",
|
||||
"geometricprecision",
|
||||
"grab",
|
||||
"grabbing",
|
||||
"grammar-error",
|
||||
|
@ -360,6 +361,7 @@
|
|||
"on",
|
||||
"opaque",
|
||||
"open-quote",
|
||||
"optimizelegibility",
|
||||
"optimizequality",
|
||||
"optimizespeed",
|
||||
"optional",
|
||||
|
|
|
@ -3003,6 +3003,15 @@
|
|||
"text-overflow"
|
||||
]
|
||||
},
|
||||
"text-rendering": {
|
||||
"affects-layout": false,
|
||||
"animation-type": "discrete",
|
||||
"inherited": true,
|
||||
"initial": "auto",
|
||||
"valid-types": [
|
||||
"text-rendering"
|
||||
]
|
||||
},
|
||||
"text-shadow": {
|
||||
"affects-layout": false,
|
||||
"animation-type": "custom",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue