Introduce FontFaceRules::effective_sources()

This avoids downloading fonts in formats we don't support.
This commit is contained in:
Anthony Ramine 2016-06-02 22:27:55 +02:00
parent 1621e0679e
commit 64b34d5162
2 changed files with 34 additions and 2 deletions

View file

@ -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(),