From 3db847c64a3e391b3525b54b67b949ac7ae4097e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 1 Oct 2021 19:57:45 +0200 Subject: LibWeb: Implement CSSRule and CSSStyleDeclaration serialization There are a handful of FIXME's here, but this seems generally good. Note that CSS *values* don't get serialized in a spec-compliant way since we currently rely on StyleValue::to_string() which is ad-hoc. --- Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h') diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h index 37a32c9f6a..92db88971e 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h @@ -38,6 +38,11 @@ public: String get_property_value(StringView property) const; + String css_text() const; + void set_css_text(StringView); + + virtual String serialized() const = 0; + protected: CSSStyleDeclaration() { } }; @@ -63,6 +68,8 @@ public: Optional custom_property(const String& custom_property_name) const { return m_custom_properties.get(custom_property_name); } size_t custom_property_count() const { return m_custom_properties.size(); } + virtual String serialized() const final override; + protected: explicit PropertyOwningCSSStyleDeclaration(Vector, HashMap); -- cgit v1.2.3