mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +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
|
@ -82,6 +82,7 @@ use std::mem;
|
|||
use std::ops::Range;
|
||||
use style::context::QuirksMode;
|
||||
use style::dom::OpaqueNode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::selector_parser::{SelectorImpl, SelectorParser};
|
||||
use style::stylesheets::Stylesheet;
|
||||
use style::thread_state;
|
||||
|
@ -619,6 +620,10 @@ impl Node {
|
|||
window_from_node(self).client_rect_query(self.to_trusted_node_address())
|
||||
}
|
||||
|
||||
pub fn style(&self) -> Option<Arc<ComputedValues>> {
|
||||
window_from_node(self).style_query(self.to_trusted_node_address())
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom-view/#dom-element-scrollwidth
|
||||
// https://drafts.csswg.org/cssom-view/#dom-element-scrollheight
|
||||
// https://drafts.csswg.org/cssom-view/#dom-element-scrolltop
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue