mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Move is_image_data() where it’s used.
This commit is contained in:
parent
b902e0f8f5
commit
779cb44a44
3 changed files with 7 additions and 10 deletions
|
@ -22,7 +22,6 @@ use servo_net::image_cache_task;
|
|||
use servo_net::image_cache_task::ImageCacheTask;
|
||||
use servo_util::url::parse_url;
|
||||
use servo_util::namespace::Null;
|
||||
use servo_util::url::is_image_data;
|
||||
use url::Url;
|
||||
|
||||
#[deriving(Encodable)]
|
||||
|
@ -74,6 +73,11 @@ impl<'a> ProcessDataURL for JSRef<'a, HTMLObjectElement> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn is_image_data(uri: &str) -> bool {
|
||||
static types: &'static [&'static str] = &["data:image/png", "data:image/gif", "data:image/jpeg"];
|
||||
types.iter().any(|&type_| uri.starts_with(type_))
|
||||
}
|
||||
|
||||
pub trait HTMLObjectElementMethods {
|
||||
fn Validity(&self) -> Temporary<ValidityState>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue