diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-03-26 21:31:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-26 20:31:52 +0000 |
commit | 8dece05980a4ec46b06505e511f8b158d4c0fe3b (patch) | |
tree | 953792c871c8a86d5bd09981a5e5cdb8a204e297 /components/script/stylesheet_loader.rs | |
parent | b55d0a20532b915dee395f8c448ac832ed36b7d4 (diff) | |
download | servo-8dece05980a4ec46b06505e511f8b158d4c0fe3b.tar.gz servo-8dece05980a4ec46b06505e511f8b158d4c0fe3b.zip |
fonts: Add support for WOFF2 and properly load web fonts from @imports (#31879)
This change also makes two fixes that are necessary to get WOFF2 fonts
working:
1. It adds support for loading web fonts from stylesheets included via
@import rules.
2. It ensure that when web fonts are loaded synchronusly they invalidate
the font cache. This led to incorrect font rendering when running
tests before.
Fixes #31598.
Diffstat (limited to 'components/script/stylesheet_loader.rs')
-rw-r--r-- | components/script/stylesheet_loader.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/script/stylesheet_loader.rs b/components/script/stylesheet_loader.rs index 79ccae3019b..d9c2d789119 100644 --- a/components/script/stylesheet_loader.rs +++ b/components/script/stylesheet_loader.rs @@ -186,6 +186,10 @@ impl FetchResponseListener for StylesheetContext { Some(&loader), win.css_error_reporter(), ); + + // Layout knows about this stylesheet, because Stylo added it to the Stylist, + // but Layout doesn't know about any new web fonts that it contains. + document.load_web_fonts_from_stylesheet(stylesheet.clone()); }, } |