diff options
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/node.rs | 1 | ||||
-rw-r--r-- | components/script/dom/window.rs | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index f1ebf6f9965..c82fbb49e88 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -185,7 +185,6 @@ unsafe impl Send for OpaqueStyleAndLayoutData {} no_jsmanaged_fields!(OpaqueStyleAndLayoutData); - impl OpaqueStyleAndLayoutData { /// Sends the style and layout data, if any, back to the layout thread to be destroyed. pub fn dispose(self, node: &Node) { diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 908d3dffd2c..0869423c55b 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -41,7 +41,7 @@ use js::jsapi::{JSAutoCompartment, JSAutoRequest, JS_GC, JS_GetRuntime}; use js::rust::CompileOptionsWrapper; use js::rust::Runtime; use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleResponse, ScriptReflow}; -use layout_interface::{LayoutChan, LayoutRPC, Msg, Reflow, ReflowQueryType}; +use layout_interface::{LayoutChan, LayoutRPC, Msg, Reflow, ReflowQueryType, MarginStyleResponse}; use libc; use msg::constellation_msg::{ConstellationChan, LoadData, PipelineId, SubpageId, WindowSizeData}; use msg::webdriver_msg::{WebDriverJSError, WebDriverJSResult}; @@ -1099,6 +1099,13 @@ impl Window { (element, response.rect) } + pub fn margin_style_query(&self, node: TrustedNodeAddress) -> MarginStyleResponse { + self.reflow(ReflowGoal::ForScriptQuery, + ReflowQueryType::MarginStyleQuery(node), + ReflowReason::Query); + self.layout_rpc.margin_style() + } + pub fn init_browsing_context(&self, browsing_context: &BrowsingContext) { assert!(self.browsing_context.get().is_none()); self.browsing_context.set(Some(&browsing_context)); @@ -1420,6 +1427,7 @@ fn debug_reflow_events(goal: &ReflowGoal, query_type: &ReflowQueryType, reason: ReflowQueryType::NodeGeometryQuery(_n) => "\tNodeGeometryQuery", ReflowQueryType::ResolvedStyleQuery(_, _, _) => "\tResolvedStyleQuery", ReflowQueryType::OffsetParentQuery(_n) => "\tOffsetParentQuery", + ReflowQueryType::MarginStyleQuery(_n) => "\tMarginStyleQuery", }); debug_msg.push_str(match *reason { |