aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/htmlobjectelement.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2014-07-19 18:03:24 +0100
committerSimon Sapin <simon.sapin@exyr.org>2014-07-21 20:21:36 +0100
commit779cb44a44b195eb7a88e69a4f2e5551f85448e1 (patch)
tree9f8809e804c36ea8b141da6f2bd3e8a2b073105f /src/components/script/dom/htmlobjectelement.rs
parentb902e0f8f5c54614ae187e8e438d2f1dc242feb3 (diff)
downloadservo-779cb44a44b195eb7a88e69a4f2e5551f85448e1.tar.gz
servo-779cb44a44b195eb7a88e69a4f2e5551f85448e1.zip
Move is_image_data() where it’s used.
Diffstat (limited to 'src/components/script/dom/htmlobjectelement.rs')
-rw-r--r--src/components/script/dom/htmlobjectelement.rs6
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>;
}