Move is_image_data to script_layout_interface.

This commit is contained in:
Ms2ger 2016-06-16 09:44:40 +01:00
parent 65b93c20b7
commit 2c50318ee7
4 changed files with 6 additions and 9 deletions

View file

@ -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_))
}