diff options
author | Simon Wülker <simon.wuelker@arcor.de> | 2025-05-01 08:37:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-01 06:37:23 +0000 |
commit | cfc7115867f123d8905ff80612954b100e03ed72 (patch) | |
tree | 783f019fc008fcfcf73a02222ed4ca56fdacd9f8 /components/script | |
parent | be0f4470c7c759003110b1c93c57cb796f4be3dc (diff) | |
download | servo-cfc7115867f123d8905ff80612954b100e03ed72.tar.gz servo-cfc7115867f123d8905ff80612954b100e03ed72.zip |
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>
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/node.rs | 15 |
1 files changed, 15 insertions, 0 deletions
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::<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), } } |