aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/layout/layout_task.rs
diff options
context:
space:
mode:
authorGlenn Watson <gw@intuitionlibrary.com>2014-07-11 10:30:52 +1000
committerGlenn Watson <gw@intuitionlibrary.com>2014-07-24 13:24:22 +1000
commit40559d148aaa80f040506a08b9a4e4d163dfc51a (patch)
treeb93525cfa2da7c2ee0d593e362cb796ab000403f /src/components/layout/layout_task.rs
parent6465bf6a851435c66285130f4dd4d3c8678ebcc7 (diff)
downloadservo-40559d148aaa80f040506a08b9a4e4d163dfc51a.tar.gz
servo-40559d148aaa80f040506a08b9a4e4d163dfc51a.zip
Address review comments.
Diffstat (limited to 'src/components/layout/layout_task.rs')
-rw-r--r--src/components/layout/layout_task.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/components/layout/layout_task.rs b/src/components/layout/layout_task.rs
index eb7cfade084..1c5e842553e 100644
--- a/src/components/layout/layout_task.rs
+++ b/src/components/layout/layout_task.rs
@@ -455,20 +455,23 @@ impl LayoutTask {
// Find all font-face rules and notify the font cache of them.
// GWTODO: Need to handle unloading web fonts (when we handle unloading stylesheets!)
// GWTODO: Need to handle font-face nested within media rules.
+ // GWTODO: Don't rely on format hint here. Should determine file format from data.
for rule in sheet.rules.iter() {
match rule {
&CSSFontFaceRule(ref font_face_rule) => {
- for source in font_face_rule.sources.iter() {
- match source.format {
- TtfFormat => {
- self.font_cache_task.add_web_font(source.url.clone(), font_face_rule.family.as_slice());
- },
- _ => {}
+ for source_line in font_face_rule.source_lines.iter() {
+ for source in source_line.sources.iter() {
+ match source.format_hint {
+ TtfFormat => {
+ self.font_cache_task.add_web_font(source.url.clone(), font_face_rule.family.as_slice());
+ },
+ _ => {}
+ }
}
}
},
_ => {}
- }
+ }
}
self.stylist.add_stylesheet(sheet, AuthorOrigin);