aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-01-28 05:52:56 -0600
committerGitHub <noreply@github.com>2018-01-28 05:52:56 -0600
commit2a46067587d63aec176621ab3b6112ef5200a248 (patch)
treee5b4a8b24ef7ec251cdd9123221e1c28b9a6c965 /components/script/dom/node.rs
parent025e5d773313e16ffe73ae63efc068b79b82d531 (diff)
parentfe583fc5d0aa667b40ecddfb1cbff3c5f65649d7 (diff)
downloadservo-2a46067587d63aec176621ab3b6112ef5200a248.tar.gz
servo-2a46067587d63aec176621ab3b6112ef5200a248.zip
Auto merge of #19881 - jonleighton:issue-19811, r=emilio
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. r? @emilio <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19881) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 68e6f63e168..28e10cf798c 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -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