mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
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.
This commit is contained in:
parent
c9ba16f9fb
commit
fe583fc5d0
10 changed files with 88 additions and 136 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue