mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Move is_image_data to script_layout_interface.
This commit is contained in:
parent
65b93c20b7
commit
2c50318ee7
4 changed files with 6 additions and 9 deletions
|
@ -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;
|
||||
|
|
|
@ -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> {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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_))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue