aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/devtools.rs
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2018-01-27 21:30:24 +0100
committerJon Leighton <j@jonathanleighton.com>2018-01-28 10:59:45 +0100
commitfe583fc5d0aa667b40ecddfb1cbff3c5f65649d7 (patch)
tree580d3aa22053fd2ddd99d0151f6515ad318e3c39 /components/script/devtools.rs
parentc9ba16f9fbdf7f43cb19feedfaaa68c85bbcbe3b (diff)
downloadservo-fe583fc5d0aa667b40ecddfb1cbff3c5f65649d7.tar.gz
servo-fe583fc5d0aa667b40ecddfb1cbff3c5f65649d7.zip
Add layout RPC query for getting an element's style
This enables us to implement Element::has_css_layout_box() in a more direct way, and also enables us to remove some of the existing more specific queries. Fixes #19811.
Diffstat (limited to 'components/script/devtools.rs')
-rw-r--r--components/script/devtools.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/components/script/devtools.rs b/components/script/devtools.rs
index 585ecd47a15..0d2b4a9e4eb 100644
--- a/components/script/devtools.rs
+++ b/components/script/devtools.rs
@@ -154,12 +154,13 @@ pub fn handle_get_layout(documents: &Documents,
}
fn determine_auto_margins(window: &Window, node: &Node) -> AutoMargins {
- let margin = window.margin_style_query(node.to_trusted_node_address());
+ let style = window.style_query(node.to_trusted_node_address()).unwrap();
+ let margin = style.get_margin();
AutoMargins {
- top: margin.top == margin_top::computed_value::T::Auto,
- right: margin.right == margin_right::computed_value::T::Auto,
- bottom: margin.bottom == margin_bottom::computed_value::T::Auto,
- left: margin.left == margin_left::computed_value::T::Auto,
+ top: margin.margin_top == margin_top::computed_value::T::Auto,
+ right: margin.margin_right == margin_right::computed_value::T::Auto,
+ bottom: margin.margin_bottom == margin_bottom::computed_value::T::Auto,
+ left: margin.margin_left == margin_left::computed_value::T::Auto,
}
}