Resolves #4183 - Implemementing context-based MIME type sniffing

The version of the standard is not finalized at the time of this writing.
Specifications may be found here: https://mimesniff.spec.whatwg.org/#context-specific-sniffing .
This commit is contained in:
David Rajchenbach-Teller 2015-09-30 12:22:00 +02:00 committed by Josh Matthews
parent 66c8aa8cda
commit 1e81b8c133
18 changed files with 226 additions and 93 deletions

View file

@ -5,7 +5,7 @@
use font_template::{FontTemplate, FontTemplateDescriptor};
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use net_traits::{AsyncResponseTarget, PendingAsyncLoad, ResourceTask, ResponseAction};
use net_traits::{AsyncResponseTarget, LoadContext, PendingAsyncLoad, ResourceTask, ResponseAction};
use platform::font_context::FontContextHandle;
use platform::font_list::for_each_available_family;
use platform::font_list::for_each_variation;
@ -156,7 +156,8 @@ impl FontCache {
match src {
Source::Url(ref url_source) => {
let url = &url_source.url;
let load = PendingAsyncLoad::new(self.resource_task.clone(),
let load = PendingAsyncLoad::new(LoadContext::Font,
self.resource_task.clone(),
url.clone(),
None);
let (data_sender, data_receiver) = ipc::channel().unwrap();