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/ResolvedCSSStyleDeclaration.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp') diff --git a/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp index 30f79e8df8..1ad7322c97 100644 --- a/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp @@ -579,4 +579,15 @@ bool ResolvedCSSStyleDeclaration::set_property(PropertyID, StringView) { return false; } + +String ResolvedCSSStyleDeclaration::serialized() const +{ + // https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-csstext + // If the computed flag is set, then return the empty string. + + // NOTE: ResolvedCSSStyleDeclaration is something you would only get from window.getComputedStyle(), + // which returns what the spec calls "resolved style". The "computed flag" is always set here. + return String::empty(); +} + } -- cgit v1.2.3