diff --git a/components/devtools/actors/inspector/node.rs b/components/devtools/actors/inspector/node.rs index 10ff9801844..a731f15b2d8 100644 --- a/components/devtools/actors/inspector/node.rs +++ b/components/devtools/actors/inspector/node.rs @@ -78,6 +78,18 @@ pub struct NodeActorMsg { shadow_root_mode: Option, traits: HashMap, attrs: Vec, + + /// The `DOCTYPE` name if this is a `DocumentType` node, `None` otherwise + #[serde(skip_serializing_if = "Option::is_none")] + name: Option, + + /// The `DOCTYPE` public identifier if this is a `DocumentType` node, `None` otherwise + #[serde(skip_serializing_if = "Option::is_none")] + public_id: Option, + + /// The `DOCTYPE` system identifier if this is a `DocumentType` node, `None` otherwise + #[serde(skip_serializing_if = "Option::is_none")] + system_id: Option, } pub struct NodeActor { @@ -276,6 +288,9 @@ impl NodeInfoToProtocol for NodeInfo { value: attr.value, }) .collect(), + name: self.doctype_name, + public_id: self.doctype_public_identifier, + system_id: self.doctype_system_identifier, } } } diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 1117eff6d3c..2caec47de25 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -1283,6 +1283,21 @@ impl Node { is_shadow_host, shadow_root_mode, display, + doctype_name: self + .downcast::() + .map(DocumentType::name) + .cloned() + .map(String::from), + doctype_public_identifier: self + .downcast::() + .map(DocumentType::public_id) + .cloned() + .map(String::from), + doctype_system_identifier: self + .downcast::() + .map(DocumentType::system_id) + .cloned() + .map(String::from), } } diff --git a/components/shared/devtools/lib.rs b/components/shared/devtools/lib.rs index 0cf99d22658..c07f4529073 100644 --- a/components/shared/devtools/lib.rs +++ b/components/shared/devtools/lib.rs @@ -144,6 +144,15 @@ pub struct NodeInfo { pub shadow_root_mode: Option, pub is_shadow_host: bool, pub display: Option, + + /// The `DOCTYPE` name if this is a `DocumentType` node, `None` otherwise + pub doctype_name: Option, + + /// The `DOCTYPE` public identifier if this is a `DocumentType` node , `None` otherwise + pub doctype_public_identifier: Option, + + /// The `DOCTYPE` system identifier if this is a `DocumentType` node, `None` otherwise + pub doctype_system_identifier: Option, } pub struct StartedTimelineMarker {