mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
LibWeb: Split AbstractImageStyleValue out of StyleValue.{h,cpp}
This commit is contained in:
parent
0f04fa2e6e
commit
e61a5ad180
13 changed files with 89 additions and 131 deletions
|
@ -8,31 +8,9 @@
|
|||
*/
|
||||
|
||||
#include "ConicGradientStyleValue.h"
|
||||
#include <LibWeb/CSS/Serialize.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
// FIXME: Temporary until AbstractImageStyleValue.h exists. (And the Serialize.h include above.)
|
||||
static ErrorOr<void> serialize_color_stop_list(StringBuilder& builder, auto const& color_stop_list)
|
||||
{
|
||||
bool first = true;
|
||||
for (auto const& element : color_stop_list) {
|
||||
if (!first)
|
||||
TRY(builder.try_append(", "sv));
|
||||
|
||||
if (element.transition_hint.has_value())
|
||||
TRY(builder.try_appendff("{}, "sv, TRY(element.transition_hint->value.to_string())));
|
||||
|
||||
TRY(serialize_a_srgb_value(builder, element.color_stop.color));
|
||||
for (auto position : Array { &element.color_stop.position, &element.color_stop.second_position }) {
|
||||
if (position->has_value())
|
||||
TRY(builder.try_appendff(" {}"sv, TRY((*position)->to_string())));
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<String> ConicGradientStyleValue::to_string() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue