瀏覽代碼

LibWeb: Make HTMLPreElement's is_type match "listing" and "xmp"

I forgot to add these when I saw that listing and xmp are mapped to
HTMLPreElement.
Luke 4 年之前
父節點
當前提交
7b755e6a58
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Libraries/LibWeb/HTML/HTMLPreElement.h

+ 1 - 1
Libraries/LibWeb/HTML/HTMLPreElement.h

@@ -41,5 +41,5 @@ public:
 }
 
 AK_BEGIN_TYPE_TRAITS(Web::HTML::HTMLPreElement)
-static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTML::HTMLElement>(node).local_name() == Web::HTML::TagNames::pre; }
+static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTML::HTMLElement>(node).local_name().is_one_of(Web::HTML::TagNames::pre, Web::HTML::TagNames::listing, Web::HTML::TagNames::xmp); }
 AK_END_TYPE_TRAITS()