mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Move HTMLCanvasData to script_layout_interface.
This commit is contained in:
parent
6b847eb93a
commit
000e2de57a
9 changed files with 22 additions and 12 deletions
|
@ -29,7 +29,7 @@ use net_traits::image::base::{Image, ImageMetadata};
|
|||
use net_traits::image_cache_thread::{ImageOrMetadataAvailable, UsePlaceholder};
|
||||
use range::*;
|
||||
use rustc_serialize::{Encodable, Encoder};
|
||||
use script::layout_interface::HTMLCanvasData;
|
||||
use script_layout_interface::HTMLCanvasData;
|
||||
use script_layout_interface::restyle_damage::{RECONSTRUCT_FLOW, RestyleDamage};
|
||||
use std::borrow::ToOwned;
|
||||
use std::cmp::{max, min};
|
||||
|
|
|
@ -40,12 +40,12 @@ use opaque_node::OpaqueNodeMethods;
|
|||
use range::Range;
|
||||
use script::layout_interface::{CAN_BE_FRAGMENTED, HAS_CHANGED, HAS_DIRTY_DESCENDANTS, IS_DIRTY};
|
||||
use script::layout_interface::{CharacterDataTypeId, Document, Element, ElementTypeId};
|
||||
use script::layout_interface::{HTMLCanvasData, HTMLElementTypeId, LayoutCharacterDataHelpers};
|
||||
use script::layout_interface::{HTMLElementTypeId, LayoutCharacterDataHelpers};
|
||||
use script::layout_interface::{LayoutDocumentHelpers, LayoutElementHelpers, LayoutJS};
|
||||
use script::layout_interface::{LayoutNodeHelpers, Node, NodeTypeId};
|
||||
use script::layout_interface::{RawLayoutElementHelpers, Text, TrustedNodeAddress};
|
||||
use script_layout_interface::LayoutNodeType;
|
||||
use script_layout_interface::restyle_damage::RestyleDamage;
|
||||
use script_layout_interface::{HTMLCanvasData, LayoutNodeType};
|
||||
use script_layout_interface::{OpaqueStyleAndLayoutData, PartialStyleAndLayoutData};
|
||||
use selectors::matching::{DeclarationBlock, ElementFlags};
|
||||
use selectors::parser::{AttrSelector, NamespaceConstraint};
|
||||
|
|
|
@ -30,6 +30,7 @@ use ipc_channel::ipc::{self, IpcSender};
|
|||
use js::jsapi::{HandleValue, JSContext};
|
||||
use offscreen_gl_context::GLContextAttributes;
|
||||
use rustc_serialize::base64::{STANDARD, ToBase64};
|
||||
use script_layout_interface::HTMLCanvasData;
|
||||
use std::iter::repeat;
|
||||
use string_cache::Atom;
|
||||
use style::attr::AttrValue;
|
||||
|
@ -92,12 +93,6 @@ impl HTMLCanvasElement {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct HTMLCanvasData {
|
||||
pub ipc_renderer: Option<IpcSender<CanvasMsg>>,
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
}
|
||||
|
||||
pub trait LayoutHTMLCanvasElementHelpers {
|
||||
fn data(&self) -> HTMLCanvasData;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ use dom::documenttype::DocumentType;
|
|||
use dom::element::{Element, ElementCreator};
|
||||
use dom::eventtarget::EventTarget;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
use dom::htmlcanvaselement::{LayoutHTMLCanvasElementHelpers, HTMLCanvasData};
|
||||
use dom::htmlcanvaselement::LayoutHTMLCanvasElementHelpers;
|
||||
use dom::htmlcollection::HTMLCollection;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::htmliframeelement::{HTMLIFrameElement, HTMLIFrameElementLayoutMethods};
|
||||
|
@ -61,7 +61,7 @@ use libc::{self, c_void, uintptr_t};
|
|||
use msg::constellation_msg::PipelineId;
|
||||
use parse::html::parse_html_fragment;
|
||||
use ref_slice::ref_slice;
|
||||
use script_layout_interface::OpaqueStyleAndLayoutData;
|
||||
use script_layout_interface::{HTMLCanvasData, OpaqueStyleAndLayoutData};
|
||||
use script_layout_interface::{LayoutNodeType, LayoutElementType};
|
||||
use script_traits::UntrustedNodeAddress;
|
||||
use selectors::matching::matches;
|
||||
|
|
|
@ -33,7 +33,6 @@ pub use dom::bindings::js::LayoutJS;
|
|||
pub use dom::characterdata::LayoutCharacterDataHelpers;
|
||||
pub use dom::document::{Document, LayoutDocumentHelpers};
|
||||
pub use dom::element::{Element, LayoutElementHelpers, RawLayoutElementHelpers};
|
||||
pub use dom::htmlcanvaselement::HTMLCanvasData;
|
||||
pub use dom::htmlobjectelement::is_image_data;
|
||||
pub use dom::node::{CAN_BE_FRAGMENTED, HAS_CHANGED, HAS_DIRTY_DESCENDANTS, IS_DIRTY};
|
||||
pub use dom::node::LayoutNodeHelpers;
|
||||
|
|
|
@ -10,7 +10,9 @@ path = "lib.rs"
|
|||
|
||||
[dependencies]
|
||||
bitflags = "0.7"
|
||||
canvas_traits = {path = "../canvas_traits"}
|
||||
heapsize = "0.3.0"
|
||||
heapsize_plugin = "0.1.2"
|
||||
ipc-channel = {git = "https://github.com/servo/ipc-channel"}
|
||||
plugins = {path = "../plugins"}
|
||||
style = {path = "../style"}
|
||||
|
|
|
@ -17,13 +17,17 @@
|
|||
#[allow(unused_extern_crates)]
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
extern crate canvas_traits;
|
||||
extern crate core;
|
||||
extern crate heapsize;
|
||||
extern crate ipc_channel;
|
||||
extern crate style;
|
||||
|
||||
pub mod restyle_damage;
|
||||
|
||||
use canvas_traits::CanvasMsg;
|
||||
use core::nonzero::NonZero;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use restyle_damage::RestyleDamage;
|
||||
use std::cell::RefCell;
|
||||
use style::servo::PrivateStyleData;
|
||||
|
@ -69,3 +73,9 @@ pub enum LayoutElementType {
|
|||
HTMLTableSectionElement,
|
||||
HTMLTextAreaElement,
|
||||
}
|
||||
|
||||
pub struct HTMLCanvasData {
|
||||
pub ipc_renderer: Option<IpcSender<CanvasMsg>>,
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
}
|
||||
|
|
2
components/servo/Cargo.lock
generated
2
components/servo/Cargo.lock
generated
|
@ -1931,8 +1931,10 @@ name = "script_layout_interface"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"canvas_traits 0.0.1",
|
||||
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
|
||||
"plugins 0.0.1",
|
||||
"style 0.0.1",
|
||||
]
|
||||
|
|
2
ports/cef/Cargo.lock
generated
2
ports/cef/Cargo.lock
generated
|
@ -1789,8 +1789,10 @@ name = "script_layout_interface"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"canvas_traits 0.0.1",
|
||||
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
|
||||
"plugins 0.0.1",
|
||||
"style 0.0.1",
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue