1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:17:42 +00:00

LibWeb+WebContent: Use new String class in CSS::StyleValue

Converts uses of DeprecatedString to String in StyleValue, and patches
surrounding files that depend on these functions.
This commit is contained in:
martinfalisse 2023-01-06 19:02:26 +01:00 committed by Andreas Kling
parent 1c2e7b1e47
commit ce0f41b9fb
37 changed files with 335 additions and 330 deletions

View file

@ -201,7 +201,7 @@ DeprecatedString CSSStyleDeclaration::get_property_value(StringView property_nam
auto maybe_property = property(property_id);
if (!maybe_property.has_value())
return {};
return maybe_property->value->to_deprecated_string();
return maybe_property->value->to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string();
}
// https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-getpropertypriority
@ -291,7 +291,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_deprecated_string();
auto value = declaration.value->to_string().release_value_but_fixme_should_propagate_errors().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.
@ -340,7 +340,7 @@ JS::ThrowCompletionOr<JS::Value> CSSStyleDeclaration::internal_get(JS::PropertyK
if (property_id == CSS::PropertyID::Invalid)
return Base::internal_get(name, receiver);
if (auto maybe_property = property(property_id); maybe_property.has_value())
return { JS::PrimitiveString::create(vm(), maybe_property->value->to_deprecated_string()) };
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(), DeprecatedString::empty()) };
}