diff options
author | Adenilson Cavalcanti <cavalcantii@gmail.com> | 2015-03-25 15:29:53 -0700 |
---|---|---|
committer | Adenilson Cavalcanti <cavalcantii@gmail.com> | 2015-03-30 10:02:54 -0700 |
commit | cdebb3ca543bb7f8d0bd71d8387925f5d8439f75 (patch) | |
tree | 1009813ef5995ab8ed71af4ef43252b373913479 /components/servo/lib.rs | |
parent | 5ead929fea34ca6d05d6bc4f0a07eeab4dfae207 (diff) | |
download | servo-cdebb3ca543bb7f8d0bd71d8387925f5d8439f75.tar.gz servo-cdebb3ca543bb7f8d0bd71d8387925f5d8439f75.zip |
Load a placeholder when a url to an image is broken.
I decided to use the old Netscape broken image link icon (later we may
replace the image asset for something more trendier). The ref test will
expect that a failed load should display the rippy image.
ImageCacheTask users can define if a placeholder image should be loaded
at start up or not. This enables both the new behavior (e.g. always
return an image even for broken urls) as also the previous one.
Diffstat (limited to 'components/servo/lib.rs')
-rw-r--r-- | components/servo/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 1afdbf8dca5..b197ad30e6f 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -33,7 +33,7 @@ use msg::constellation_msg::ConstellationChan; use script::dom::bindings::codegen::RegisterBindings; #[cfg(not(test))] -use net::image_cache_task::ImageCacheTask; +use net::image_cache_task::{ImageCacheTask, LoadPlaceholder}; #[cfg(not(test))] use net::resource_task::new_resource_task; #[cfg(not(test))] @@ -84,10 +84,10 @@ impl Browser { // image. let image_cache_task = if opts.output_file.is_some() { ImageCacheTask::new_sync(resource_task.clone(), shared_task_pool, - time_profiler_chan.clone()) + time_profiler_chan.clone(), LoadPlaceholder::Preload) } else { ImageCacheTask::new(resource_task.clone(), shared_task_pool, - time_profiler_chan.clone()) + time_profiler_chan.clone(), LoadPlaceholder::Preload) }; let font_cache_task = FontCacheTask::new(resource_task.clone()); |