aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
parentb902e0f8f5c54614ae187e8e438d2f1dc242feb3 (diff)
downloadservo-779cb44a44b195eb7a88e69a4f2e5551f85448e1.tar.gz
servo-779cb44a44b195eb7a88e69a4f2e5551f85448e1.zip
Move is_image_data() where it’s used.
Diffstat (limited to 'src')
-rw-r--r--src/components/layout/construct.rs3
-rw-r--r--src/components/script/dom/htmlobjectelement.rs6
-rw-r--r--src/components/util/url.rs8
3 files changed, 7 insertions, 10 deletions
diff --git a/src/components/layout/construct.rs b/src/components/layout/construct.rs
index 113e4a28b60..27d7f480677 100644
--- a/src/components/layout/construct.rs
+++ b/src/components/layout/construct.rs
@@ -56,9 +56,10 @@ use script::dom::element::{HTMLTableRowElementTypeId, HTMLTableSectionElementTyp
use script::dom::node::{CommentNodeTypeId, DoctypeNodeTypeId, DocumentFragmentNodeTypeId};
use script::dom::node::{DocumentNodeTypeId, ElementNodeTypeId, ProcessingInstructionNodeTypeId};
use script::dom::node::{TextNodeTypeId};
+use script::dom::htmlobjectelement::is_image_data;
use servo_util::namespace;
use servo_util::range::Range;
-use servo_util::url::{is_image_data, parse_url};
+use servo_util::url::parse_url;
use std::mem;
use std::sync::atomics::Relaxed;
use style::ComputedValues;
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>;
}
diff --git a/src/components/util/url.rs b/src/components/util/url.rs
index 9778abd5f83..6876c150d6f 100644
--- a/src/components/util/url.rs
+++ b/src/components/util/url.rs
@@ -28,11 +28,3 @@ pub fn parse_url(str_url: &str, base_url: Option<rust_url::Url>) -> rust_url::Ur
// FIXME: Need to handle errors
try_parse_url(str_url, base_url).ok().expect("URL parsing failed")
}
-
-
-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_))
-}
-
-