aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2019-01-09 13:15:04 +0100
committerAnthony Ramine <n.oxyde@gmail.com>2019-01-09 13:15:04 +0100
commitddef6211b39d0b4927aff02646070f6ebc052eaa (patch)
treed35b95015a77485329616ccb050cd7f5f27d5ff8
parent1120da60332de01a623dc90c15ad65d4eeb0269a (diff)
downloadservo-ddef6211b39d0b4927aff02646070f6ebc052eaa.tar.gz
servo-ddef6211b39d0b4927aff02646070f6ebc052eaa.zip
Move is_image_data to the layout crate
It's only used there.
-rw-r--r--components/layout/construct.rs8
-rw-r--r--components/script_layout_interface/lib.rs6
2 files changed, 7 insertions, 7 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index efa31184dac..cef9d5f5be5 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -51,7 +51,7 @@ use crate::ServoArc;
use script_layout_interface::wrapper_traits::{
PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode,
};
-use script_layout_interface::{is_image_data, LayoutElementType, LayoutNodeType};
+use script_layout_interface::{LayoutElementType, LayoutNodeType};
use servo_config::opts;
use servo_url::ServoUrl;
use std::collections::LinkedList;
@@ -2472,3 +2472,9 @@ impl Legalizer {
FlowRef::new(Arc::new(constructor(fragment)))
}
}
+
+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_))
+}
diff --git a/components/script_layout_interface/lib.rs b/components/script_layout_interface/lib.rs
index 162a04168a6..d4e25c1b3c7 100644
--- a/components/script_layout_interface/lib.rs
+++ b/components/script_layout_interface/lib.rs
@@ -128,12 +128,6 @@ 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_))
-}
-
/// Whether the pending image needs to be fetched or is waiting on an existing fetch.
pub enum PendingImageState {
Unrequested(ServoUrl),