mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Send info about the DocumentType
node to the devtools inspector (#36787)
This makes the DOCTYPE tag show up correctly in the inspector. Before:  After:  Testing: We don't have devtools tests Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
be0f4470c7
commit
cfc7115867
3 changed files with 39 additions and 0 deletions
|
@ -78,6 +78,18 @@ pub struct NodeActorMsg {
|
|||
shadow_root_mode: Option<String>,
|
||||
traits: HashMap<String, ()>,
|
||||
attrs: Vec<AttrMsg>,
|
||||
|
||||
/// The `DOCTYPE` name if this is a `DocumentType` node, `None` otherwise
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
name: Option<String>,
|
||||
|
||||
/// The `DOCTYPE` public identifier if this is a `DocumentType` node, `None` otherwise
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
public_id: Option<String>,
|
||||
|
||||
/// The `DOCTYPE` system identifier if this is a `DocumentType` node, `None` otherwise
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
system_id: Option<String>,
|
||||
}
|
||||
|
||||
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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1283,6 +1283,21 @@ impl Node {
|
|||
is_shadow_host,
|
||||
shadow_root_mode,
|
||||
display,
|
||||
doctype_name: self
|
||||
.downcast::<DocumentType>()
|
||||
.map(DocumentType::name)
|
||||
.cloned()
|
||||
.map(String::from),
|
||||
doctype_public_identifier: self
|
||||
.downcast::<DocumentType>()
|
||||
.map(DocumentType::public_id)
|
||||
.cloned()
|
||||
.map(String::from),
|
||||
doctype_system_identifier: self
|
||||
.downcast::<DocumentType>()
|
||||
.map(DocumentType::system_id)
|
||||
.cloned()
|
||||
.map(String::from),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -144,6 +144,15 @@ pub struct NodeInfo {
|
|||
pub shadow_root_mode: Option<ShadowRootMode>,
|
||||
pub is_shadow_host: bool,
|
||||
pub display: Option<String>,
|
||||
|
||||
/// The `DOCTYPE` name if this is a `DocumentType` node, `None` otherwise
|
||||
pub doctype_name: Option<String>,
|
||||
|
||||
/// The `DOCTYPE` public identifier if this is a `DocumentType` node , `None` otherwise
|
||||
pub doctype_public_identifier: Option<String>,
|
||||
|
||||
/// The `DOCTYPE` system identifier if this is a `DocumentType` node, `None` otherwise
|
||||
pub doctype_system_identifier: Option<String>,
|
||||
}
|
||||
|
||||
pub struct StartedTimelineMarker {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue