diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp index 92f10d69094..0b8cc2bfdbf 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp @@ -210,7 +210,7 @@ DeprecatedString CSSStyleDeclaration::get_property_value(StringView property_nam auto maybe_property = property(property_id.value()); if (!maybe_property.has_value()) return {}; - return maybe_property->value->to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string(); + return maybe_property->value->to_string().to_deprecated_string(); } // https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-getpropertypriority @@ -303,7 +303,7 @@ DeprecatedString PropertyOwningCSSStyleDeclaration::serialized() const // NOTE: There are no shorthands for custom properties. // 5. Let value be the result of invoking serialize a CSS value of declaration. - auto value = declaration.value.value->to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string(); + auto value = declaration.value.value->to_string().to_deprecated_string(); // 6. Let serialized declaration be the result of invoking serialize a CSS declaration with property name property, value value, // and the important flag set if declaration has its important flag set. @@ -354,7 +354,7 @@ DeprecatedString PropertyOwningCSSStyleDeclaration::serialized() const // FIXME: 4. Shorthand loop: For each shorthand in shorthands, follow these substeps: ... // 5. Let value be the result of invoking serialize a CSS value of declaration. - auto value = declaration.value->to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string(); + auto value = declaration.value->to_string().to_deprecated_string(); // 6. Let serialized declaration be the result of invoking serialize a CSS declaration with property name property, value value, // and the important flag set if declaration has its important flag set. @@ -403,7 +403,7 @@ JS::ThrowCompletionOr CSSStyleDeclaration::internal_get(JS::PropertyK if (property_id == CSS::PropertyID::Invalid) return Base::internal_get(name, receiver, cacheable_metadata); if (auto maybe_property = property(property_id); maybe_property.has_value()) - return { JS::PrimitiveString::create(vm(), maybe_property->value->to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string()) }; + return { JS::PrimitiveString::create(vm(), maybe_property->value->to_string().to_deprecated_string()) }; return { JS::PrimitiveString::create(vm(), String {}) }; } diff --git a/Userland/Libraries/LibWeb/CSS/CalculatedOr.h b/Userland/Libraries/LibWeb/CSS/CalculatedOr.h index 8c863f4b426..59e89c999eb 100644 --- a/Userland/Libraries/LibWeb/CSS/CalculatedOr.h +++ b/Userland/Libraries/LibWeb/CSS/CalculatedOr.h @@ -61,7 +61,7 @@ public: String to_string() const { if (is_calculated()) - return MUST(m_value.template get>()->to_string()); + return m_value.template get>()->to_string(); return m_value.template get().to_string(); } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index e3d35c9b992..b9b45351224 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -6238,7 +6238,7 @@ public: ComponentValue& component_value() { return m_component_value; } - virtual ErrorOr to_string() const override { VERIFY_NOT_REACHED(); } + virtual String to_string() const override { VERIFY_NOT_REACHED(); } virtual Optional resolved_type() const override { VERIFY_NOT_REACHED(); } virtual Optional determine_type(Web::CSS::PropertyID) const override { VERIFY_NOT_REACHED(); } virtual bool contains_percentage() const override { VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibWeb/CSS/PercentageOr.h b/Userland/Libraries/LibWeb/CSS/PercentageOr.h index 8ca4e0276e3..57131423d93 100644 --- a/Userland/Libraries/LibWeb/CSS/PercentageOr.h +++ b/Userland/Libraries/LibWeb/CSS/PercentageOr.h @@ -115,7 +115,7 @@ public: String to_string() const { if (is_calculated()) - return MUST(m_value.template get>()->to_string()); + return m_value.template get>()->to_string(); if (is_percentage()) return m_value.template get().to_string(); return m_value.template get().to_string(); diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index 5511af34837..5b8cb0a6903 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -1782,7 +1782,7 @@ ErrorOr StyleComputer::compute_cascaded_values(StyleProperties& style, DOM style.set_property(static_cast(property_id_value), *property_value); } } - } else if (auto name = TRY(animation_name->to_string()); !name.is_empty()) { + } else if (auto name = animation_name->to_string(); !name.is_empty()) { auto active_animation = m_active_animations.get(animation_key); if (!active_animation.has_value()) { // New animation! @@ -2296,7 +2296,7 @@ RefPtr StyleComputer::compute_font_for_style_values(DOM::Elemen if (family->is_identifier()) { found_font = find_generic_font(family->to_identifier()); } else if (family->is_string()) { - found_font = find_font(family->to_string().release_value_but_fixme_should_propagate_errors()); + found_font = find_font(family->to_string()); } if (found_font) break; @@ -2304,7 +2304,7 @@ RefPtr StyleComputer::compute_font_for_style_values(DOM::Elemen } else if (font_family.is_identifier()) { found_font = find_generic_font(font_family.to_identifier()); } else if (font_family.is_string()) { - found_font = find_font(font_family.to_string().release_value_but_fixme_should_propagate_errors()); + found_font = find_font(font_family.to_string()); } if (!found_font) { diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp index fd51ae1c5e2..070ac195d23 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp @@ -225,7 +225,7 @@ CSSPixels StyleProperties::line_height(Layout::Node const& layout_node) const if (line_height->as_calculated().resolves_to_number()) { auto resolved = line_height->as_calculated().resolve_number(); if (!resolved.has_value()) { - dbgln("FIXME: Failed to resolve calc() line-height (number): {}", line_height->as_calculated().to_string().release_value_but_fixme_should_propagate_errors()); + dbgln("FIXME: Failed to resolve calc() line-height (number): {}", line_height->as_calculated().to_string()); return layout_node.font().pixel_metrics().line_spacing(); } return Length(resolved.value(), Length::Type::Em).to_px(layout_node); @@ -233,7 +233,7 @@ CSSPixels StyleProperties::line_height(Layout::Node const& layout_node) const auto resolved = line_height->as_calculated().resolve_length(layout_node); if (!resolved.has_value()) { - dbgln("FIXME: Failed to resolve calc() line-height: {}", line_height->as_calculated().to_string().release_value_but_fixme_should_propagate_errors()); + dbgln("FIXME: Failed to resolve calc() line-height: {}", line_height->as_calculated().to_string()); return layout_node.font().pixel_metrics().line_spacing(); } return resolved->to_px(layout_node); @@ -659,7 +659,7 @@ CSS::ContentData StyleProperties::content() const StringBuilder builder; for (auto const& item : content_style_value.content().values()) { if (item->is_string()) { - builder.append(item->to_string().release_value_but_fixme_should_propagate_errors()); + builder.append(item->to_string()); } else { // TODO: Implement quotes, counters, images, and other things. } @@ -671,7 +671,7 @@ CSS::ContentData StyleProperties::content() const StringBuilder alt_text_builder; for (auto const& item : content_style_value.alt_text()->values()) { if (item->is_string()) { - alt_text_builder.append(item->to_string().release_value_but_fixme_should_propagate_errors()); + alt_text_builder.append(item->to_string()); } else { // TODO: Implement counters } @@ -950,7 +950,7 @@ Vector> StyleProperties::grid_template_areas() const String StyleProperties::grid_area() const { auto value = property(CSS::PropertyID::GridArea); - return value->as_string().to_string().release_value_but_fixme_should_propagate_errors(); + return value->as_string().to_string(); } Optional StyleProperties::object_fit() const diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h index d730a88f702..470ecabf856 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -180,7 +180,7 @@ public: virtual Color to_color(Optional) const { return {}; } ValueID to_identifier() const; - virtual ErrorOr to_string() const = 0; + virtual String to_string() const = 0; [[nodiscard]] int to_font_weight() const; [[nodiscard]] int to_font_slope() const; @@ -219,6 +219,6 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::StyleValue const& style_value) { - return Formatter::format(builder, TRY(style_value.to_string())); + return Formatter::format(builder, style_value.to_string()); } }; diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/AbstractImageStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/AbstractImageStyleValue.h index 90e8e632b5b..5b94355090b 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/AbstractImageStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/AbstractImageStyleValue.h @@ -59,24 +59,23 @@ struct ColorStopListElement { using LinearColorStopListElement = ColorStopListElement; using AngularColorStopListElement = ColorStopListElement; -static ErrorOr serialize_color_stop_list(StringBuilder& builder, auto const& color_stop_list) +static 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)); + builder.append(", "sv); if (element.transition_hint.has_value()) - TRY(builder.try_appendff("{}, "sv, element.transition_hint->value.to_string())); + builder.appendff("{}, "sv, element.transition_hint->value.to_string()); - TRY(builder.try_append(TRY(element.color_stop.color->to_string()))); + builder.append(element.color_stop.color->to_string()); for (auto position : Array { &element.color_stop.position, &element.color_stop.second_position }) { if (position->has_value()) - TRY(builder.try_appendff(" {}"sv, (*position)->to_string())); + builder.appendff(" {}"sv, (*position)->to_string()); } first = false; } - return {}; } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/AngleStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/AngleStyleValue.cpp index b3fda65c1e3..8e0b2fcdc3f 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/AngleStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/AngleStyleValue.cpp @@ -19,7 +19,7 @@ AngleStyleValue::AngleStyleValue(Angle angle) AngleStyleValue::~AngleStyleValue() = default; -ErrorOr AngleStyleValue::to_string() const +String AngleStyleValue::to_string() const { return m_angle.to_string(); } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/AngleStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/AngleStyleValue.h index a01230128a9..345eb5c3085 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/AngleStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/AngleStyleValue.h @@ -24,7 +24,7 @@ public: Angle const& angle() const { return m_angle; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(AngleStyleValue const& other) const; diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundRepeatStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundRepeatStyleValue.cpp index 65aeec5f8af..88669347904 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundRepeatStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundRepeatStyleValue.cpp @@ -20,9 +20,9 @@ BackgroundRepeatStyleValue::BackgroundRepeatStyleValue(Repeat repeat_x, Repeat r BackgroundRepeatStyleValue::~BackgroundRepeatStyleValue() = default; -ErrorOr BackgroundRepeatStyleValue::to_string() const +String BackgroundRepeatStyleValue::to_string() const { - return String::formatted("{} {}", CSS::to_string(m_properties.repeat_x), CSS::to_string(m_properties.repeat_y)); + return MUST(String::formatted("{} {}", CSS::to_string(m_properties.repeat_x), CSS::to_string(m_properties.repeat_y))); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundRepeatStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundRepeatStyleValue.h index cb084f9408c..40099ba8e74 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundRepeatStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundRepeatStyleValue.h @@ -25,7 +25,7 @@ public: Repeat repeat_x() const { return m_properties.repeat_x; } Repeat repeat_y() const { return m_properties.repeat_y; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(BackgroundRepeatStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.cpp index cb4b1d63db9..ebaa2b7fb8c 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.cpp @@ -18,9 +18,9 @@ BackgroundSizeStyleValue::BackgroundSizeStyleValue(LengthPercentage size_x, Leng BackgroundSizeStyleValue::~BackgroundSizeStyleValue() = default; -ErrorOr BackgroundSizeStyleValue::to_string() const +String BackgroundSizeStyleValue::to_string() const { - return String::formatted("{} {}", m_properties.size_x.to_string(), m_properties.size_y.to_string()); + return MUST(String::formatted("{} {}", m_properties.size_x.to_string(), m_properties.size_y.to_string())); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.h index 0a4f3b2df20..1d94697d646 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.h @@ -27,7 +27,7 @@ public: LengthPercentage size_x() const { return m_properties.size_x; } LengthPercentage size_y() const { return m_properties.size_y; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(BackgroundSizeStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundStyleValue.cpp index 8148bb52122..24521d1ed3e 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundStyleValue.cpp @@ -53,10 +53,10 @@ BackgroundStyleValue::BackgroundStyleValue( BackgroundStyleValue::~BackgroundStyleValue() = default; -ErrorOr BackgroundStyleValue::to_string() const +String BackgroundStyleValue::to_string() const { if (m_properties.layer_count == 1) { - return String::formatted("{} {} {} {} {} {} {} {}", TRY(m_properties.color->to_string()), TRY(m_properties.image->to_string()), TRY(m_properties.position->to_string()), TRY(m_properties.size->to_string()), TRY(m_properties.repeat->to_string()), TRY(m_properties.attachment->to_string()), TRY(m_properties.origin->to_string()), TRY(m_properties.clip->to_string())); + return MUST(String::formatted("{} {} {} {} {} {} {} {}", m_properties.color->to_string(), m_properties.image->to_string(), m_properties.position->to_string(), m_properties.size->to_string(), m_properties.repeat->to_string(), m_properties.attachment->to_string(), m_properties.origin->to_string(), m_properties.clip->to_string())); } auto get_layer_value_string = [](ValueComparingNonnullRefPtr const& style_value, size_t index) { @@ -68,13 +68,13 @@ ErrorOr BackgroundStyleValue::to_string() const StringBuilder builder; for (size_t i = 0; i < m_properties.layer_count; i++) { if (i) - TRY(builder.try_append(", "sv)); + builder.append(", "sv); if (i == m_properties.layer_count - 1) - TRY(builder.try_appendff("{} ", TRY(m_properties.color->to_string()))); - TRY(builder.try_appendff("{} {} {} {} {} {} {}", TRY(get_layer_value_string(m_properties.image, i)), TRY(get_layer_value_string(m_properties.position, i)), TRY(get_layer_value_string(m_properties.size, i)), TRY(get_layer_value_string(m_properties.repeat, i)), TRY(get_layer_value_string(m_properties.attachment, i)), TRY(get_layer_value_string(m_properties.origin, i)), TRY(get_layer_value_string(m_properties.clip, i)))); + builder.appendff("{} ", m_properties.color->to_string()); + builder.appendff("{} {} {} {} {} {} {}", get_layer_value_string(m_properties.image, i), get_layer_value_string(m_properties.position, i), get_layer_value_string(m_properties.size, i), get_layer_value_string(m_properties.repeat, i), get_layer_value_string(m_properties.attachment, i), get_layer_value_string(m_properties.origin, i), get_layer_value_string(m_properties.clip, i)); } - return builder.to_string(); + return MUST(builder.to_string()); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundStyleValue.h index 42240d63134..712f99d8c6d 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundStyleValue.h @@ -40,7 +40,7 @@ public: auto repeat() const { return m_properties.repeat; } auto size() const { return m_properties.size; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(BackgroundStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusShorthandStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusShorthandStyleValue.cpp index a6d32450c8a..61069c664ac 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusShorthandStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusShorthandStyleValue.cpp @@ -11,9 +11,9 @@ namespace Web::CSS { -ErrorOr BorderRadiusShorthandStyleValue::to_string() const +String BorderRadiusShorthandStyleValue::to_string() const { - return String::formatted("{} {} {} {} / {} {} {} {}", + return MUST(String::formatted("{} {} {} {} / {} {} {} {}", m_properties.top_left->horizontal_radius().to_string(), m_properties.top_right->horizontal_radius().to_string(), m_properties.bottom_right->horizontal_radius().to_string(), @@ -21,7 +21,7 @@ ErrorOr BorderRadiusShorthandStyleValue::to_string() const m_properties.top_left->vertical_radius().to_string(), m_properties.top_right->vertical_radius().to_string(), m_properties.bottom_right->vertical_radius().to_string(), - m_properties.bottom_left->vertical_radius().to_string()); + m_properties.bottom_left->vertical_radius().to_string())); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusShorthandStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusShorthandStyleValue.h index cedc8625126..d78f607991b 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusShorthandStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusShorthandStyleValue.h @@ -31,7 +31,7 @@ public: auto bottom_right() const { return m_properties.bottom_right; } auto bottom_left() const { return m_properties.bottom_left; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(BorderRadiusShorthandStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusStyleValue.cpp index 819390dca1e..624efa670db 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusStyleValue.cpp @@ -11,11 +11,11 @@ namespace Web::CSS { -ErrorOr BorderRadiusStyleValue::to_string() const +String BorderRadiusStyleValue::to_string() const { if (m_properties.horizontal_radius == m_properties.vertical_radius) return m_properties.horizontal_radius.to_string(); - return String::formatted("{} / {}", m_properties.horizontal_radius.to_string(), m_properties.vertical_radius.to_string()); + return MUST(String::formatted("{} / {}", m_properties.horizontal_radius.to_string(), m_properties.vertical_radius.to_string())); } ValueComparingNonnullRefPtr BorderRadiusStyleValue::absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusStyleValue.h index 59f7a61834a..2d8bd365177 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/BorderRadiusStyleValue.h @@ -27,7 +27,7 @@ public: LengthPercentage const& vertical_radius() const { return m_properties.vertical_radius; } bool is_elliptical() const { return m_properties.is_elliptical; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(BorderRadiusStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/BorderStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/BorderStyleValue.cpp index 7f75e951869..d60e5e95232 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/BorderStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/BorderStyleValue.cpp @@ -22,9 +22,9 @@ BorderStyleValue::BorderStyleValue( BorderStyleValue::~BorderStyleValue() = default; -ErrorOr BorderStyleValue::to_string() const +String BorderStyleValue::to_string() const { - return String::formatted("{} {} {}", TRY(m_properties.border_width->to_string()), TRY(m_properties.border_style->to_string()), TRY(m_properties.border_color->to_string())); + return MUST(String::formatted("{} {} {}", m_properties.border_width->to_string(), m_properties.border_style->to_string(), m_properties.border_color->to_string())); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/BorderStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/BorderStyleValue.h index d84db7558fd..51ca2f5681d 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/BorderStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/BorderStyleValue.h @@ -28,7 +28,7 @@ public: ValueComparingNonnullRefPtr border_style() const { return m_properties.border_style; } ValueComparingNonnullRefPtr border_color() const { return m_properties.border_color; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(BorderStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/CalculatedStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/CalculatedStyleValue.cpp index 45f84798404..07f7f133e64 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/CalculatedStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/CalculatedStyleValue.cpp @@ -127,7 +127,7 @@ NumericCalculationNode::NumericCalculationNode(NumericValue value) NumericCalculationNode::~NumericCalculationNode() = default; -ErrorOr NumericCalculationNode::to_string() const +String NumericCalculationNode::to_string() const { return m_value.visit([](auto& value) { return value.to_string(); }); } @@ -225,17 +225,17 @@ SumCalculationNode::SumCalculationNode(Vector> va SumCalculationNode::~SumCalculationNode() = default; -ErrorOr SumCalculationNode::to_string() const +String SumCalculationNode::to_string() const { bool first = true; StringBuilder builder; for (auto& value : m_values) { if (!first) - TRY(builder.try_append(" + "sv)); - TRY(builder.try_append(TRY(value->to_string()))); + builder.append(" + "sv); + builder.append(value->to_string()); first = false; } - return builder.to_string(); + return MUST(builder.to_string()); } Optional SumCalculationNode::resolved_type() const @@ -324,7 +324,7 @@ void SumCalculationNode::for_each_child_node(Function SumCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}SUM:\n", "", indent)); + builder.appendff("{: >{}}SUM:\n", "", indent); for (auto const& item : m_values) TRY(item->dump(builder, indent + 2)); return {}; @@ -344,17 +344,17 @@ ProductCalculationNode::ProductCalculationNode(Vector ProductCalculationNode::to_string() const +String ProductCalculationNode::to_string() const { bool first = true; StringBuilder builder; for (auto& value : m_values) { if (!first) - TRY(builder.try_append(" * "sv)); - TRY(builder.try_append(TRY(value->to_string()))); + builder.append(" * "sv); + builder.append(value->to_string()); first = false; } - return builder.to_string(); + return MUST(builder.to_string()); } Optional ProductCalculationNode::resolved_type() const @@ -448,7 +448,7 @@ void ProductCalculationNode::for_each_child_node(Function ProductCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}PRODUCT:\n", "", indent)); + builder.appendff("{: >{}}PRODUCT:\n", "", indent); for (auto const& item : m_values) TRY(item->dump(builder, indent + 2)); return {}; @@ -467,9 +467,9 @@ NegateCalculationNode::NegateCalculationNode(NonnullOwnPtr valu NegateCalculationNode::~NegateCalculationNode() = default; -ErrorOr NegateCalculationNode::to_string() const +String NegateCalculationNode::to_string() const { - return String::formatted("(0 - {})", TRY(m_value->to_string())); + return MUST(String::formatted("(0 - {})", m_value->to_string())); } Optional NegateCalculationNode::resolved_type() const @@ -504,7 +504,7 @@ void NegateCalculationNode::for_each_child_node(Function NegateCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}NEGATE:\n", "", indent)); + builder.appendff("{: >{}}NEGATE:\n", "", indent); TRY(m_value->dump(builder, indent + 2)); return {}; } @@ -522,9 +522,9 @@ InvertCalculationNode::InvertCalculationNode(NonnullOwnPtr valu InvertCalculationNode::~InvertCalculationNode() = default; -ErrorOr InvertCalculationNode::to_string() const +String InvertCalculationNode::to_string() const { - return String::formatted("(1 / {})", TRY(m_value->to_string())); + return MUST(String::formatted("(1 / {})", m_value->to_string())); } Optional InvertCalculationNode::resolved_type() const @@ -566,7 +566,7 @@ void InvertCalculationNode::for_each_child_node(Function InvertCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}INVERT:\n", "", indent)); + builder.appendff("{: >{}}INVERT:\n", "", indent); TRY(m_value->dump(builder, indent + 2)); return {}; } @@ -584,17 +584,17 @@ MinCalculationNode::MinCalculationNode(Vector> va MinCalculationNode::~MinCalculationNode() = default; -ErrorOr MinCalculationNode::to_string() const +String MinCalculationNode::to_string() const { StringBuilder builder; - TRY(builder.try_append("min("sv)); + builder.append("min("sv); for (size_t i = 0; i < m_values.size(); ++i) { if (i != 0) - TRY(builder.try_append(", "sv)); - TRY(builder.try_append(TRY(m_values[i]->to_string()))); + builder.append(", "sv); + builder.append(m_values[i]->to_string()); } - TRY(builder.try_append(")"sv)); - return builder.to_string(); + builder.append(")"sv); + return MUST(builder.to_string()); } Optional MinCalculationNode::resolved_type() const @@ -648,7 +648,7 @@ void MinCalculationNode::for_each_child_node(Function MinCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}MIN:\n", "", indent)); + builder.appendff("{: >{}}MIN:\n", "", indent); for (auto const& value : m_values) TRY(value->dump(builder, indent + 2)); return {}; @@ -667,17 +667,17 @@ MaxCalculationNode::MaxCalculationNode(Vector> va MaxCalculationNode::~MaxCalculationNode() = default; -ErrorOr MaxCalculationNode::to_string() const +String MaxCalculationNode::to_string() const { StringBuilder builder; - TRY(builder.try_append("max("sv)); + builder.append("max("sv); for (size_t i = 0; i < m_values.size(); ++i) { if (i != 0) - TRY(builder.try_append(", "sv)); - TRY(builder.try_append(TRY(m_values[i]->to_string()))); + builder.append(", "sv); + builder.append(m_values[i]->to_string()); } - TRY(builder.try_append(")"sv)); - return builder.to_string(); + builder.append(")"sv); + return MUST(builder.to_string()); } Optional MaxCalculationNode::resolved_type() const @@ -731,7 +731,7 @@ void MaxCalculationNode::for_each_child_node(Function MaxCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}MAX:\n", "", indent)); + builder.appendff("{: >{}}MAX:\n", "", indent); for (auto const& value : m_values) TRY(value->dump(builder, indent + 2)); return {}; @@ -752,17 +752,17 @@ ClampCalculationNode::ClampCalculationNode(NonnullOwnPtr min, N ClampCalculationNode::~ClampCalculationNode() = default; -ErrorOr ClampCalculationNode::to_string() const +String ClampCalculationNode::to_string() const { StringBuilder builder; - TRY(builder.try_append("clamp("sv)); - TRY(builder.try_append(TRY(m_min_value->to_string()))); - TRY(builder.try_append(", "sv)); - TRY(builder.try_append(TRY(m_center_value->to_string()))); - TRY(builder.try_append(", "sv)); - TRY(builder.try_append(TRY(m_max_value->to_string()))); - TRY(builder.try_append(")"sv)); - return builder.to_string(); + builder.append("clamp("sv); + builder.append(m_min_value->to_string()); + builder.append(", "sv); + builder.append(m_center_value->to_string()); + builder.append(", "sv); + builder.append(m_max_value->to_string()); + builder.append(")"sv); + return MUST(builder.to_string()); } Optional ClampCalculationNode::resolved_type() const @@ -827,7 +827,7 @@ void ClampCalculationNode::for_each_child_node(Function ClampCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}CLAMP:\n", "", indent)); + builder.appendff("{: >{}}CLAMP:\n", "", indent); TRY(m_min_value->dump(builder, indent + 2)); TRY(m_center_value->dump(builder, indent + 2)); TRY(m_max_value->dump(builder, indent + 2)); @@ -847,13 +847,13 @@ AbsCalculationNode::AbsCalculationNode(NonnullOwnPtr value) AbsCalculationNode::~AbsCalculationNode() = default; -ErrorOr AbsCalculationNode::to_string() const +String AbsCalculationNode::to_string() const { StringBuilder builder; builder.append("abs("sv); - builder.append(TRY(m_value->to_string())); + builder.append(m_value->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional AbsCalculationNode::resolved_type() const @@ -893,7 +893,7 @@ void AbsCalculationNode::for_each_child_node(Function AbsCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}ABS: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}ABS: {}\n", "", indent, to_string()); return {}; } @@ -910,13 +910,13 @@ SignCalculationNode::SignCalculationNode(NonnullOwnPtr value) SignCalculationNode::~SignCalculationNode() = default; -ErrorOr SignCalculationNode::to_string() const +String SignCalculationNode::to_string() const { StringBuilder builder; builder.append("sign("sv); - builder.append(TRY(m_value->to_string())); + builder.append(m_value->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional SignCalculationNode::resolved_type() const @@ -958,7 +958,7 @@ void SignCalculationNode::for_each_child_node(Function SignCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}SIGN: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}SIGN: {}\n", "", indent, to_string()); return {}; } @@ -975,7 +975,7 @@ ConstantCalculationNode::ConstantCalculationNode(ConstantType constant) ConstantCalculationNode::~ConstantCalculationNode() = default; -ErrorOr ConstantCalculationNode::to_string() const +String ConstantCalculationNode::to_string() const { switch (m_constant) { case CalculationNode::ConstantType::E: @@ -1027,7 +1027,7 @@ CalculatedStyleValue::CalculationResult ConstantCalculationNode::resolve([[maybe ErrorOr ConstantCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}CONSTANT: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}CONSTANT: {}\n", "", indent, to_string()); return {}; } @@ -1044,13 +1044,13 @@ SinCalculationNode::SinCalculationNode(NonnullOwnPtr value) SinCalculationNode::~SinCalculationNode() = default; -ErrorOr SinCalculationNode::to_string() const +String SinCalculationNode::to_string() const { StringBuilder builder; builder.append("sin("sv); - builder.append(TRY(m_value->to_string())); + builder.append(m_value->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional SinCalculationNode::resolved_type() const @@ -1087,7 +1087,7 @@ void SinCalculationNode::for_each_child_node(Function SinCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}SIN: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}SIN: {}\n", "", indent, to_string()); return {}; } @@ -1104,13 +1104,13 @@ CosCalculationNode::CosCalculationNode(NonnullOwnPtr value) CosCalculationNode::~CosCalculationNode() = default; -ErrorOr CosCalculationNode::to_string() const +String CosCalculationNode::to_string() const { StringBuilder builder; builder.append("cos("sv); - builder.append(TRY(m_value->to_string())); + builder.append(m_value->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional CosCalculationNode::resolved_type() const @@ -1147,7 +1147,7 @@ void CosCalculationNode::for_each_child_node(Function CosCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}COS: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}COS: {}\n", "", indent, to_string()); return {}; } @@ -1164,13 +1164,13 @@ TanCalculationNode::TanCalculationNode(NonnullOwnPtr value) TanCalculationNode::~TanCalculationNode() = default; -ErrorOr TanCalculationNode::to_string() const +String TanCalculationNode::to_string() const { StringBuilder builder; builder.append("tan("sv); - builder.append(TRY(m_value->to_string())); + builder.append(m_value->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional TanCalculationNode::resolved_type() const @@ -1207,7 +1207,7 @@ void TanCalculationNode::for_each_child_node(Function TanCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}TAN: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}TAN: {}\n", "", indent, to_string()); return {}; } @@ -1224,13 +1224,13 @@ AsinCalculationNode::AsinCalculationNode(NonnullOwnPtr value) AsinCalculationNode::~AsinCalculationNode() = default; -ErrorOr AsinCalculationNode::to_string() const +String AsinCalculationNode::to_string() const { StringBuilder builder; builder.append("asin("sv); - builder.append(TRY(m_value->to_string())); + builder.append(m_value->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional AsinCalculationNode::resolved_type() const @@ -1267,7 +1267,7 @@ void AsinCalculationNode::for_each_child_node(Function AsinCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}ASIN: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}ASIN: {}\n", "", indent, to_string()); return {}; } @@ -1284,13 +1284,13 @@ AcosCalculationNode::AcosCalculationNode(NonnullOwnPtr value) AcosCalculationNode::~AcosCalculationNode() = default; -ErrorOr AcosCalculationNode::to_string() const +String AcosCalculationNode::to_string() const { StringBuilder builder; builder.append("acos("sv); - builder.append(TRY(m_value->to_string())); + builder.append(m_value->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional AcosCalculationNode::resolved_type() const @@ -1327,7 +1327,7 @@ void AcosCalculationNode::for_each_child_node(Function AcosCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}ACOS: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}ACOS: {}\n", "", indent, to_string()); return {}; } @@ -1344,13 +1344,13 @@ AtanCalculationNode::AtanCalculationNode(NonnullOwnPtr value) AtanCalculationNode::~AtanCalculationNode() = default; -ErrorOr AtanCalculationNode::to_string() const +String AtanCalculationNode::to_string() const { StringBuilder builder; builder.append("atan("sv); - builder.append(TRY(m_value->to_string())); + builder.append(m_value->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional AtanCalculationNode::resolved_type() const @@ -1387,7 +1387,7 @@ void AtanCalculationNode::for_each_child_node(Function AtanCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}ATAN: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}ATAN: {}\n", "", indent, to_string()); return {}; } @@ -1405,15 +1405,15 @@ Atan2CalculationNode::Atan2CalculationNode(NonnullOwnPtr y, Non Atan2CalculationNode::~Atan2CalculationNode() = default; -ErrorOr Atan2CalculationNode::to_string() const +String Atan2CalculationNode::to_string() const { StringBuilder builder; builder.append("atan2("sv); - builder.append(TRY(m_y->to_string())); + builder.append(m_y->to_string()); builder.append(", "sv); - builder.append(TRY(m_x->to_string())); + builder.append(m_x->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional Atan2CalculationNode::resolved_type() const @@ -1456,7 +1456,7 @@ void Atan2CalculationNode::for_each_child_node(Function Atan2CalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}ATAN2: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}ATAN2: {}\n", "", indent, to_string()); return {}; } @@ -1474,15 +1474,15 @@ PowCalculationNode::PowCalculationNode(NonnullOwnPtr x, Nonnull PowCalculationNode::~PowCalculationNode() = default; -ErrorOr PowCalculationNode::to_string() const +String PowCalculationNode::to_string() const { StringBuilder builder; builder.append("pow("sv); - builder.append(TRY(m_x->to_string())); + builder.append(m_x->to_string()); builder.append(", "sv); - builder.append(TRY(m_y->to_string())); + builder.append(m_y->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional PowCalculationNode::resolved_type() const @@ -1520,7 +1520,7 @@ void PowCalculationNode::for_each_child_node(Function PowCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}POW: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}POW: {}\n", "", indent, to_string()); return {}; } @@ -1537,13 +1537,13 @@ SqrtCalculationNode::SqrtCalculationNode(NonnullOwnPtr value) SqrtCalculationNode::~SqrtCalculationNode() = default; -ErrorOr SqrtCalculationNode::to_string() const +String SqrtCalculationNode::to_string() const { StringBuilder builder; builder.append("sqrt("sv); - builder.append(TRY(m_value->to_string())); + builder.append(m_value->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional SqrtCalculationNode::resolved_type() const @@ -1575,7 +1575,7 @@ void SqrtCalculationNode::for_each_child_node(Function SqrtCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}SQRT: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}SQRT: {}\n", "", indent, to_string()); return {}; } @@ -1592,17 +1592,17 @@ HypotCalculationNode::HypotCalculationNode(Vector HypotCalculationNode::~HypotCalculationNode() = default; -ErrorOr HypotCalculationNode::to_string() const +String HypotCalculationNode::to_string() const { StringBuilder builder; - TRY(builder.try_append("hypot("sv)); + builder.append("hypot("sv); for (size_t i = 0; i < m_values.size(); ++i) { if (i != 0) - TRY(builder.try_append(", "sv)); - TRY(builder.try_append(TRY(m_values[i]->to_string()))); + builder.append(", "sv); + builder.append(m_values[i]->to_string()); } - TRY(builder.try_append(")"sv)); - return builder.to_string(); + builder.append(")"sv); + return MUST(builder.to_string()); } Optional HypotCalculationNode::resolved_type() const @@ -1654,7 +1654,7 @@ void HypotCalculationNode::for_each_child_node(Function HypotCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}HYPOT:\n", "", indent)); + builder.appendff("{: >{}}HYPOT:\n", "", indent); for (auto const& value : m_values) TRY(value->dump(builder, indent + 2)); return {}; @@ -1674,15 +1674,15 @@ LogCalculationNode::LogCalculationNode(NonnullOwnPtr x, Nonnull LogCalculationNode::~LogCalculationNode() = default; -ErrorOr LogCalculationNode::to_string() const +String LogCalculationNode::to_string() const { StringBuilder builder; builder.append("log("sv); - builder.append(TRY(m_x->to_string())); + builder.append(m_x->to_string()); builder.append(", "sv); - builder.append(TRY(m_y->to_string())); + builder.append(m_y->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional LogCalculationNode::resolved_type() const @@ -1720,7 +1720,7 @@ void LogCalculationNode::for_each_child_node(Function LogCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}LOG: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}LOG: {}\n", "", indent, to_string()); return {}; } @@ -1737,13 +1737,13 @@ ExpCalculationNode::ExpCalculationNode(NonnullOwnPtr value) ExpCalculationNode::~ExpCalculationNode() = default; -ErrorOr ExpCalculationNode::to_string() const +String ExpCalculationNode::to_string() const { StringBuilder builder; builder.append("exp("sv); - builder.append(TRY(m_value->to_string())); + builder.append(m_value->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional ExpCalculationNode::resolved_type() const @@ -1775,7 +1775,7 @@ void ExpCalculationNode::for_each_child_node(Function ExpCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}EXP: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}EXP: {}\n", "", indent, to_string()); return {}; } @@ -1794,17 +1794,17 @@ RoundCalculationNode::RoundCalculationNode(RoundingStrategy mode, NonnullOwnPtr< RoundCalculationNode::~RoundCalculationNode() = default; -ErrorOr RoundCalculationNode::to_string() const +String RoundCalculationNode::to_string() const { StringBuilder builder; builder.append("round("sv); builder.append(CSS::to_string(m_strategy)); builder.append(", "sv); - builder.append(TRY(m_x->to_string())); + builder.append(m_x->to_string()); builder.append(", "sv); - builder.append(TRY(m_y->to_string())); + builder.append(m_y->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional RoundCalculationNode::resolved_type() const @@ -1878,7 +1878,7 @@ void RoundCalculationNode::for_each_child_node(Function RoundCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}ROUND: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}ROUND: {}\n", "", indent, to_string()); return {}; } @@ -1896,15 +1896,15 @@ ModCalculationNode::ModCalculationNode(NonnullOwnPtr x, Nonnull ModCalculationNode::~ModCalculationNode() = default; -ErrorOr ModCalculationNode::to_string() const +String ModCalculationNode::to_string() const { StringBuilder builder; builder.append("mod("sv); - builder.append(TRY(m_x->to_string())); + builder.append(m_x->to_string()); builder.append(", "sv); - builder.append(TRY(m_y->to_string())); + builder.append(m_y->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional ModCalculationNode::resolved_type() const @@ -1955,7 +1955,7 @@ void ModCalculationNode::for_each_child_node(Function ModCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}MOD: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}MOD: {}\n", "", indent, to_string()); return {}; } @@ -1973,15 +1973,15 @@ RemCalculationNode::RemCalculationNode(NonnullOwnPtr x, Nonnull RemCalculationNode::~RemCalculationNode() = default; -ErrorOr RemCalculationNode::to_string() const +String RemCalculationNode::to_string() const { StringBuilder builder; builder.append("rem("sv); - builder.append(TRY(m_x->to_string())); + builder.append(m_x->to_string()); builder.append(", "sv); - builder.append(TRY(m_y->to_string())); + builder.append(m_y->to_string()); builder.append(")"sv); - return builder.to_string(); + return MUST(builder.to_string()); } Optional RemCalculationNode::resolved_type() const @@ -2031,7 +2031,7 @@ void RemCalculationNode::for_each_child_node(Function RemCalculationNode::dump(StringBuilder& builder, int indent) const { - TRY(builder.try_appendff("{: >{}}REM: {}\n", "", indent, TRY(to_string()))); + builder.appendff("{: >{}}REM: {}\n", "", indent, to_string()); return {}; } @@ -2269,10 +2269,10 @@ void CalculatedStyleValue::CalculationResult::invert() }); } -ErrorOr CalculatedStyleValue::to_string() const +String CalculatedStyleValue::to_string() const { // FIXME: Implement this according to https://www.w3.org/TR/css-values-4/#calc-serialize once that stabilizes. - return String::formatted("calc({})", TRY(m_calculation->to_string())); + return MUST(String::formatted("calc({})", m_calculation->to_string())); } bool CalculatedStyleValue::equals(StyleValue const& other) const @@ -2280,7 +2280,7 @@ bool CalculatedStyleValue::equals(StyleValue const& other) const if (type() != other.type()) return false; // This is a case where comparing the strings actually makes sense. - return to_string().release_value_but_fixme_should_propagate_errors() == other.to_string().release_value_but_fixme_should_propagate_errors(); + return to_string() == other.to_string(); } Optional CalculatedStyleValue::resolve_angle() const diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/CalculatedStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/CalculatedStyleValue.h index a8d68fc770e..0869b22a86c 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/CalculatedStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/CalculatedStyleValue.h @@ -71,7 +71,7 @@ public: return adopt_ref(*new (nothrow) CalculatedStyleValue(move(calculation), resolved_type)); } - ErrorOr to_string() const override; + String to_string() const override; virtual bool equals(StyleValue const& other) const override; bool resolves_to_angle() const { return m_resolved_type.matches_angle(); } @@ -233,7 +233,7 @@ public: return first_is_one_of(m_type, Type::Sum, Type::Product, Type::Negate, Type::Invert); } - virtual ErrorOr to_string() const = 0; + virtual String to_string() const = 0; virtual Optional resolved_type() const = 0; virtual Optional determine_type(PropertyID) const = 0; virtual bool contains_percentage() const = 0; @@ -254,7 +254,7 @@ public: static NonnullOwnPtr create(NumericValue); ~NumericCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -273,7 +273,7 @@ public: static NonnullOwnPtr create(Vector>); ~SumCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -292,7 +292,7 @@ public: static NonnullOwnPtr create(Vector>); ~ProductCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -311,7 +311,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr); ~NegateCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -330,7 +330,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr); ~InvertCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -349,7 +349,7 @@ public: static NonnullOwnPtr create(Vector>); ~MinCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -368,7 +368,7 @@ public: static NonnullOwnPtr create(Vector>); ~MaxCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -387,7 +387,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr, NonnullOwnPtr, NonnullOwnPtr); ~ClampCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -408,7 +408,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr); ~AbsCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -427,7 +427,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr); ~SignCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -446,7 +446,7 @@ public: static NonnullOwnPtr create(CalculationNode::ConstantType); ~ConstantCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override { return false; } @@ -465,7 +465,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr); ~SinCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -484,7 +484,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr); ~CosCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -503,7 +503,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr); ~TanCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -522,7 +522,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr); ~AsinCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -541,7 +541,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr); ~AcosCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -560,7 +560,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr); ~AtanCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -579,7 +579,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr, NonnullOwnPtr); ~Atan2CalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -599,7 +599,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr, NonnullOwnPtr); ~PowCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override { return false; } @@ -619,7 +619,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr); ~SqrtCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override { return false; } @@ -638,7 +638,7 @@ public: static NonnullOwnPtr create(Vector>); ~HypotCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -657,7 +657,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr, NonnullOwnPtr); ~LogCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override { return false; } @@ -677,7 +677,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr); ~ExpCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override { return false; } @@ -696,7 +696,7 @@ public: static NonnullOwnPtr create(RoundingStrategy, NonnullOwnPtr, NonnullOwnPtr); ~RoundCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -717,7 +717,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr, NonnullOwnPtr); ~ModCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; @@ -737,7 +737,7 @@ public: static NonnullOwnPtr create(NonnullOwnPtr, NonnullOwnPtr); ~RemCalculationNode(); - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual Optional resolved_type() const override; virtual Optional determine_type(PropertyID) const override; virtual bool contains_percentage() const override; diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ColorStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/ColorStyleValue.cpp index 906d7de16c8..dbeb3f2cace 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ColorStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ColorStyleValue.cpp @@ -32,7 +32,7 @@ ValueComparingNonnullRefPtr ColorStyleValue::create(Color color return adopt_ref(*new (nothrow) ColorStyleValue(color)); } -ErrorOr ColorStyleValue::to_string() const +String ColorStyleValue::to_string() const { return serialize_a_srgb_value(m_color); } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ColorStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/ColorStyleValue.h index 414d8d2a8d4..bc8a2382fe1 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ColorStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ColorStyleValue.h @@ -20,7 +20,7 @@ public: virtual ~ColorStyleValue() override = default; Color color() const { return m_color; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual bool has_color() const override { return true; } virtual Color to_color(Optional) const override { return m_color; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/CompositeStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/CompositeStyleValue.cpp index c7ff0f2656f..1fceaf28c76 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/CompositeStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/CompositeStyleValue.cpp @@ -21,7 +21,7 @@ CompositeStyleValue::CompositeStyleValue(Vector sub_properties, Vect CompositeStyleValue::~CompositeStyleValue() = default; -ErrorOr CompositeStyleValue::to_string() const +String CompositeStyleValue::to_string() const { StringBuilder builder; auto first = true; @@ -30,9 +30,9 @@ ErrorOr CompositeStyleValue::to_string() const first = false; else builder.append(' '); - builder.append(TRY(value->to_string())); + builder.append(value->to_string()); } - return builder.to_string(); + return MUST(builder.to_string()); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/CompositeStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/CompositeStyleValue.h index f3ebd44c87b..c28be565a85 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/CompositeStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/CompositeStyleValue.h @@ -21,7 +21,7 @@ public: Vector const& sub_properties() const { return m_properties.sub_properties; } Vector> const& values() const { return m_properties.values; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(CompositeStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ConicGradientStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/ConicGradientStyleValue.cpp index 2b9848da931..7ea0e398260 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ConicGradientStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ConicGradientStyleValue.cpp @@ -12,27 +12,27 @@ namespace Web::CSS { -ErrorOr ConicGradientStyleValue::to_string() const +String ConicGradientStyleValue::to_string() const { StringBuilder builder; if (is_repeating()) - TRY(builder.try_append("repeating-"sv)); - TRY(builder.try_append("conic-gradient("sv)); + builder.append("repeating-"sv); + builder.append("conic-gradient("sv); bool has_from_angle = false; bool has_at_position = false; if ((has_from_angle = m_properties.from_angle.to_degrees() != 0)) - TRY(builder.try_appendff("from {}", m_properties.from_angle.to_string())); + builder.appendff("from {}", m_properties.from_angle.to_string()); if ((has_at_position = m_properties.position != PositionValue::center())) { if (has_from_angle) - TRY(builder.try_append(' ')); - TRY(builder.try_appendff("at "sv)); + builder.append(' '); + builder.appendff("at "sv); m_properties.position.serialize(builder); } if (has_from_angle || has_at_position) - TRY(builder.try_append(", "sv)); - TRY(serialize_color_stop_list(builder, m_properties.color_stop_list)); - TRY(builder.try_append(')')); - return builder.to_string(); + builder.append(", "sv); + serialize_color_stop_list(builder, m_properties.color_stop_list); + builder.append(')'); + return MUST(builder.to_string()); } void ConicGradientStyleValue::resolve_for_size(Layout::NodeWithStyleAndBoxModelMetrics const& node, CSSPixelSize size) const diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ConicGradientStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/ConicGradientStyleValue.h index 7c5888c8af9..20f91d7293a 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ConicGradientStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ConicGradientStyleValue.h @@ -24,7 +24,7 @@ public: return adopt_ref(*new (nothrow) ConicGradientStyleValue(from_angle, position, move(color_stop_list), repeating)); } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; void paint(PaintContext&, DevicePixelRect const& dest_rect, CSS::ImageRendering) const override; diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.cpp index 5a476a21f8f..dad975955c2 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.cpp @@ -12,10 +12,10 @@ namespace Web::CSS { -ErrorOr ContentStyleValue::to_string() const +String ContentStyleValue::to_string() const { if (has_alt_text()) - return String::formatted("{} / {}", TRY(m_properties.content->to_string()), TRY(m_properties.alt_text->to_string())); + return MUST(String::formatted("{} / {}", m_properties.content->to_string(), m_properties.alt_text->to_string())); return m_properties.content->to_string(); } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.h index 4124317f2e5..c8b496521c7 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.h @@ -25,7 +25,7 @@ public: bool has_alt_text() const { return !m_properties.alt_text.is_null(); } StyleValueList const* alt_text() const { return m_properties.alt_text; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(ContentStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/CustomIdentStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/CustomIdentStyleValue.h index 2db44a3eced..af7538dcbb0 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/CustomIdentStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/CustomIdentStyleValue.h @@ -22,7 +22,7 @@ public: FlyString const& custom_ident() const { return m_custom_ident; } - virtual ErrorOr to_string() const override { return m_custom_ident.to_string(); } + virtual String to_string() const override { return m_custom_ident.to_string(); } bool properties_equal(CustomIdentStyleValue const& other) const { return m_custom_ident == other.m_custom_ident; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/DisplayStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/DisplayStyleValue.h index 474af6a20c6..7098f9c52ce 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/DisplayStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/DisplayStyleValue.h @@ -16,7 +16,7 @@ public: static ValueComparingNonnullRefPtr create(Display const&); virtual ~DisplayStyleValue() override = default; - virtual ErrorOr to_string() const override { return m_display.to_string(); } + virtual String to_string() const override { return m_display.to_string(); } Display display() const { return m_display; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.cpp index 762b7e76d86..331e0595452 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.cpp @@ -13,7 +13,7 @@ namespace Web::CSS { -ErrorOr EasingStyleValue::to_string() const +String EasingStyleValue::to_string() const { if (m_properties.easing_function == EasingFunction::StepStart) return "steps(1, start)"_string; @@ -21,20 +21,20 @@ ErrorOr EasingStyleValue::to_string() const return "steps(1, end)"_string; StringBuilder builder; - TRY(builder.try_append(CSS::to_string(m_properties.easing_function))); + builder.append(CSS::to_string(m_properties.easing_function)); if (m_properties.values.is_empty()) - return builder.to_string(); + return MUST(builder.to_string()); - TRY(builder.try_append('(')); + builder.append('('); for (size_t i = 0; i < m_properties.values.size(); ++i) { - TRY(builder.try_append(TRY(m_properties.values[i]->to_string()))); + builder.append(m_properties.values[i]->to_string()); if (i != m_properties.values.size() - 1) - TRY(builder.try_append(", "sv)); + builder.append(", "sv); } - TRY(builder.try_append(')')); + builder.append(')'); - return builder.to_string(); + return MUST(builder.to_string()); } bool EasingStyleValue::Properties::operator==(Properties const& other) const diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.h index d5fc007d74f..fae12ac36b5 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.h @@ -26,7 +26,7 @@ public: CSS::EasingFunction easing_function() const { return m_properties.easing_function; } StyleValueVector values() const { return m_properties.values; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(EasingStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/EdgeStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/EdgeStyleValue.cpp index 1da444f5c4b..3f2de9e9c1f 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/EdgeStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/EdgeStyleValue.cpp @@ -8,7 +8,7 @@ namespace Web::CSS { -ErrorOr EdgeStyleValue::to_string() const +String EdgeStyleValue::to_string() const { auto to_string = [](PositionEdge edge) { switch (edge) { @@ -24,7 +24,7 @@ ErrorOr EdgeStyleValue::to_string() const VERIFY_NOT_REACHED(); }; - return String::formatted("{} {}", to_string(m_properties.edge), m_properties.offset.to_string()); + return MUST(String::formatted("{} {}", to_string(m_properties.edge), m_properties.offset.to_string())); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/EdgeStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/EdgeStyleValue.h index 0fdec935123..ee97637bc68 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/EdgeStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/EdgeStyleValue.h @@ -23,7 +23,7 @@ public: PositionEdge edge() const { return m_properties.edge; } LengthPercentage const& offset() const { return m_properties.offset; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(EdgeStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/FilterValueListStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/FilterValueListStyleValue.cpp index c860cf7f9c5..b877129cc85 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/FilterValueListStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/FilterValueListStyleValue.cpp @@ -54,46 +54,43 @@ float Filter::Color::resolved_amount() const return 1.0f; } -ErrorOr FilterValueListStyleValue::to_string() const +String FilterValueListStyleValue::to_string() const { StringBuilder builder {}; bool first = true; for (auto& filter_function : filter_value_list()) { if (!first) - TRY(builder.try_append(' ')); - TRY(filter_function.visit( - [&](Filter::Blur const& blur) -> ErrorOr { - TRY(builder.try_append("blur("sv)); + builder.append(' '); + filter_function.visit( + [&](Filter::Blur const& blur) { + builder.append("blur("sv); if (blur.radius.has_value()) - TRY(builder.try_append(blur.radius->to_string())); - return {}; + builder.append(blur.radius->to_string()); }, - [&](Filter::DropShadow const& drop_shadow) -> ErrorOr { - TRY(builder.try_appendff("drop-shadow({} {}"sv, - drop_shadow.offset_x, drop_shadow.offset_y)); + [&](Filter::DropShadow const& drop_shadow) { + builder.appendff("drop-shadow({} {}"sv, + drop_shadow.offset_x, drop_shadow.offset_y); if (drop_shadow.radius.has_value()) - TRY(builder.try_appendff(" {}", drop_shadow.radius->to_string())); + builder.appendff(" {}", drop_shadow.radius->to_string()); if (drop_shadow.color.has_value()) { - TRY(builder.try_append(' ')); + builder.append(' '); serialize_a_srgb_value(builder, *drop_shadow.color); } - return {}; }, - [&](Filter::HueRotate const& hue_rotate) -> ErrorOr { - TRY(builder.try_append("hue-rotate("sv)); + [&](Filter::HueRotate const& hue_rotate) { + builder.append("hue-rotate("sv); if (hue_rotate.angle.has_value()) { - TRY(hue_rotate.angle->visit( - [&](Angle const& angle) -> ErrorOr { - return builder.try_append(angle.to_string()); + hue_rotate.angle->visit( + [&](Angle const& angle) { + return builder.append(angle.to_string()); }, - [&](auto&) -> ErrorOr { - return builder.try_append('0'); - })); + [&](auto&) { + return builder.append('0'); + }); } - return {}; }, - [&](Filter::Color const& color) -> ErrorOr { - TRY(builder.try_appendff("{}(", + [&](Filter::Color const& color) { + builder.appendff("{}(", [&] { switch (color.operation) { case Filter::Color::Operation::Brightness: @@ -113,15 +110,14 @@ ErrorOr FilterValueListStyleValue::to_string() const default: VERIFY_NOT_REACHED(); } - }())); + }()); if (color.amount.has_value()) - TRY(builder.try_append(color.amount->to_string())); - return {}; - })); - TRY(builder.try_append(')')); + builder.append(color.amount->to_string()); + }); + builder.append(')'); first = false; } - return builder.to_string(); + return MUST(builder.to_string()); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/FilterValueListStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/FilterValueListStyleValue.h index 3fb1830ae1a..8d65b2e699f 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/FilterValueListStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/FilterValueListStyleValue.h @@ -79,7 +79,7 @@ public: Vector const& filter_value_list() const { return m_filter_value_list; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual ~FilterValueListStyleValue() override = default; diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/FlexFlowStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/FlexFlowStyleValue.cpp index 604a8166078..10751826ec9 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/FlexFlowStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/FlexFlowStyleValue.cpp @@ -11,9 +11,9 @@ namespace Web::CSS { -ErrorOr FlexFlowStyleValue::to_string() const +String FlexFlowStyleValue::to_string() const { - return String::formatted("{} {}", TRY(m_properties.flex_direction->to_string()), TRY(m_properties.flex_wrap->to_string())); + return MUST(String::formatted("{} {}", m_properties.flex_direction->to_string(), m_properties.flex_wrap->to_string())); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/FlexFlowStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/FlexFlowStyleValue.h index 5ea5f30b948..93d848d07f2 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/FlexFlowStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/FlexFlowStyleValue.h @@ -24,7 +24,7 @@ public: ValueComparingNonnullRefPtr flex_direction() const { return m_properties.flex_direction; } ValueComparingNonnullRefPtr flex_wrap() const { return m_properties.flex_wrap; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(FlexFlowStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/FlexStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/FlexStyleValue.cpp index 6f4a8c39951..8e9e5ab1a31 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/FlexStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/FlexStyleValue.cpp @@ -11,9 +11,9 @@ namespace Web::CSS { -ErrorOr FlexStyleValue::to_string() const +String FlexStyleValue::to_string() const { - return String::formatted("{} {} {}", TRY(m_properties.grow->to_string()), TRY(m_properties.shrink->to_string()), TRY(m_properties.basis->to_string())); + return MUST(String::formatted("{} {} {}", m_properties.grow->to_string(), m_properties.shrink->to_string(), m_properties.basis->to_string())); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/FlexStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/FlexStyleValue.h index 6cfa5301657..20350015a8f 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/FlexStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/FlexStyleValue.h @@ -28,7 +28,7 @@ public: ValueComparingNonnullRefPtr shrink() const { return m_properties.shrink; } ValueComparingNonnullRefPtr basis() const { return m_properties.basis; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(FlexStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/FontStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/FontStyleValue.cpp index 3536e578cf2..937460a3685 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/FontStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/FontStyleValue.cpp @@ -11,9 +11,9 @@ namespace Web::CSS { -ErrorOr FontStyleValue::to_string() const +String FontStyleValue::to_string() const { - return String::formatted("{} {} {} / {} {}", TRY(m_properties.font_style->to_string()), TRY(m_properties.font_weight->to_string()), TRY(m_properties.font_size->to_string()), TRY(m_properties.line_height->to_string()), TRY(m_properties.font_families->to_string())); + return MUST(String::formatted("{} {} {} / {} {}", m_properties.font_style->to_string(), m_properties.font_weight->to_string(), m_properties.font_size->to_string(), m_properties.line_height->to_string(), m_properties.font_families->to_string())); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/FontStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/FontStyleValue.h index 64441bd5bf3..75411f4b72c 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/FontStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/FontStyleValue.h @@ -34,7 +34,7 @@ public: ValueComparingNonnullRefPtr line_height() const { return m_properties.line_height; } ValueComparingNonnullRefPtr font_families() const { return m_properties.font_families; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(FontStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/FrequencyStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/FrequencyStyleValue.h index 1a6c96ba3e6..d5c9d5303a7 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/FrequencyStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/FrequencyStyleValue.h @@ -24,7 +24,7 @@ public: Frequency const& frequency() const { return m_frequency; } - virtual ErrorOr to_string() const override { return m_frequency.to_string(); } + virtual String to_string() const override { return m_frequency.to_string(); } bool properties_equal(FrequencyStyleValue const& other) const { return m_frequency == other.m_frequency; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.cpp index 051e9deba1e..e53cd2730ed 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.cpp @@ -30,18 +30,18 @@ ValueComparingNonnullRefPtr GridAreaShorthandStyleV GridTrackPlacementStyleValue::create(column_end))); } -ErrorOr GridAreaShorthandStyleValue::to_string() const +String GridAreaShorthandStyleValue::to_string() const { StringBuilder builder; if (!m_properties.row_start->as_grid_track_placement().grid_track_placement().is_auto()) - TRY(builder.try_appendff("{}", m_properties.row_start->as_grid_track_placement().grid_track_placement().to_string())); + builder.appendff("{}", m_properties.row_start->as_grid_track_placement().grid_track_placement().to_string()); if (!m_properties.column_start->as_grid_track_placement().grid_track_placement().is_auto()) - TRY(builder.try_appendff(" / {}", m_properties.column_start->as_grid_track_placement().grid_track_placement().to_string())); + builder.appendff(" / {}", m_properties.column_start->as_grid_track_placement().grid_track_placement().to_string()); if (!m_properties.row_end->as_grid_track_placement().grid_track_placement().is_auto()) - TRY(builder.try_appendff(" / {}", m_properties.row_end->as_grid_track_placement().grid_track_placement().to_string())); + builder.appendff(" / {}", m_properties.row_end->as_grid_track_placement().grid_track_placement().to_string()); if (!m_properties.column_end->as_grid_track_placement().grid_track_placement().is_auto()) - TRY(builder.try_appendff(" / {}", m_properties.column_end->as_grid_track_placement().grid_track_placement().to_string())); - return builder.to_string(); + builder.appendff(" / {}", m_properties.column_end->as_grid_track_placement().grid_track_placement().to_string()); + return MUST(builder.to_string()); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.h index 9f63da82ff2..4c296fa7069 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.h @@ -28,7 +28,7 @@ public: auto row_end() const { return m_properties.row_end; } auto column_end() const { return m_properties.column_end; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(GridAreaShorthandStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridAutoFlowStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/GridAutoFlowStyleValue.cpp index bd520623cbb..9bc91e8e69c 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridAutoFlowStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridAutoFlowStyleValue.cpp @@ -13,7 +13,7 @@ ValueComparingNonnullRefPtr GridAutoFlowStyleValue::crea return adopt_ref(*new GridAutoFlowStyleValue(axis, dense)); } -ErrorOr GridAutoFlowStyleValue::to_string() const +String GridAutoFlowStyleValue::to_string() const { StringBuilder builder; if (m_row) @@ -22,7 +22,7 @@ ErrorOr GridAutoFlowStyleValue::to_string() const builder.append("column"sv); if (m_dense) builder.append(" dense"sv); - return builder.to_string(); + return MUST(builder.to_string()); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridAutoFlowStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/GridAutoFlowStyleValue.h index ff419389915..a49e5f4e7e9 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridAutoFlowStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridAutoFlowStyleValue.h @@ -27,7 +27,7 @@ public: [[nodiscard]] bool is_column() const { return !m_row; } [[nodiscard]] bool is_dense() const { return m_dense; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(GridAutoFlowStyleValue const& other) const { return m_row == other.m_row && m_dense == other.m_dense; } private: diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTemplateAreaStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTemplateAreaStyleValue.cpp index b9ad7a3e22d..4245d2dae5c 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTemplateAreaStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTemplateAreaStyleValue.cpp @@ -16,19 +16,19 @@ ValueComparingNonnullRefPtr GridTemplateAreaStyleVal return adopt_ref(*new (nothrow) GridTemplateAreaStyleValue(grid_template_area)); } -ErrorOr GridTemplateAreaStyleValue::to_string() const +String GridTemplateAreaStyleValue::to_string() const { StringBuilder builder; for (size_t y = 0; y < m_grid_template_area.size(); ++y) { for (size_t x = 0; x < m_grid_template_area[y].size(); ++x) { - TRY(builder.try_appendff("{}", m_grid_template_area[y][x])); + builder.appendff("{}", m_grid_template_area[y][x]); if (x < m_grid_template_area[y].size() - 1) - TRY(builder.try_append(" "sv)); + builder.append(" "sv); } if (y < m_grid_template_area.size() - 1) - TRY(builder.try_append(", "sv)); + builder.append(", "sv); } - return builder.to_string(); + return MUST(builder.to_string()); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTemplateAreaStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTemplateAreaStyleValue.h index 61d3cad017e..87fb7685ab7 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTemplateAreaStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTemplateAreaStyleValue.h @@ -19,7 +19,7 @@ public: virtual ~GridTemplateAreaStyleValue() override = default; Vector> const& grid_template_area() const { return m_grid_template_area; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(GridTemplateAreaStyleValue const& other) const { return m_grid_template_area == other.m_grid_template_area; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementShorthandStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementShorthandStyleValue.cpp index 6924bffd5d0..b1639a71e52 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementShorthandStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementShorthandStyleValue.cpp @@ -24,11 +24,11 @@ ValueComparingNonnullRefPtr GridTrackPlac GridTrackPlacementStyleValue::create(GridTrackPlacement::make_auto()))); } -ErrorOr GridTrackPlacementShorthandStyleValue::to_string() const +String GridTrackPlacementShorthandStyleValue::to_string() const { if (m_properties.end->grid_track_placement().is_auto()) - return String::formatted("{}", m_properties.start->grid_track_placement().to_string()); - return String::formatted("{} / {}", m_properties.start->grid_track_placement().to_string(), m_properties.end->grid_track_placement().to_string()); + return MUST(String::formatted("{}", m_properties.start->grid_track_placement().to_string())); + return MUST(String::formatted("{} / {}", m_properties.start->grid_track_placement().to_string(), m_properties.end->grid_track_placement().to_string())); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementShorthandStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementShorthandStyleValue.h index bb21a7f0c6a..0a744254fcb 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementShorthandStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementShorthandStyleValue.h @@ -22,7 +22,7 @@ public: auto start() const { return m_properties.start; } auto end() const { return m_properties.end; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(GridTrackPlacementShorthandStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementStyleValue.cpp index d594340efdf..dccbfc95459 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementStyleValue.cpp @@ -16,7 +16,7 @@ ValueComparingNonnullRefPtr GridTrackPlacementStyl return adopt_ref(*new (nothrow) GridTrackPlacementStyleValue(grid_track_placement)); } -ErrorOr GridTrackPlacementStyleValue::to_string() const +String GridTrackPlacementStyleValue::to_string() const { return m_grid_track_placement.to_string(); } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementStyleValue.h index 7f69c0553e0..eb6096a1139 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackPlacementStyleValue.h @@ -20,7 +20,7 @@ public: virtual ~GridTrackPlacementStyleValue() override = default; GridTrackPlacement const& grid_track_placement() const { return m_grid_track_placement; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(GridTrackPlacementStyleValue const& other) const { return m_grid_track_placement == other.m_grid_track_placement; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListShorthandStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListShorthandStyleValue.cpp index 1f027355384..ac9a655f0c7 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListShorthandStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListShorthandStyleValue.cpp @@ -17,32 +17,32 @@ ValueComparingNonnullRefPtr GridTrackSizeL return adopt_ref(*new (nothrow) GridTrackSizeListShorthandStyleValue(move(areas), move(rows), move(columns))); } -ErrorOr GridTrackSizeListShorthandStyleValue::to_string() const +String GridTrackSizeListShorthandStyleValue::to_string() const { - auto construct_rows_string = [&]() -> ErrorOr { + auto construct_rows_string = [&]() { StringBuilder builder; size_t idx = 0; for (auto const& row : m_properties.rows->grid_track_size_list().track_list()) { if (m_properties.areas->grid_template_area().size() > idx) { - TRY(builder.try_append("\""sv)); + builder.append("\""sv); for (size_t y = 0; y < m_properties.areas->grid_template_area()[idx].size(); ++y) { - TRY(builder.try_append(m_properties.areas->grid_template_area()[idx][y])); + builder.append(m_properties.areas->grid_template_area()[idx][y]); if (y != m_properties.areas->grid_template_area()[idx].size() - 1) - TRY(builder.try_append(" "sv)); + builder.append(" "sv); } - TRY(builder.try_append("\" "sv)); + builder.append("\" "sv); } - TRY(builder.try_append(row.to_string())); + builder.append(row.to_string()); if (idx < m_properties.rows->grid_track_size_list().track_list().size() - 1) - TRY(builder.try_append(' ')); + builder.append(' '); idx++; } - return TRY(builder.to_string()); + return MUST(builder.to_string()); }; if (m_properties.columns->grid_track_size_list().track_list().size() == 0) - return String::formatted("{}", TRY(construct_rows_string())); - return String::formatted("{} / {}", TRY(construct_rows_string()), m_properties.columns->grid_track_size_list().to_string()); + return MUST(String::formatted("{}", construct_rows_string())); + return MUST(String::formatted("{} / {}", construct_rows_string(), m_properties.columns->grid_track_size_list().to_string())); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListShorthandStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListShorthandStyleValue.h index b7842187d44..0bce10cf741 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListShorthandStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListShorthandStyleValue.h @@ -23,7 +23,7 @@ public: auto columns() const { return m_properties.columns; } auto areas() const { return m_properties.areas; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(GridTrackSizeListShorthandStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListStyleValue.cpp index 7d73c282f4d..a4f46ee3f47 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListStyleValue.cpp @@ -11,7 +11,7 @@ namespace Web::CSS { -ErrorOr GridTrackSizeListStyleValue::to_string() const +String GridTrackSizeListStyleValue::to_string() const { return m_grid_track_size_list.to_string(); } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListStyleValue.h index e3f68a4c8e4..9a56b9ae0a0 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridTrackSizeListStyleValue.h @@ -24,7 +24,7 @@ public: CSS::GridTrackSizeList grid_track_size_list() const { return m_grid_track_size_list; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(GridTrackSizeListStyleValue const& other) const { return m_grid_track_size_list == other.m_grid_track_size_list; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp index 996ca997f29..0c78e5b5c4d 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp @@ -14,9 +14,9 @@ namespace Web::CSS { -ErrorOr IdentifierStyleValue::to_string() const +String IdentifierStyleValue::to_string() const { - return String::from_utf8(CSS::string_from_value_id(m_id)); + return MUST(String::from_utf8(CSS::string_from_value_id(m_id))); } bool IdentifierStyleValue::has_color() const diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.h index bcbefdd95e6..fc385948d27 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.h @@ -26,7 +26,7 @@ public: virtual bool has_color() const override; virtual Color to_color(Optional node) const override; - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(IdentifierStyleValue const& other) const { return m_id == other.m_id; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp index 3e02996b01b..03cb270c42a 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp @@ -97,7 +97,7 @@ Gfx::Bitmap const* ImageStyleValue::bitmap(size_t frame_index, Gfx::IntSize size return nullptr; } -ErrorOr ImageStyleValue::to_string() const +String ImageStyleValue::to_string() const { return serialize_a_url(m_url.to_deprecated_string()); } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h index c50cb26d24b..6565d4d16db 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h @@ -26,7 +26,7 @@ public: } virtual ~ImageStyleValue() override = default; - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual bool equals(StyleValue const& other) const override; virtual void load_any_resources(DOM::Document&) override; diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/InheritStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/InheritStyleValue.h index 4b43408cc07..ff4c9f17738 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/InheritStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/InheritStyleValue.h @@ -19,7 +19,7 @@ public: } virtual ~InheritStyleValue() override = default; - ErrorOr to_string() const override { return "inherit"_string; } + String to_string() const override { return "inherit"_string; } bool properties_equal(InheritStyleValue const&) const { return true; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/InitialStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/InitialStyleValue.h index 2eb6204f5cc..8ccdae93f76 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/InitialStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/InitialStyleValue.h @@ -19,7 +19,7 @@ public: } virtual ~InitialStyleValue() override = default; - ErrorOr to_string() const override { return "initial"_string; } + String to_string() const override { return "initial"_string; } bool properties_equal(InitialStyleValue const&) const { return true; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/IntegerStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/IntegerStyleValue.cpp index a8ae8beaa2b..c0f761d27db 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/IntegerStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/IntegerStyleValue.cpp @@ -8,9 +8,9 @@ namespace Web::CSS { -ErrorOr IntegerStyleValue::to_string() const +String IntegerStyleValue::to_string() const { - return String::number(m_value); + return MUST(String::number(m_value)); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/IntegerStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/IntegerStyleValue.h index 9ee2af60f6d..c7695b67257 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/IntegerStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/IntegerStyleValue.h @@ -19,7 +19,7 @@ public: i64 integer() const { return m_value; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(IntegerStyleValue const& other) const { return m_value == other.m_value; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/LengthStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/LengthStyleValue.h index 928bcb83eda..04339dc7b2b 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/LengthStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/LengthStyleValue.h @@ -20,7 +20,7 @@ public: Length const& length() const { return m_length; } - virtual ErrorOr to_string() const override { return m_length.to_string(); } + virtual String to_string() const override { return m_length.to_string(); } virtual ValueComparingNonnullRefPtr absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const override; bool properties_equal(LengthStyleValue const& other) const { return m_length == other.m_length; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/LinearGradientStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/LinearGradientStyleValue.cpp index b4c4b61b8d3..30d915e8e1e 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/LinearGradientStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/LinearGradientStyleValue.cpp @@ -11,7 +11,7 @@ namespace Web::CSS { -ErrorOr LinearGradientStyleValue::to_string() const +String LinearGradientStyleValue::to_string() const { StringBuilder builder; auto side_or_corner_to_string = [](SideOrCorner value) { @@ -38,21 +38,21 @@ ErrorOr LinearGradientStyleValue::to_string() const }; if (m_properties.gradient_type == GradientType::WebKit) - TRY(builder.try_append("-webkit-"sv)); + builder.append("-webkit-"sv); if (is_repeating()) - TRY(builder.try_append("repeating-"sv)); - TRY(builder.try_append("linear-gradient("sv)); - TRY(m_properties.direction.visit( - [&](SideOrCorner side_or_corner) -> ErrorOr { - return builder.try_appendff("{}{}, "sv, m_properties.gradient_type == GradientType::Standard ? "to "sv : ""sv, side_or_corner_to_string(side_or_corner)); + builder.append("repeating-"sv); + builder.append("linear-gradient("sv); + m_properties.direction.visit( + [&](SideOrCorner side_or_corner) { + return builder.appendff("{}{}, "sv, m_properties.gradient_type == GradientType::Standard ? "to "sv : ""sv, side_or_corner_to_string(side_or_corner)); }, - [&](Angle const& angle) -> ErrorOr { - return builder.try_appendff("{}, "sv, angle.to_string()); - })); + [&](Angle const& angle) { + return builder.appendff("{}, "sv, angle.to_string()); + }); - TRY(serialize_color_stop_list(builder, m_properties.color_stop_list)); - TRY(builder.try_append(")"sv)); - return builder.to_string(); + serialize_color_stop_list(builder, m_properties.color_stop_list); + builder.append(")"sv); + return MUST(builder.to_string()); } bool LinearGradientStyleValue::equals(StyleValue const& other_) const diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/LinearGradientStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/LinearGradientStyleValue.h index 8b94927a071..74f84de7861 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/LinearGradientStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/LinearGradientStyleValue.h @@ -44,7 +44,7 @@ public: return adopt_ref(*new (nothrow) LinearGradientStyleValue(direction, move(color_stop_list), type, repeating)); } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; virtual ~LinearGradientStyleValue() override = default; virtual bool equals(StyleValue const& other) const override; diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ListStyleStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/ListStyleStyleValue.cpp index 85a6f08e6a3..5edf9bc352d 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ListStyleStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ListStyleStyleValue.cpp @@ -11,9 +11,9 @@ namespace Web::CSS { -ErrorOr ListStyleStyleValue::to_string() const +String ListStyleStyleValue::to_string() const { - return String::formatted("{} {} {}", TRY(m_properties.position->to_string()), TRY(m_properties.image->to_string()), TRY(m_properties.style_type->to_string())); + return MUST(String::formatted("{} {} {}", m_properties.position->to_string(), m_properties.image->to_string(), m_properties.style_type->to_string())); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ListStyleStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/ListStyleStyleValue.h index bf3264a037e..1ae7f06a15e 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ListStyleStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ListStyleStyleValue.h @@ -28,7 +28,7 @@ public: ValueComparingNonnullRefPtr image() const { return m_properties.image; } ValueComparingNonnullRefPtr style_type() const { return m_properties.style_type; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(ListStyleStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/NumberStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/NumberStyleValue.cpp index 748e1f965e0..a57fcccb484 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/NumberStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/NumberStyleValue.cpp @@ -11,9 +11,9 @@ namespace Web::CSS { -ErrorOr NumberStyleValue::to_string() const +String NumberStyleValue::to_string() const { - return String::number(m_value); + return MUST(String::number(m_value)); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/NumberStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/NumberStyleValue.h index 04c26d568f6..956064e22b9 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/NumberStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/NumberStyleValue.h @@ -22,7 +22,7 @@ public: double number() const { return m_value; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(NumberStyleValue const& other) const { return m_value == other.m_value; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/OverflowStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/OverflowStyleValue.cpp index 433b1c15452..4630f7f8cad 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/OverflowStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/OverflowStyleValue.cpp @@ -11,9 +11,9 @@ namespace Web::CSS { -ErrorOr OverflowStyleValue::to_string() const +String OverflowStyleValue::to_string() const { - return String::formatted("{} {}", TRY(m_properties.overflow_x->to_string()), TRY(m_properties.overflow_y->to_string())); + return MUST(String::formatted("{} {}", m_properties.overflow_x->to_string(), m_properties.overflow_y->to_string())); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/OverflowStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/OverflowStyleValue.h index 58724c8527e..dc744816aa9 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/OverflowStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/OverflowStyleValue.h @@ -24,7 +24,7 @@ public: ValueComparingNonnullRefPtr overflow_x() const { return m_properties.overflow_x; } ValueComparingNonnullRefPtr overflow_y() const { return m_properties.overflow_y; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(OverflowStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/PercentageStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/PercentageStyleValue.h index ca80faed92b..92100f7ac85 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/PercentageStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/PercentageStyleValue.h @@ -25,7 +25,7 @@ public: Percentage const& percentage() const { return m_percentage; } Percentage& percentage() { return m_percentage; } - virtual ErrorOr to_string() const override { return m_percentage.to_string(); } + virtual String to_string() const override { return m_percentage.to_string(); } bool properties_equal(PercentageStyleValue const& other) const { return m_percentage == other.m_percentage; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceContentStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceContentStyleValue.cpp index a08b5c03ed9..6e230f697ef 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceContentStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceContentStyleValue.cpp @@ -8,13 +8,13 @@ namespace Web::CSS { -ErrorOr PlaceContentStyleValue::to_string() const +String PlaceContentStyleValue::to_string() const { - auto align_content = TRY(m_properties.align_content->to_string()); - auto justify_content = TRY(m_properties.justify_content->to_string()); + auto align_content = m_properties.align_content->to_string(); + auto justify_content = m_properties.justify_content->to_string(); if (align_content == justify_content) - return String::formatted("{}", align_content); - return String::formatted("{} {}", align_content, justify_content); + return MUST(String::formatted("{}", align_content)); + return MUST(String::formatted("{} {}", align_content, justify_content)); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceContentStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceContentStyleValue.h index e7abd42cd2f..5bfcf6899b0 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceContentStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceContentStyleValue.h @@ -21,7 +21,7 @@ public: ValueComparingNonnullRefPtr align_content() const { return m_properties.align_content; } ValueComparingNonnullRefPtr justify_content() const { return m_properties.justify_content; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(PlaceContentStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceItemsStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceItemsStyleValue.cpp index dfa988116a0..012463198b1 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceItemsStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceItemsStyleValue.cpp @@ -8,13 +8,13 @@ namespace Web::CSS { -ErrorOr PlaceItemsStyleValue::to_string() const +String PlaceItemsStyleValue::to_string() const { - auto align_items = TRY(m_properties.align_items->to_string()); - auto justify_items = TRY(m_properties.justify_items->to_string()); + auto align_items = m_properties.align_items->to_string(); + auto justify_items = m_properties.justify_items->to_string(); if (align_items == justify_items) - return String::formatted("{}", align_items); - return String::formatted("{} {}", align_items, justify_items); + return MUST(String::formatted("{}", align_items)); + return MUST(String::formatted("{} {}", align_items, justify_items)); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceItemsStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceItemsStyleValue.h index f82363056a0..3d233e5437a 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceItemsStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceItemsStyleValue.h @@ -21,7 +21,7 @@ public: ValueComparingNonnullRefPtr align_items() const { return m_properties.align_items; } ValueComparingNonnullRefPtr justify_items() const { return m_properties.justify_items; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(PlaceItemsStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceSelfStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceSelfStyleValue.cpp index 4f1290cd427..0c7d7e7ce8b 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceSelfStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceSelfStyleValue.cpp @@ -8,13 +8,13 @@ namespace Web::CSS { -ErrorOr PlaceSelfStyleValue::to_string() const +String PlaceSelfStyleValue::to_string() const { - auto align_self = TRY(m_properties.align_self->to_string()); - auto justify_self = TRY(m_properties.justify_self->to_string()); + auto align_self = m_properties.align_self->to_string(); + auto justify_self = m_properties.justify_self->to_string(); if (align_self == justify_self) - return String::formatted("{}", align_self); - return String::formatted("{} {}", align_self, justify_self); + return MUST(String::formatted("{}", align_self)); + return MUST(String::formatted("{} {}", align_self, justify_self)); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceSelfStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceSelfStyleValue.h index 0235245778b..05bb61b066e 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceSelfStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceSelfStyleValue.h @@ -21,7 +21,7 @@ public: ValueComparingNonnullRefPtr align_self() const { return m_properties.align_self; } ValueComparingNonnullRefPtr justify_self() const { return m_properties.justify_self; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(PlaceSelfStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/PositionStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/PositionStyleValue.cpp index 71cb93bbc04..dfdb6d77864 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/PositionStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/PositionStyleValue.cpp @@ -11,9 +11,9 @@ namespace Web::CSS { -ErrorOr PositionStyleValue::to_string() const +String PositionStyleValue::to_string() const { - return String::formatted("{} {}", TRY(m_properties.edge_x->to_string()), TRY(m_properties.edge_y->to_string())); + return MUST(String::formatted("{} {}", m_properties.edge_x->to_string(), m_properties.edge_y->to_string())); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/PositionStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/PositionStyleValue.h index 0a24f956081..9b7df95504c 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/PositionStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/PositionStyleValue.h @@ -26,7 +26,7 @@ public: ValueComparingNonnullRefPtr edge_x() const { return m_properties.edge_x; } ValueComparingNonnullRefPtr edge_y() const { return m_properties.edge_y; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(PositionStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.cpp index cfe174de420..ed547d42b1f 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.cpp @@ -12,17 +12,17 @@ namespace Web::CSS { -ErrorOr RadialGradientStyleValue::to_string() const +String RadialGradientStyleValue::to_string() const { StringBuilder builder; if (is_repeating()) - TRY(builder.try_append("repeating-"sv)); - TRY(builder.try_appendff("radial-gradient({} "sv, - m_properties.ending_shape == EndingShape::Circle ? "circle"sv : "ellipse"sv)); + builder.append("repeating-"sv); + builder.appendff("radial-gradient({} "sv, + m_properties.ending_shape == EndingShape::Circle ? "circle"sv : "ellipse"sv); - TRY(m_properties.size.visit( - [&](Extent extent) -> ErrorOr { - return builder.try_append([&] { + m_properties.size.visit( + [&](Extent extent) { + builder.append([&] { switch (extent) { case Extent::ClosestCorner: return "closest-corner"sv; @@ -37,22 +37,22 @@ ErrorOr RadialGradientStyleValue::to_string() const } }()); }, - [&](CircleSize const& circle_size) -> ErrorOr { - return builder.try_append(circle_size.radius.to_string()); + [&](CircleSize const& circle_size) { + builder.append(circle_size.radius.to_string()); }, - [&](EllipseSize const& ellipse_size) -> ErrorOr { - return builder.try_appendff("{} {}", ellipse_size.radius_a.to_string(), ellipse_size.radius_b.to_string()); - })); + [&](EllipseSize const& ellipse_size) { + builder.appendff("{} {}", ellipse_size.radius_a.to_string(), ellipse_size.radius_b.to_string()); + }); if (m_properties.position != PositionValue::center()) { - TRY(builder.try_appendff(" at "sv)); + builder.appendff(" at "sv); m_properties.position.serialize(builder); } - TRY(builder.try_append(", "sv)); - TRY(serialize_color_stop_list(builder, m_properties.color_stop_list)); - TRY(builder.try_append(')')); - return builder.to_string(); + builder.append(", "sv); + serialize_color_stop_list(builder, m_properties.color_stop_list); + builder.append(')'); + return MUST(builder.to_string()); } Gfx::FloatSize RadialGradientStyleValue::resolve_size(Layout::Node const& node, Gfx::FloatPoint center, Gfx::FloatRect const& size) const diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h index 6cd43946db9..3308f819718 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h @@ -50,7 +50,7 @@ public: return adopt_ref(*new (nothrow) RadialGradientStyleValue(ending_shape, size, position, move(color_stop_list), repeating)); } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; void paint(PaintContext&, DevicePixelRect const& dest_rect, CSS::ImageRendering) const override; diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/RatioStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/RatioStyleValue.h index d768ceb8a63..37d68d6fd81 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/RatioStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/RatioStyleValue.h @@ -22,7 +22,7 @@ public: Ratio const& ratio() const { return m_ratio; } Ratio& ratio() { return m_ratio; } - virtual ErrorOr to_string() const override { return m_ratio.to_string(); } + virtual String to_string() const override { return m_ratio.to_string(); } bool properties_equal(RatioStyleValue const& other) const { return m_ratio == other.m_ratio; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/RectStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/RectStyleValue.cpp index 66aa3cf8f5e..186ecbfc7bc 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/RectStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/RectStyleValue.cpp @@ -16,9 +16,9 @@ ValueComparingNonnullRefPtr RectStyleValue::create(EdgeRect rect return adopt_ref(*new (nothrow) RectStyleValue(move(rect))); } -ErrorOr RectStyleValue::to_string() const +String RectStyleValue::to_string() const { - return String::formatted("rect({} {} {} {})", m_rect.top_edge, m_rect.right_edge, m_rect.bottom_edge, m_rect.left_edge); + return MUST(String::formatted("rect({} {} {} {})", m_rect.top_edge, m_rect.right_edge, m_rect.bottom_edge, m_rect.left_edge)); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/RectStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/RectStyleValue.h index ff43095752e..d4a03110bce 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/RectStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/RectStyleValue.h @@ -20,7 +20,7 @@ public: virtual ~RectStyleValue() override = default; EdgeRect rect() const { return m_rect; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(RectStyleValue const& other) const { return m_rect == other.m_rect; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ResolutionStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/ResolutionStyleValue.h index 26377a2aa05..e3481f4a6ae 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ResolutionStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ResolutionStyleValue.h @@ -21,7 +21,7 @@ public: Resolution const& resolution() const { return m_resolution; } - virtual ErrorOr to_string() const override { return m_resolution.to_string(); } + virtual String to_string() const override { return m_resolution.to_string(); } bool properties_equal(ResolutionStyleValue const& other) const { return m_resolution == other.m_resolution; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/RevertStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/RevertStyleValue.h index f3b6445b044..a67a6bcde75 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/RevertStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/RevertStyleValue.h @@ -19,7 +19,7 @@ public: } virtual ~RevertStyleValue() override = default; - ErrorOr to_string() const override { return "revert"_string; } + String to_string() const override { return "revert"_string; } bool properties_equal(RevertStyleValue const&) const { return true; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.cpp index 932983ec662..468036e2bc8 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.cpp @@ -11,13 +11,13 @@ namespace Web::CSS { -ErrorOr ShadowStyleValue::to_string() const +String ShadowStyleValue::to_string() const { StringBuilder builder; - TRY(builder.try_appendff("{} {} {} {} {}", m_properties.color.to_deprecated_string(), TRY(m_properties.offset_x->to_string()), TRY(m_properties.offset_y->to_string()), TRY(m_properties.blur_radius->to_string()), TRY(m_properties.spread_distance->to_string()))); + builder.appendff("{} {} {} {} {}", m_properties.color.to_deprecated_string(), m_properties.offset_x->to_string(), m_properties.offset_y->to_string(), m_properties.blur_radius->to_string(), m_properties.spread_distance->to_string()); if (m_properties.placement == ShadowPlacement::Inner) - TRY(builder.try_append(" inset"sv)); - return builder.to_string(); + builder.append(" inset"sv); + return MUST(builder.to_string()); } ValueComparingNonnullRefPtr ShadowStyleValue::absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.h index f90224549d9..02359d61e2e 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.h @@ -41,7 +41,7 @@ public: ValueComparingNonnullRefPtr const& spread_distance() const { return m_properties.spread_distance; } ShadowPlacement placement() const { return m_properties.placement; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(ShadowStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/StringStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/StringStyleValue.h index bffbe1fec91..53a3c94ccb8 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/StringStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/StringStyleValue.h @@ -19,7 +19,7 @@ public: } virtual ~StringStyleValue() override = default; - ErrorOr to_string() const override { return m_string; } + String to_string() const override { return m_string; } bool properties_equal(StringStyleValue const& other) const { return m_string == other.m_string; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp index af03150b6df..ca50d774748 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp @@ -16,7 +16,7 @@ bool StyleValueList::Properties::operator==(Properties const& other) const return separator == other.separator && values.span() == other.values.span(); } -ErrorOr StyleValueList::to_string() const +String StyleValueList::to_string() const { auto separator = ""sv; switch (m_properties.separator) { @@ -32,11 +32,11 @@ ErrorOr StyleValueList::to_string() const StringBuilder builder; for (size_t i = 0; i < m_properties.values.size(); ++i) { - TRY(builder.try_append(TRY(m_properties.values[i]->to_string()))); + builder.append(m_properties.values[i]->to_string()); if (i != m_properties.values.size() - 1) - TRY(builder.try_append(separator)); + builder.append(separator); } - return builder.to_string(); + return MUST(builder.to_string()); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/StyleValueList.h b/Userland/Libraries/LibWeb/CSS/StyleValues/StyleValueList.h index a6392e5f8e9..4732f3b6e02 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/StyleValueList.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/StyleValueList.h @@ -33,7 +33,7 @@ public: return m_properties.values[i]; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(StyleValueList const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/TextDecorationStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/TextDecorationStyleValue.cpp index 722ab846292..143906f70d7 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/TextDecorationStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/TextDecorationStyleValue.cpp @@ -11,9 +11,9 @@ namespace Web::CSS { -ErrorOr TextDecorationStyleValue::to_string() const +String TextDecorationStyleValue::to_string() const { - return String::formatted("{} {} {} {}", TRY(m_properties.line->to_string()), TRY(m_properties.thickness->to_string()), TRY(m_properties.style->to_string()), TRY(m_properties.color->to_string())); + return MUST(String::formatted("{} {} {} {}", m_properties.line->to_string(), m_properties.thickness->to_string(), m_properties.style->to_string(), m_properties.color->to_string())); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/TextDecorationStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/TextDecorationStyleValue.h index 35a2ab5eac4..a0bfcf1c77f 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/TextDecorationStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/TextDecorationStyleValue.h @@ -30,7 +30,7 @@ public: ValueComparingNonnullRefPtr style() const { return m_properties.style; } ValueComparingNonnullRefPtr color() const { return m_properties.color; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(TextDecorationStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/TimeStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/TimeStyleValue.h index e027bd346a3..233a0e2ddec 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/TimeStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/TimeStyleValue.h @@ -24,7 +24,7 @@ public: Time const& time() const { return m_time; } - virtual ErrorOr to_string() const override { return m_time.to_string(); } + virtual String to_string() const override { return m_time.to_string(); } bool properties_equal(TimeStyleValue const& other) const { return m_time == other.m_time; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/TransformationStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/TransformationStyleValue.cpp index dfa33429bb0..8ef5851c5fc 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/TransformationStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/TransformationStyleValue.cpp @@ -12,19 +12,19 @@ namespace Web::CSS { -ErrorOr TransformationStyleValue::to_string() const +String TransformationStyleValue::to_string() const { StringBuilder builder; - TRY(builder.try_append(CSS::to_string(m_properties.transform_function))); - TRY(builder.try_append('(')); + builder.append(CSS::to_string(m_properties.transform_function)); + builder.append('('); for (size_t i = 0; i < m_properties.values.size(); ++i) { - TRY(builder.try_append(TRY(m_properties.values[i]->to_string()))); + builder.append(m_properties.values[i]->to_string()); if (i != m_properties.values.size() - 1) - TRY(builder.try_append(", "sv)); + builder.append(", "sv); } - TRY(builder.try_append(')')); + builder.append(')'); - return builder.to_string(); + return MUST(builder.to_string()); } bool TransformationStyleValue::Properties::operator==(Properties const& other) const diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/TransformationStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/TransformationStyleValue.h index 3ce2ff5a016..fee0e05e2d2 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/TransformationStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/TransformationStyleValue.h @@ -25,7 +25,7 @@ public: CSS::TransformFunction transform_function() const { return m_properties.transform_function; } StyleValueVector values() const { return m_properties.values; } - virtual ErrorOr to_string() const override; + virtual String to_string() const override; bool properties_equal(TransformationStyleValue const& other) const { return m_properties == other.m_properties; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/URLStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/URLStyleValue.h index d6f3bb0260e..4b7cc04184e 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/URLStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/URLStyleValue.h @@ -25,7 +25,7 @@ public: bool properties_equal(URLStyleValue const& other) const { return m_url == other.m_url; } - virtual ErrorOr to_string() const override + virtual String to_string() const override { return serialize_a_url(m_url.to_deprecated_string()); } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/UnresolvedStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/UnresolvedStyleValue.cpp index 7f727d4f3bf..87de5f9df59 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/UnresolvedStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/UnresolvedStyleValue.cpp @@ -12,12 +12,12 @@ namespace Web::CSS { -ErrorOr UnresolvedStyleValue::to_string() const +String UnresolvedStyleValue::to_string() const { StringBuilder builder; for (auto& value : m_values) - TRY(builder.try_append(value.to_string())); - return builder.to_string(); + builder.append(value.to_string()); + return MUST(builder.to_string()); } bool UnresolvedStyleValue::equals(StyleValue const& other) const @@ -25,7 +25,7 @@ bool UnresolvedStyleValue::equals(StyleValue const& other) const if (type() != other.type()) return false; // This is a case where comparing the strings actually makes sense. - return to_string().release_value_but_fixme_should_propagate_errors() == other.to_string().release_value_but_fixme_should_propagate_errors(); + return to_string() == other.to_string(); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/UnresolvedStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/UnresolvedStyleValue.h index 4b754e05c7c..75ed43064ab 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/UnresolvedStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/UnresolvedStyleValue.h @@ -23,7 +23,7 @@ public: } virtual ~UnresolvedStyleValue() override = default; - virtual ErrorOr to_string() const override; + virtual String to_string() const override; Vector const& values() const { return m_values; } bool contains_var_or_attr() const { return m_contains_var_or_attr; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/UnsetStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/UnsetStyleValue.h index 4589bd02da3..34a84e5aa64 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/UnsetStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/UnsetStyleValue.h @@ -22,7 +22,7 @@ public: } virtual ~UnsetStyleValue() override = default; - ErrorOr to_string() const override { return "unset"_string; } + String to_string() const override { return "unset"_string; } bool properties_equal(UnsetStyleValue const&) const { return true; } diff --git a/Userland/Libraries/LibWeb/Dump.cpp b/Userland/Libraries/LibWeb/Dump.cpp index d90b4e09a74..e7164462122 100644 --- a/Userland/Libraries/LibWeb/Dump.cpp +++ b/Userland/Libraries/LibWeb/Dump.cpp @@ -362,7 +362,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho }; Vector properties; verify_cast(*layout_node.dom_node()).computed_css_values()->for_each_property([&](auto property_id, auto& value) { - properties.append({ CSS::string_from_property_id(property_id), value.to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string() }); + properties.append({ CSS::string_from_property_id(property_id), value.to_string().to_deprecated_string() }); }); quick_sort(properties, [](auto& a, auto& b) { return a.name < b.name; }); @@ -701,14 +701,14 @@ ErrorOr dump_style_rule(StringBuilder& builder, CSS::CSSStyleRule const& r auto& style_declaration = verify_cast(rule.declaration()); for (auto& property : style_declaration.properties()) { indent(builder, indent_levels); - builder.appendff(" {}: '{}'", CSS::string_from_property_id(property.property_id), TRY(property.value->to_string())); + builder.appendff(" {}: '{}'", CSS::string_from_property_id(property.property_id), property.value->to_string()); if (property.important == CSS::Important::Yes) builder.append(" \033[31;1m!important\033[0m"sv); builder.append('\n'); } for (auto& property : style_declaration.custom_properties()) { indent(builder, indent_levels); - builder.appendff(" {}: '{}'", property.key, TRY(property.value.value->to_string())); + builder.appendff(" {}: '{}'", property.key, property.value.value->to_string()); if (property.value.important == CSS::Important::Yes) builder.append(" \033[31;1m!important\033[0m"sv); builder.append('\n'); diff --git a/Userland/Libraries/LibWeb/HTML/Canvas/CanvasTextDrawingStyles.h b/Userland/Libraries/LibWeb/HTML/Canvas/CanvasTextDrawingStyles.h index c864112bd05..b21c4081291 100644 --- a/Userland/Libraries/LibWeb/HTML/Canvas/CanvasTextDrawingStyles.h +++ b/Userland/Libraries/LibWeb/HTML/Canvas/CanvasTextDrawingStyles.h @@ -30,10 +30,10 @@ public: // On getting, the font attribute must return the serialized form of the current font of the context (with no 'line-height' component). auto const& font_style_value = my_drawing_state().font_style_value->as_font(); return DeprecatedString::formatted("{} {} {} {}", - font_style_value.font_style()->to_string().release_value_but_fixme_should_propagate_errors(), - font_style_value.font_weight()->to_string().release_value_but_fixme_should_propagate_errors(), - font_style_value.font_size()->to_string().release_value_but_fixme_should_propagate_errors(), - font_style_value.font_families()->to_string().release_value_but_fixme_should_propagate_errors()); + font_style_value.font_style()->to_string(), + font_style_value.font_weight()->to_string(), + font_style_value.font_size()->to_string(), + font_style_value.font_families()->to_string()); } void set_font(DeprecatedString const& font) diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp index 816722f39b3..32ad6c3bec1 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.cpp +++ b/Userland/Services/WebContent/ConnectionFromClient.cpp @@ -489,7 +489,7 @@ Messages::WebContentServer::InspectDomNodeResponse ConnectionFromClient::inspect auto serializer = MUST(JsonObjectSerializer<>::try_create(builder)); properties.for_each_property([&](auto property_id, auto& value) { - MUST(serializer.add(Web::CSS::string_from_property_id(property_id), value.to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string())); + MUST(serializer.add(Web::CSS::string_from_property_id(property_id), value.to_string().to_deprecated_string())); }); MUST(serializer.finish()); @@ -506,7 +506,7 @@ Messages::WebContentServer::InspectDomNodeResponse ConnectionFromClient::inspect for (auto const& property : element_to_check->custom_properties(pseudo_element)) { if (!seen_properties.contains(property.key)) { seen_properties.set(property.key); - MUST(serializer.add(property.key, property.value.value->to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string())); + MUST(serializer.add(property.key, property.value.value->to_string().to_deprecated_string())); } } diff --git a/Userland/Services/WebContent/WebDriverConnection.cpp b/Userland/Services/WebContent/WebDriverConnection.cpp index 7e4a62bd8e7..3872c73fc8c 100644 --- a/Userland/Services/WebContent/WebDriverConnection.cpp +++ b/Userland/Services/WebContent/WebDriverConnection.cpp @@ -1134,7 +1134,7 @@ Messages::WebDriverClient::GetElementCssValueResponse WebDriverConnection::get_e // computed value of parameter property name from element’s style declarations. property name is obtained from url variables. if (auto property = Web::CSS::property_id_from_string(name); property.has_value()) { if (auto* computed_values = element->computed_css_values()) - computed_value = computed_values->property(property.value())->to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string(); + computed_value = computed_values->property(property.value())->to_string().to_deprecated_string(); } } // -> Otherwise