diff --git a/Libraries/LibWeb/DOM/Node.cpp b/Libraries/LibWeb/DOM/Node.cpp index 49ce0afe3c8..ea48d6622dd 100644 --- a/Libraries/LibWeb/DOM/Node.cpp +++ b/Libraries/LibWeb/DOM/Node.cpp @@ -1544,6 +1544,9 @@ void Node::serialize_tree_as_json(JsonObjectSerializer& object) c MUST(object.add("type"sv, "element")); auto const* element = static_cast(this); + if (element->namespace_uri().has_value()) + MUST(object.add("namespace"sv, element->namespace_uri().value())); + if (element->has_attributes()) { auto attributes = MUST(object.add_object("attributes"sv)); element->for_each_attribute([&attributes](auto& name, auto& value) { diff --git a/Libraries/LibWebView/InspectorClient.cpp b/Libraries/LibWebView/InspectorClient.cpp index 44c6f26a9f5..98c7ace4a3c 100644 --- a/Libraries/LibWebView/InspectorClient.cpp +++ b/Libraries/LibWebView/InspectorClient.cpp @@ -633,7 +633,9 @@ String InspectorClient::generate_dom_tree(JsonObject const& dom_tree) if (name.equals_ignoring_ascii_case("BODY"sv) || name.equals_ignoring_ascii_case("FRAMESET"sv)) m_body_or_frameset_node_id = node_id; - auto tag = name.to_lowercase(); + auto tag = name; + if (node.get_byte_string("namespace"sv) == "http://www.w3.org/1999/xhtml") + tag = tag.to_lowercase(); builder.appendff("", data_attributes.string_view()); builder.append("<"sv);