|
@@ -20,9 +20,14 @@ CSS::CSSStyleSheet* parse_css_stylesheet(CSS::Parser::ParsingContext const& cont
|
|
|
if (css.is_empty()) {
|
|
|
auto rule_list = CSS::CSSRuleList::create_empty(context.realm());
|
|
|
auto media_list = CSS::MediaList::create(context.realm(), {});
|
|
|
- return CSS::CSSStyleSheet::create(context.realm(), rule_list, media_list, location);
|
|
|
+ auto style_sheet = CSS::CSSStyleSheet::create(context.realm(), rule_list, media_list, location);
|
|
|
+ style_sheet->set_source_text({});
|
|
|
+ return style_sheet;
|
|
|
}
|
|
|
- return CSS::Parser::Parser::create(context, css).parse_as_css_stylesheet(location);
|
|
|
+ auto* style_sheet = CSS::Parser::Parser::create(context, css).parse_as_css_stylesheet(location);
|
|
|
+ // FIXME: Avoid this copy
|
|
|
+ style_sheet->set_source_text(MUST(String::from_utf8(css)));
|
|
|
+ return style_sheet;
|
|
|
}
|
|
|
|
|
|
CSS::ElementInlineCSSStyleDeclaration* parse_css_style_attribute(CSS::Parser::ParsingContext const& context, StringView css, DOM::Element& element)
|