diff --git a/components/devtools/actors/inspector/node.rs b/components/devtools/actors/inspector/node.rs index 6d054a62528..10ff9801844 100644 --- a/components/devtools/actors/inspector/node.rs +++ b/components/devtools/actors/inspector/node.rs @@ -244,7 +244,7 @@ impl NodeInfoToProtocol for NodeInfo { causes_overflow: false, container_type: None, display_name: self.node_name.clone().to_lowercase(), - display_type: Some("block".into()), + display_type: self.display, inline_text_child, is_after_pseudo_element: false, is_anonymous: false, diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 428a8d075b3..d4e404dc030 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -52,6 +52,7 @@ use crate::document_loader::DocumentLoader; use crate::dom::attr::Attr; use crate::dom::bindings::cell::{DomRefCell, Ref, RefMut}; use crate::dom::bindings::codegen::Bindings::AttrBinding::AttrMethods; +use crate::dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods; use crate::dom::bindings::codegen::Bindings::CharacterDataBinding::CharacterDataMethods; use crate::dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use crate::dom::bindings::codegen::Bindings::ElementBinding::ElementMethods; @@ -1207,6 +1208,12 @@ impl Node { self.ChildNodes().Length() as usize }; + let window = self.owner_window(); + let display = self + .downcast::() + .map(|elem| window.GetComputedStyle(elem, None)) + .map(|style| style.Display().into()); + NodeInfo { unique_id: self.unique_id(), host, @@ -1222,6 +1229,7 @@ impl Node { attrs: self.downcast().map(Element::summarize).unwrap_or(vec![]), is_shadow_host, shadow_root_mode, + display, } } diff --git a/components/shared/devtools/lib.rs b/components/shared/devtools/lib.rs index 6280761df5f..4436b58cbc1 100644 --- a/components/shared/devtools/lib.rs +++ b/components/shared/devtools/lib.rs @@ -139,6 +139,7 @@ pub struct NodeInfo { pub is_top_level_document: bool, pub shadow_root_mode: Option, pub is_shadow_host: bool, + pub display: Option, } pub struct StartedTimelineMarker {