diff options
Diffstat (limited to 'src/components/script/dom/htmlobjectelement.rs')
-rw-r--r-- | src/components/script/dom/htmlobjectelement.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/components/script/dom/htmlobjectelement.rs b/src/components/script/dom/htmlobjectelement.rs index 7305e480988..9fdabdae318 100644 --- a/src/components/script/dom/htmlobjectelement.rs +++ b/src/components/script/dom/htmlobjectelement.rs @@ -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>; } |