Skip to content

Commit

Permalink
LibWebView: Fix capitalization in devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
Psychpsyo committed Jan 11, 2025
1 parent 3261f87 commit 7fe225a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Libraries/LibWeb/DOM/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,9 @@ void Node::serialize_tree_as_json(JsonObjectSerializer<StringBuilder>& object) c
MUST(object.add("type"sv, "element"));

auto const* element = static_cast<DOM::Element const*>(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) {
Expand Down
4 changes: 3 additions & 1 deletion Libraries/LibWebView/InspectorClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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("<span class=\"hoverable\" {}>", data_attributes.string_view());
builder.append("<span>&lt;</span>"sv);
Expand Down

0 comments on commit 7fe225a

Please sign in to comment.