Skip to content

Commit

Permalink
LibWebView: Avoid replication of the HTML namespace string
Browse files Browse the repository at this point in the history
Now that we can use these string constants, let's avoid the replication.
  • Loading branch information
trflynn89 authored and gmta committed Jan 11, 2025
1 parent a4324ee commit d5e3a55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Libraries/LibWebView/InspectorClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <LibCore/Resource.h>
#include <LibJS/MarkupGenerator.h>
#include <LibWeb/Infra/Strings.h>
#include <LibWeb/Namespace.h>
#include <LibWebView/Application.h>
#include <LibWebView/CookieJar.h>
#include <LibWebView/InspectorClient.h>
Expand Down Expand Up @@ -634,7 +635,7 @@ String InspectorClient::generate_dom_tree(JsonObject const& dom_tree)
m_body_or_frameset_node_id = node_id;

auto tag = name;
if (node.get_byte_string("namespace"sv) == "http://www.w3.org/1999/xhtml")
if (node.get_byte_string("namespace"sv) == Web::Namespace::HTML.bytes_as_string_view())
tag = tag.to_lowercase();

builder.appendff("<span class=\"hoverable\" {}>", data_attributes.string_view());
Expand Down

0 comments on commit d5e3a55

Please sign in to comment.