mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
fonts: Remove web fonts when their stylsheet is removed (#32346)
This is the first part of ensuring that unused fonts do not leak. This change makes it so that when a stylesheet is removed, the corresponding web fonts are removed from the `FontContext`. Note: WebRender assets are still leaked, which was the situation before for all fonts. A followup change will fix this issue. Fixes #15139. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
parent
a772ecf786
commit
14286d913d
10 changed files with 258 additions and 57 deletions
|
@ -24,6 +24,7 @@ use servo_atoms::Atom;
|
|||
use servo_url::ServoUrl;
|
||||
use style::properties::longhands::font_variant_caps::computed_value::T as FontVariantCaps;
|
||||
use style::properties::style_structs::Font as FontStyleStruct;
|
||||
use style::stylesheets::Stylesheet;
|
||||
use style::values::computed::font::{
|
||||
FamilyName, FontFamily, FontFamilyList, FontFamilyNameSyntax, FontSize, FontStretch, FontStyle,
|
||||
FontWeight, SingleFontFamily,
|
||||
|
@ -85,6 +86,7 @@ impl MockFontCacheThread {
|
|||
Self::url_for_font_name(name),
|
||||
std::sync::Arc::new(data),
|
||||
&CSSFontFaceDescriptors::new(name),
|
||||
None,
|
||||
)
|
||||
.unwrap(),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue