LibWeb: Add mode flag to CSSStyleValue::to_string()

This will be used to differentiate between serialization for resolved
style (i.e window.getComputedStyle()) and serialization for all other
purposes.
This commit is contained in:
Andreas Kling 2024-12-07 00:59:49 +01:00 committed by Sam Atkins
commit e85c3c97fb
Notes: github-actions[bot] 2024-12-07 08:32:08 +00:00
112 changed files with 217 additions and 208 deletions

View file

@ -12,7 +12,7 @@
namespace Web::CSS {
String UnresolvedStyleValue::to_string() const
String UnresolvedStyleValue::to_string(SerializationMode) const
{
if (m_original_source_text.has_value())
return *m_original_source_text;
@ -25,7 +25,7 @@ bool UnresolvedStyleValue::equals(CSSStyleValue const& other) const
if (type() != other.type())
return false;
// This is a case where comparing the strings actually makes sense.
return to_string() == other.to_string();
return to_string(SerializationMode::Normal) == other.to_string(SerializationMode::Normal);
}
}