1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

LibWeb: Port CSSRule::serialized from DeprecatedString to String

This commit is contained in:
Shannon Booth 2023-11-20 23:16:39 +13:00 committed by Tim Flynn
parent 890cce6fbb
commit d400291ad9
18 changed files with 30 additions and 30 deletions

View file

@ -45,7 +45,7 @@ CSSStyleDeclaration* CSSStyleRule::style()
}
// https://www.w3.org/TR/cssom/#serialize-a-css-rule
DeprecatedString CSSStyleRule::serialized() const
String CSSStyleRule::serialized() const
{
StringBuilder builder;
@ -58,12 +58,12 @@ DeprecatedString CSSStyleRule::serialized() const
auto decls = declaration().length() > 0 ? declaration().serialized() : Optional<DeprecatedString>();
// FIXME: 3. Let rules be the result of performing serialize a CSS rule on each rule in the rules cssRules list, or null if there are no such rules.
Optional<DeprecatedString> rules;
Optional<String> rules;
// 4. If decls and rules are both null, append " }" to s (i.e. a single SPACE (U+0020) followed by RIGHT CURLY BRACKET (U+007D)) and return s.
if (!decls.has_value() && !rules.has_value()) {
builder.append(" }"sv);
return builder.to_deprecated_string();
return MUST(builder.to_string());
}
// 5. If rules is null:
@ -75,7 +75,7 @@ DeprecatedString CSSStyleRule::serialized() const
// 3. Append " }" to s (i.e. a single SPACE (U+0020) followed by RIGHT CURLY BRACKET (U+007D)).
builder.append(" }"sv);
// 4. Return s.
return builder.to_deprecated_string();
return MUST(builder.to_string());
}
// FIXME: 6. Otherwise: