LibWeb: Make sure we run selectors for mixed-case tag names

Before this change, we would never apply CSS rules where the selector
had a mixed-case tag name. This happened because our rule caches would
key them on the lowercased tag name, but we didn't lowercase the tag
name when fetching things from the cache.

This uncovered the fact that the SVG2 spec has a bunch of style applied
to non-rendered elements in a way that doesn't match other browsers.
Instead of blindly following the spec, we now match other browsers.
This commit is contained in:
Andreas Kling 2025-07-07 15:18:22 +02:00 committed by Andreas Kling
commit b3fd939628
Notes: github-actions[bot] 2025-07-09 12:37:53 +00:00
5 changed files with 11 additions and 10 deletions

View file

@ -14,14 +14,8 @@ svg:not(:root), image, marker, pattern, symbol { overflow: hidden; }
white-space-collapse: preserve-spaces;
}
/* FIXME: Allow setting the rest of these to `display: none`.
Currently that breaks <use> and <mask> and probably others. */
desc, title, metadata,
pattern, linearGradient, radialGradient,
script, style {
display: none !important;
}
/*
/* NOTE: These rules are in the SVG spec, but don't match how other engines behave.
So we simply comment them out for now.
defs,
clipPath, mask, marker,
desc, title, metadata,
@ -30,10 +24,11 @@ script, style,
symbol {
display: none !important;
}
*/
:host(use) > symbol {
display: inline !important;
}
*/
:link, :visited {
cursor: pointer;
}