1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 21:05:06 +00:00

LibWeb: Include standard SVG user agent style sheet

For now, part of this is commented-out. Our current implementations of
`<mask>` and `<symbol>` rely on creating layout nodes, so they can't be
`display: none`.
This commit is contained in:
Sam Atkins 2023-09-23 14:23:47 +01:00 committed by Andreas Kling
parent a6131634f1
commit ae4b8d86df
7 changed files with 68 additions and 2 deletions

View file

@ -239,6 +239,16 @@ static CSSStyleSheet& mathml_stylesheet(DOM::Document const& document)
return *sheet;
}
static CSSStyleSheet& svg_stylesheet(DOM::Document const& document)
{
static JS::Handle<CSSStyleSheet> sheet;
if (!sheet.cell()) {
extern StringView svg_stylesheet_source;
sheet = JS::make_handle(parse_css_stylesheet(CSS::Parser::ParsingContext(document), svg_stylesheet_source));
}
return *sheet;
}
template<typename Callback>
void StyleComputer::for_each_stylesheet(CascadeOrigin cascade_origin, Callback callback) const
{
@ -247,6 +257,7 @@ void StyleComputer::for_each_stylesheet(CascadeOrigin cascade_origin, Callback c
if (document().in_quirks_mode())
callback(quirks_mode_stylesheet(document()));
callback(mathml_stylesheet(document()));
callback(svg_stylesheet(document()));
}
if (cascade_origin == CascadeOrigin::User) {
if (m_user_style_sheet)