mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Implement css gradient-interpolation-method
This commit is contained in:
parent
02a642b87b
commit
31853c13d3
Notes:
github-actions[bot]
2025-03-06 11:34:14 +00:00
Author: https://github.com/Gingeh
Commit: 31853c13d3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3638
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/LucasChollet
35 changed files with 499 additions and 101 deletions
|
@ -22,6 +22,8 @@ String ConicGradientStyleValue::to_string(SerializationMode mode) const
|
|||
builder.append("conic-gradient("sv);
|
||||
bool has_from_angle = m_properties.from_angle.to_degrees() != 0;
|
||||
bool has_at_position = !m_properties.position->is_center();
|
||||
bool has_color_space = m_properties.interpolation_method.has_value() && m_properties.interpolation_method.value().color_space != InterpolationMethod::default_color_space(m_properties.color_syntax);
|
||||
|
||||
if (has_from_angle)
|
||||
builder.appendff("from {}", m_properties.from_angle.to_string());
|
||||
if (has_at_position) {
|
||||
|
@ -29,7 +31,12 @@ String ConicGradientStyleValue::to_string(SerializationMode mode) const
|
|||
builder.append(' ');
|
||||
builder.appendff("at {}"sv, m_properties.position->to_string(mode));
|
||||
}
|
||||
if (has_from_angle || has_at_position)
|
||||
if (has_color_space) {
|
||||
if (has_from_angle || has_at_position)
|
||||
builder.append(' ');
|
||||
builder.append(m_properties.interpolation_method.value().to_string());
|
||||
}
|
||||
if (has_from_angle || has_at_position || has_color_space)
|
||||
builder.append(", "sv);
|
||||
serialize_color_stop_list(builder, m_properties.color_stop_list, mode);
|
||||
builder.append(')');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue