1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

LibWeb: Store stylesheet sources as StringViews

This commit is contained in:
Sam Atkins 2023-02-17 13:00:40 +00:00 committed by Linus Groh
parent 13d2111b74
commit faab2fe101
2 changed files with 8 additions and 9 deletions

View file

@ -115,9 +115,8 @@ static CSSStyleSheet& default_stylesheet()
{
static JS::Handle<CSSStyleSheet> sheet;
if (!sheet.cell()) {
extern char const default_stylesheet_source[];
DeprecatedString css = default_stylesheet_source;
sheet = JS::make_handle(parse_css_stylesheet(CSS::Parser::ParsingContext(), css));
extern StringView default_stylesheet_source;
sheet = JS::make_handle(parse_css_stylesheet(CSS::Parser::ParsingContext(), default_stylesheet_source));
}
return *sheet;
}
@ -126,9 +125,8 @@ static CSSStyleSheet& quirks_mode_stylesheet()
{
static JS::Handle<CSSStyleSheet> sheet;
if (!sheet.cell()) {
extern char const quirks_mode_stylesheet_source[];
DeprecatedString css = quirks_mode_stylesheet_source;
sheet = JS::make_handle(parse_css_stylesheet(CSS::Parser::ParsingContext(), css));
extern StringView quirks_mode_stylesheet_source;
sheet = JS::make_handle(parse_css_stylesheet(CSS::Parser::ParsingContext(), quirks_mode_stylesheet_source));
}
return *sheet;
}