aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/layout/layout_task.rs
diff options
context:
space:
mode:
authorGlenn Watson <gw@intuitionlibrary.com>2014-07-14 15:57:46 +1000
committerGlenn Watson <gw@intuitionlibrary.com>2014-07-24 13:24:22 +1000
commitc76cd128a7477cabdb81bb8814a78d45b34a92a0 (patch)
treec447005f2947e4e43fb07e5740fbce1534a5db83 /src/components/layout/layout_task.rs
parent40559d148aaa80f040506a08b9a4e4d163dfc51a (diff)
downloadservo-c76cd128a7477cabdb81bb8814a78d45b34a92a0.tar.gz
servo-c76cd128a7477cabdb81bb8814a78d45b34a92a0.zip
Don't rely on font hint for format detection. Handle parsing comma
separated format hints. Fix oversight in mac code dealing with creating web fonts from memory.
Diffstat (limited to 'src/components/layout/layout_task.rs')
-rw-r--r--src/components/layout/layout_task.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/components/layout/layout_task.rs b/src/components/layout/layout_task.rs
index 1c5e842553e..44cfde0225b 100644
--- a/src/components/layout/layout_task.rs
+++ b/src/components/layout/layout_task.rs
@@ -61,7 +61,6 @@ use std::ptr;
use std::task::TaskBuilder;
use style::{AuthorOrigin, Stylesheet, Stylist};
use style::CSSFontFaceRule;
-use style::TtfFormat;
use sync::{Arc, Mutex};
use url::Url;
@@ -455,20 +454,16 @@ 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) => {
+ let mut font_urls = vec!();
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());
- },
- _ => {}
- }
+ font_urls.push(source.url.clone());
}
}
+ self.font_cache_task.add_web_font(font_urls, font_face_rule.family.as_slice());
},
_ => {}
}