@@ -54,19 +54,18 @@ void CSSMathInvert::visit_edges(Visitor& visitor)
5454}
5555
5656// https://drafts.css-houdini.org/css-typed-om-1/#serialize-a-cssmathvalue
57- String CSSMathInvert::serialize_math_value (Nested nested, Parens parens) const
57+ void CSSMathInvert::serialize_math_value (StringBuilder& s, Nested nested, Parens parens) const
5858{
5959 // NB: Only steps 1 and 6 apply here.
6060 // 1. Let s initially be the empty string.
61- StringBuilder s;
6261
6362 // 6. Otherwise, if this is a CSSMathInvert:
6463 {
6564 // 1. If paren-less is true, continue to the next step; otherwise, if nested is true, append "(" to s;
6665 // otherwise, append "calc(" to s.
6766 if (parens == Parens::With) {
6867 if (nested == Nested::Yes) {
69- s.append (" ( " sv );
68+ s.append (' ( ' );
7069 } else {
7170 s.append (" calc(" sv);
7271 }
@@ -76,14 +75,13 @@ String CSSMathInvert::serialize_math_value(Nested nested, Parens parens) const
7675 s.append (" 1 / " sv);
7776
7877 // 3. Serialize this’s value internal slot with nested set to true, and append the result to s.
79- s. append ( m_value->to_string ( { .nested = true }) );
78+ m_value->serialize (s, { .nested = true });
8079
8180 // 4. If paren-less is false, append ")" to s,
8281 if (parens == Parens::With)
83- s.append (" ) " sv );
82+ s.append (' ) ' );
8483
8584 // 5. Return s.
86- return s.to_string_without_validation ();
8785 }
8886}
8987
0 commit comments