1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

LibWeb: Show DOM comment contents in DOM inspector

This commit is contained in:
Andreas Kling 2021-11-02 19:25:15 +01:00
parent 5db51d85a3
commit 5088846606
2 changed files with 5 additions and 0 deletions

View file

@ -129,6 +129,8 @@ GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
if (role == GUI::ModelRole::Display) {
if (type == "text")
return with_whitespace_collapsed(node.get("text").as_string());
if (type == "comment"sv)
return String::formatted("<!--{}-->", node.get("data"sv).as_string());
if (type != "element")
return node_name;