mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Introduce FontFaceRules::effective_sources()
This avoids downloading fonts in formats we don't support.
This commit is contained in:
parent
1621e0679e
commit
64b34d5162
2 changed files with 34 additions and 2 deletions
|
@ -360,7 +360,7 @@ fn add_font_face_rules(stylesheet: &Stylesheet,
|
|||
if opts::get().load_webfonts_synchronously {
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
for font_face in stylesheet.effective_rules(&device).font_face() {
|
||||
for source in &font_face.sources {
|
||||
for source in font_face.effective_sources() {
|
||||
font_cache_thread.add_web_font(font_face.family.clone(),
|
||||
(*source).clone(),
|
||||
sender.clone());
|
||||
|
@ -369,7 +369,7 @@ fn add_font_face_rules(stylesheet: &Stylesheet,
|
|||
}
|
||||
} else {
|
||||
for font_face in stylesheet.effective_rules(&device).font_face() {
|
||||
for source in &font_face.sources {
|
||||
for source in font_face.effective_sources() {
|
||||
outstanding_web_fonts_counter.fetch_add(1, Ordering::SeqCst);
|
||||
font_cache_thread.add_web_font(font_face.family.clone(),
|
||||
(*source).clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue