Move OpaqueStyleAndLayoutData to script_layout_interface.

This commit is contained in:
Ms2ger 2016-06-15 00:00:28 +01:00
parent 5cab8ff8d2
commit 6aaf3e6a01
11 changed files with 35 additions and 16 deletions

View file

@ -46,10 +46,10 @@ use query::process_offset_parent_query;
use query::{LayoutRPCImpl, process_content_box_request, process_content_boxes_request};
use query::{process_node_geometry_request, process_node_layer_id_request, process_node_scroll_area_request};
use query::{process_node_overflow_request, process_resolved_style_request, process_margin_style_query};
use script::layout_interface::OpaqueStyleAndLayoutData;
use script::layout_interface::{LayoutRPC, OffsetParentResponse, NodeOverflowResponse, MarginStyleResponse};
use script::layout_interface::{Msg, NewLayoutThreadInfo, Reflow, ReflowQueryType, ScriptReflow};
use script::reporter::CSSErrorReporter;
use script_layout_interface::OpaqueStyleAndLayoutData;
use script_layout_interface::restyle_damage::{REPAINT, STORE_OVERFLOW, REFLOW_OUT_OF_FLOW, REFLOW};
use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg};
use script_traits::{StackingContextScrollState, UntrustedNodeAddress};

View file

@ -42,8 +42,9 @@ use script::layout_interface::{CAN_BE_FRAGMENTED, HAS_CHANGED, HAS_DIRTY_DESCEND
use script::layout_interface::{CharacterDataTypeId, Document, Element, ElementTypeId};
use script::layout_interface::{HTMLCanvasData, HTMLElementTypeId, LayoutCharacterDataHelpers};
use script::layout_interface::{LayoutDocumentHelpers, LayoutElementHelpers, LayoutJS};
use script::layout_interface::{LayoutNodeHelpers, Node, NodeTypeId, OpaqueStyleAndLayoutData};
use script::layout_interface::{LayoutNodeHelpers, Node, NodeTypeId};
use script::layout_interface::{RawLayoutElementHelpers, Text, TrustedNodeAddress};
use script_layout_interface::OpaqueStyleAndLayoutData;
use script_layout_interface::restyle_damage::RestyleDamage;
use selectors::matching::{DeclarationBlock, ElementFlags};
use selectors::parser::{AttrSelector, NamespaceConstraint};

View file

@ -52,6 +52,7 @@ ref_filter_map = "1.0"
ref_slice = "1.0"
regex = "0.1.43"
rustc-serialize = "0.3"
script_layout_interface = {path = "../script_layout_interface"}
script_traits = {path = "../script_traits"}
selectors = {version = "0.6", features = ["heap_size"]}
serde = "0.7"

View file

@ -67,6 +67,7 @@ use net_traits::{Metadata, NetworkError, ResourceThreads};
use offscreen_gl_context::GLLimits;
use profile_traits::mem::ProfilerChan as MemProfilerChan;
use profile_traits::time::ProfilerChan as TimeProfilerChan;
use script_layout_interface::OpaqueStyleAndLayoutData;
use script_runtime::ScriptChan;
use script_traits::{TimerEventId, TimerSource, TouchpadPressurePhase, UntrustedNodeAddress};
use serde::{Deserialize, Serialize};
@ -328,6 +329,7 @@ no_jsmanaged_fields!(ReferrerPolicy);
no_jsmanaged_fields!(ResourceThreads);
no_jsmanaged_fields!(SystemTime);
no_jsmanaged_fields!(SelectedFileId);
no_jsmanaged_fields!(OpaqueStyleAndLayoutData);
impl JSTraceable for Box<ScriptChan + Send> {
#[inline]

View file

@ -5,7 +5,6 @@
//! The core DOM types. Defines the basic DOM hierarchy as well as all the HTML elements.
use app_units::Au;
use core::nonzero::NonZero;
use devtools_traits::NodeInfo;
use document_loader::DocumentLoader;
use dom::attr::Attr;
@ -62,6 +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_traits::UntrustedNodeAddress;
use selectors::matching::matches;
use selectors::parser::Selector;
@ -184,18 +184,6 @@ enum SuppressObserver {
Unsuppressed
}
#[derive(Copy, Clone, HeapSizeOf)]
pub struct OpaqueStyleAndLayoutData {
#[ignore_heap_size_of = "TODO(#6910) Box value that should be counted but \
the type lives in layout"]
pub ptr: NonZero<*mut ()>
}
#[allow(unsafe_code)]
unsafe impl Send for OpaqueStyleAndLayoutData {}
no_jsmanaged_fields!(OpaqueStyleAndLayoutData);
impl Node {
/// Sends the style and layout data, if any, back to the layout thread to be destroyed.
pub fn dispose(&self, data: OpaqueStyleAndLayoutData) {

View file

@ -14,6 +14,7 @@ use ipc_channel::ipc::{IpcReceiver, IpcSender};
use msg::constellation_msg::{PanicMsg, PipelineId, WindowSizeData};
use net_traits::image_cache_thread::ImageCacheThread;
use profile_traits::mem::ReportsChan;
use script_layout_interface::OpaqueStyleAndLayoutData;
use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg};
use script_traits::{StackingContextScrollState, UntrustedNodeAddress};
use std::sync::Arc;
@ -37,7 +38,6 @@ 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;
pub use dom::node::Node;
pub use dom::node::OpaqueStyleAndLayoutData;
pub use dom::node::TrustedNodeAddress;
pub use dom::text::Text;

View file

@ -68,6 +68,7 @@ extern crate ref_filter_map;
extern crate ref_slice;
extern crate regex;
extern crate rustc_serialize;
extern crate script_layout_interface;
extern crate script_traits;
extern crate selectors;
extern crate serde;

View file

@ -10,5 +10,7 @@ path = "lib.rs"
[dependencies]
bitflags = "0.7"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
plugins = {path = "../plugins"}
style = {path = "../style"}

View file

@ -7,12 +7,30 @@
//! to depend on script.
#![deny(unsafe_code)]
#![feature(custom_attribute)]
#![feature(custom_derive)]
#![feature(nonzero)]
#![feature(plugin)]
#![plugin(heapsize_plugin)]
#![plugin(plugins)]
#[allow(unused_extern_crates)]
#[macro_use]
extern crate bitflags;
extern crate core;
extern crate heapsize;
extern crate style;
pub mod restyle_damage;
use core::nonzero::NonZero;
#[derive(Copy, Clone, HeapSizeOf)]
pub struct OpaqueStyleAndLayoutData {
#[ignore_heap_size_of = "TODO(#6910) Box value that should be counted but \
the type lives in layout"]
pub ptr: NonZero<*mut ()>
}
#[allow(unsafe_code)]
unsafe impl Send for OpaqueStyleAndLayoutData {}

View file

@ -1909,6 +1909,7 @@ dependencies = [
"ref_slice 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.71 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"script_layout_interface 0.0.1",
"script_traits 0.0.1",
"selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1930,6 +1931,8 @@ name = "script_layout_interface"
version = "0.0.1"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"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)",
"plugins 0.0.1",
"style 0.0.1",
]

3
ports/cef/Cargo.lock generated
View file

@ -1767,6 +1767,7 @@ dependencies = [
"ref_slice 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.71 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"script_layout_interface 0.0.1",
"script_traits 0.0.1",
"selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1788,6 +1789,8 @@ name = "script_layout_interface"
version = "0.0.1"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"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)",
"plugins 0.0.1",
"style 0.0.1",
]