aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/window.rs
diff options
context:
space:
mode:
authorbenshu <benshu@benshu.de>2015-08-18 15:11:09 +0200
committerJosh Matthews <josh@joshmatthews.net>2016-02-24 13:51:47 -0500
commit0785d91ae460dc0702dc1cd8f5e00d0c0446269c (patch)
treef62a9d56e106c751eb0dc4b6eb2c54de0b6b2ffa /components/script/dom/window.rs
parent9ab2da3cd111eb619d5ed779b6bb42c750a99f00 (diff)
downloadservo-0785d91ae460dc0702dc1cd8f5e00d0c0446269c.tar.gz
servo-0785d91ae460dc0702dc1cd8f5e00d0c0446269c.zip
Completed implementation of devtools' `getLayout`.
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r--components/script/dom/window.rs10
1 files changed, 9 insertions, 1 deletions
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 {