aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/layout/construct.rs3
-rw-r--r--components/script/dom/htmlobjectelement.rs5
-rw-r--r--components/script/layout_interface.rs2
-rw-r--r--components/script_layout_interface/lib.rs5
4 files changed, 6 insertions, 9 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index 27c6f629ca6..40ffdc42047 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -33,10 +33,9 @@ use inline::{InlineFragmentNodeInfo, LAST_FRAGMENT_OF_ELEMENT};
use list_item::{ListItemFlow, ListStyleTypeContent};
use multicol::{MulticolFlow, MulticolColumnFlow};
use parallel;
-use script::layout_interface::is_image_data;
use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, RECONSTRUCT_FLOW, RestyleDamage};
use script_layout_interface::wrapper_traits::{ThreadSafeLayoutNode, PseudoElementType, ThreadSafeLayoutElement};
-use script_layout_interface::{LayoutNodeType, LayoutElementType};
+use script_layout_interface::{LayoutNodeType, LayoutElementType, is_image_data};
use std::borrow::ToOwned;
use std::collections::LinkedList;
use std::marker::PhantomData;
diff --git a/components/script/dom/htmlobjectelement.rs b/components/script/dom/htmlobjectelement.rs
index 268ff17e9cf..13798632e17 100644
--- a/components/script/dom/htmlobjectelement.rs
+++ b/components/script/dom/htmlobjectelement.rs
@@ -68,11 +68,6 @@ impl<'a> ProcessDataURL for &'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_))
-}
-
impl HTMLObjectElementMethods for HTMLObjectElement {
// https://html.spec.whatwg.org/multipage/#dom-cva-validity
fn Validity(&self) -> Root<ValidityState> {
diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs
index b06940ea227..350c8150109 100644
--- a/components/script/layout_interface.rs
+++ b/components/script/layout_interface.rs
@@ -27,8 +27,6 @@ use style::servo::Stylesheet;
use url::Url;
use util::ipc::OptionalOpaqueIpcSender;
-pub use dom::htmlobjectelement::is_image_data;
-
/// Asynchronous messages that script can send to layout.
pub enum Msg {
/// Adds the given stylesheet to the document.
diff --git a/components/script_layout_interface/lib.rs b/components/script_layout_interface/lib.rs
index 123792a6c6f..33d6696b782 100644
--- a/components/script_layout_interface/lib.rs
+++ b/components/script_layout_interface/lib.rs
@@ -100,3 +100,8 @@ pub struct TrustedNodeAddress(pub *const c_void);
#[allow(unsafe_code)]
unsafe impl Send for TrustedNodeAddress {}
+
+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_))
+}