LibWeb/CSS: Preserve whitespace and comments in custom properties

A couple of parts of this:
- Store the source text for Declarations of custom properties.
- Then save that in the UnresolvedStyleValue.
- Serialize UnresolvedStyleValue using the saved source when available -
  that is, for custom properties but not for regular properties that
  include var() or attr().
This commit is contained in:
Sam Atkins 2024-10-14 16:23:35 +01:00 committed by Andreas Kling
commit bf3e6daedb
Notes: github-actions[bot] 2024-10-16 12:23:36 +00:00
4 changed files with 20 additions and 9 deletions

View file

@ -229,7 +229,7 @@ private:
RefPtr<CSSStyleValue> parse_conic_gradient_function(TokenStream<ComponentValue>&);
RefPtr<CSSStyleValue> parse_radial_gradient_function(TokenStream<ComponentValue>&);
ParseErrorOr<NonnullRefPtr<CSSStyleValue>> parse_css_value(PropertyID, TokenStream<ComponentValue>&);
ParseErrorOr<NonnullRefPtr<CSSStyleValue>> parse_css_value(PropertyID, TokenStream<ComponentValue>&, Optional<String> original_source_text = {});
RefPtr<CSSStyleValue> parse_css_value_for_property(PropertyID, TokenStream<ComponentValue>&);
struct PropertyAndValue {
PropertyID property;