mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-23 17:33:12 +00:00
LibWeb/CSS: Parse @font-face
descriptors as style values
CSSFontFaceRule now stores its values as a CSSFontFaceDescriptors, with a ParsedFontFace produced on request. This is exposed via the `style` attribute, so we pass a lot of tests that try to read values from that. We have one test regression, which we passed by mistake before: The test wanted to ensure we don't allow `@font-face` nested inside other rules. We passed it just because we discarded any `@font-face` without a `font-family`. What we're supposed to do is 1) keep at-rules with missing required descriptors and just not use them, and 2) reject certain ones when nested. We may want to cache the ParsedFontFace in the future, but I didn't here because 1) it's called rarely, and 2) that would mean knowing to invalidate it when the CSSFontFaceDescriptors changes, which isn't obvious to me right now.
This commit is contained in:
parent
3c9685ff1a
commit
f87b454fa9
Notes:
github-actions[bot]
2025-04-04 09:41:41 +00:00
Author: https://github.com/AtkinsSJ
Commit: f87b454fa9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4206
12 changed files with 118 additions and 378 deletions
|
@ -701,7 +701,7 @@ void dump_rule(StringBuilder& builder, CSS::CSSRule const& rule, int indent_leve
|
|||
|
||||
void dump_font_face_rule(StringBuilder& builder, CSS::CSSFontFaceRule const& rule, int indent_levels)
|
||||
{
|
||||
auto& font_face = rule.font_face();
|
||||
auto const font_face = rule.font_face();
|
||||
indent(builder, indent_levels + 1);
|
||||
builder.appendff("font-family: {}\n", font_face.font_family());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue