mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Show correctly computed element display type in devtools (#35870)
Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
This commit is contained in:
parent
6cfa94f3bc
commit
79e25a3e77
3 changed files with 10 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -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::<Element>()
|
||||
.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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -139,6 +139,7 @@ pub struct NodeInfo {
|
|||
pub is_top_level_document: bool,
|
||||
pub shadow_root_mode: Option<ShadowRootMode>,
|
||||
pub is_shadow_host: bool,
|
||||
pub display: Option<String>,
|
||||
}
|
||||
|
||||
pub struct StartedTimelineMarker {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue