Don't go through the layout thread to retrieve a node's primary style

This commit is contained in:
Anthony Ramine 2020-04-07 13:13:33 +02:00
parent 030a1cf8fb
commit c10e839924
10 changed files with 38 additions and 79 deletions

View file

@ -396,7 +396,7 @@ impl Element {
/// style will be `None` for elements in a `display: none` subtree. otherwise, the element has a
/// layout box iff it doesn't have `display: none`.
pub fn style(&self) -> Option<Arc<ComputedValues>> {
window_from_node(self).style_query(self.upcast::<Node>().to_trusted_node_address())
self.upcast::<Node>().style()
}
// https://drafts.csswg.org/cssom-view/#css-layout-box