From 3cb50a4714b6836a1d32e383edc86b3557d861ea Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 23 Jul 2020 18:18:13 +0200 Subject: [PATCH] LibWeb: Rename Element::tag_name() => local_name() To prepare for fully qualified tag names, let's call this local_name. Note that we still keep an Element::tag_name() around since that's what the JS bindings end up calling into for the Element.tagName property. --- Libraries/LibWeb/CSS/SelectorEngine.cpp | 2 +- Libraries/LibWeb/DOM/Document.cpp | 4 +- Libraries/LibWeb/DOM/Document.h | 2 +- Libraries/LibWeb/DOM/Element.cpp | 6 +- Libraries/LibWeb/DOM/Element.h | 7 +- Libraries/LibWeb/DOM/HTMLAnchorElement.h | 4 +- Libraries/LibWeb/DOM/HTMLBRElement.h | 4 +- Libraries/LibWeb/DOM/HTMLBlinkElement.h | 4 +- Libraries/LibWeb/DOM/HTMLBodyElement.h | 4 +- Libraries/LibWeb/DOM/HTMLCanvasElement.h | 4 +- Libraries/LibWeb/DOM/HTMLElement.h | 2 +- Libraries/LibWeb/DOM/HTMLFontElement.h | 4 +- Libraries/LibWeb/DOM/HTMLFormElement.h | 4 +- Libraries/LibWeb/DOM/HTMLHRElement.h | 4 +- Libraries/LibWeb/DOM/HTMLHeadElement.h | 4 +- Libraries/LibWeb/DOM/HTMLHeadingElement.h | 2 +- Libraries/LibWeb/DOM/HTMLHtmlElement.h | 4 +- Libraries/LibWeb/DOM/HTMLIFrameElement.h | 4 +- Libraries/LibWeb/DOM/HTMLImageElement.h | 4 +- Libraries/LibWeb/DOM/HTMLInputElement.h | 4 +- Libraries/LibWeb/DOM/HTMLLinkElement.h | 4 +- Libraries/LibWeb/DOM/HTMLObjectElement.h | 4 +- Libraries/LibWeb/DOM/HTMLScriptElement.h | 4 +- Libraries/LibWeb/DOM/HTMLStyleElement.h | 4 +- Libraries/LibWeb/DOM/HTMLTableCellElement.h | 4 +- Libraries/LibWeb/DOM/HTMLTableElement.h | 4 +- Libraries/LibWeb/DOM/HTMLTableRowElement.h | 4 +- Libraries/LibWeb/DOM/HTMLTitleElement.h | 4 +- Libraries/LibWeb/DOMTreeModel.cpp | 2 +- Libraries/LibWeb/Dump.cpp | 4 +- Libraries/LibWeb/LayoutTreeModel.cpp | 2 +- .../LibWeb/Parser/HTMLDocumentParser.cpp | 144 +++++++++--------- .../Parser/ListOfActiveFormattingElements.cpp | 2 +- .../LibWeb/Parser/StackOfOpenElements.cpp | 14 +- 34 files changed, 140 insertions(+), 137 deletions(-) diff --git a/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Libraries/LibWeb/CSS/SelectorEngine.cpp index 654fe6ac95..b080c37edc 100644 --- a/Libraries/LibWeb/CSS/SelectorEngine.cpp +++ b/Libraries/LibWeb/CSS/SelectorEngine.cpp @@ -110,7 +110,7 @@ bool matches(const Selector::SimpleSelector& component, const Element& element) case Selector::SimpleSelector::Type::Class: return element.has_class(component.value); case Selector::SimpleSelector::Type::TagName: - return component.value == element.tag_name(); + return component.value == element.local_name(); default: ASSERT_NOT_REACHED(); } diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index feda9d7312..fe0e47ce17 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -334,11 +334,11 @@ Vector Document::get_elements_by_name(const String& name) const return elements; } -NonnullRefPtrVector Document::get_elements_by_tag_name(const String& tag_name) const +NonnullRefPtrVector Document::get_elements_by_tag_name(const FlyString& tag_name) const { NonnullRefPtrVector elements; for_each_in_subtree_of_type([&](auto& element) { - if (element.tag_name() == tag_name) + if (element.local_name() == tag_name) elements.append(element); return IterationDecision::Continue; }); diff --git a/Libraries/LibWeb/DOM/Document.h b/Libraries/LibWeb/DOM/Document.h index a6a2e1d761..ce198415f5 100644 --- a/Libraries/LibWeb/DOM/Document.h +++ b/Libraries/LibWeb/DOM/Document.h @@ -124,7 +124,7 @@ public: void schedule_style_update(); Vector get_elements_by_name(const String&) const; - NonnullRefPtrVector get_elements_by_tag_name(const String&) const; + NonnullRefPtrVector get_elements_by_tag_name(const FlyString&) const; RefPtr query_selector(const StringView&); NonnullRefPtrVector query_selector_all(const StringView&); diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index 27e00d63d1..21dc1b0d7b 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -116,7 +116,7 @@ RefPtr Element::create_layout_node(const StyleProperties* parent_sty if (display == CSS::Display::None) return nullptr; - if (tag_name() == "noscript" && document().is_scripting_enabled()) + if (local_name() == "noscript" && document().is_scripting_enabled()) return nullptr; if (display == CSS::Display::Block) @@ -271,13 +271,13 @@ String Element::inner_html() const for (auto* child = node.first_child(); child; child = child->next_sibling()) { if (child->is_element()) { builder.append('<'); - builder.append(to(*child).tag_name()); + builder.append(to(*child).local_name()); builder.append('>'); recurse(*child); builder.append("(*child).tag_name()); + builder.append(to(*child).local_name()); builder.append('>'); } if (child->is_text()) { diff --git a/Libraries/LibWeb/DOM/Element.h b/Libraries/LibWeb/DOM/Element.h index 1b6ea79f36..b99edfd74e 100644 --- a/Libraries/LibWeb/DOM/Element.h +++ b/Libraries/LibWeb/DOM/Element.h @@ -42,11 +42,14 @@ class Element : public ParentNode { public: using WrapperType = Bindings::ElementWrapper; - Element(Document&, const FlyString& tag_name); + Element(Document&, const FlyString& local_name); virtual ~Element() override; virtual FlyString node_name() const final { return m_tag_name; } - const FlyString& tag_name() const { return m_tag_name; } + const FlyString& local_name() const { return m_tag_name; } + + // NOTE: This is for the JS bindings + const FlyString& tag_name() const { return local_name(); } bool has_attribute(const FlyString& name) const { return !attribute(name).is_null(); } String attribute(const FlyString& name) const; diff --git a/Libraries/LibWeb/DOM/HTMLAnchorElement.h b/Libraries/LibWeb/DOM/HTMLAnchorElement.h index d52557b8c3..c7179b8087 100644 --- a/Libraries/LibWeb/DOM/HTMLAnchorElement.h +++ b/Libraries/LibWeb/DOM/HTMLAnchorElement.h @@ -32,7 +32,7 @@ namespace Web { class HTMLAnchorElement : public HTMLElement { public: - HTMLAnchorElement(Document&, const FlyString& tag_name); + HTMLAnchorElement(Document&, const FlyString& local_name); virtual ~HTMLAnchorElement() override; String href() const { return attribute(HTML::AttributeNames::href); } @@ -42,7 +42,7 @@ public: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::a; + return is(node) && to(node).local_name() == HTML::TagNames::a; } } diff --git a/Libraries/LibWeb/DOM/HTMLBRElement.h b/Libraries/LibWeb/DOM/HTMLBRElement.h index 04009f68b7..1c86024df4 100644 --- a/Libraries/LibWeb/DOM/HTMLBRElement.h +++ b/Libraries/LibWeb/DOM/HTMLBRElement.h @@ -32,7 +32,7 @@ namespace Web { class HTMLBRElement final : public HTMLElement { public: - HTMLBRElement(Document&, const FlyString& tag_name); + HTMLBRElement(Document&, const FlyString& local_name); virtual ~HTMLBRElement() override; virtual RefPtr create_layout_node(const StyleProperties* parent_style) override; @@ -41,7 +41,7 @@ public: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::br; + return is(node) && to(node).local_name() == HTML::TagNames::br; } } diff --git a/Libraries/LibWeb/DOM/HTMLBlinkElement.h b/Libraries/LibWeb/DOM/HTMLBlinkElement.h index d9ff921fa4..6696f2cae3 100644 --- a/Libraries/LibWeb/DOM/HTMLBlinkElement.h +++ b/Libraries/LibWeb/DOM/HTMLBlinkElement.h @@ -33,7 +33,7 @@ namespace Web { class HTMLBlinkElement : public HTMLElement { public: - HTMLBlinkElement(Document&, const FlyString& tag_name); + HTMLBlinkElement(Document&, const FlyString& local_name); virtual ~HTMLBlinkElement() override; private: @@ -45,7 +45,7 @@ private: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::blink; + return is(node) && to(node).local_name() == HTML::TagNames::blink; } } diff --git a/Libraries/LibWeb/DOM/HTMLBodyElement.h b/Libraries/LibWeb/DOM/HTMLBodyElement.h index 75a80743dc..bc0688d89e 100644 --- a/Libraries/LibWeb/DOM/HTMLBodyElement.h +++ b/Libraries/LibWeb/DOM/HTMLBodyElement.h @@ -32,7 +32,7 @@ namespace Web { class HTMLBodyElement : public HTMLElement { public: - HTMLBodyElement(Document&, const FlyString& tag_name); + HTMLBodyElement(Document&, const FlyString& local_name); virtual ~HTMLBodyElement() override; virtual void parse_attribute(const FlyString&, const String&) override; @@ -45,7 +45,7 @@ private: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::body; + return is(node) && to(node).local_name() == HTML::TagNames::body; } } diff --git a/Libraries/LibWeb/DOM/HTMLCanvasElement.h b/Libraries/LibWeb/DOM/HTMLCanvasElement.h index 41722ec184..dd9e3f41ec 100644 --- a/Libraries/LibWeb/DOM/HTMLCanvasElement.h +++ b/Libraries/LibWeb/DOM/HTMLCanvasElement.h @@ -38,7 +38,7 @@ class HTMLCanvasElement : public HTMLElement { public: using WrapperType = Bindings::HTMLCanvasElementWrapper; - HTMLCanvasElement(Document&, const FlyString& tag_name); + HTMLCanvasElement(Document&, const FlyString& local_name); virtual ~HTMLCanvasElement() override; const Gfx::Bitmap* bitmap() const { return m_bitmap; } @@ -60,7 +60,7 @@ private: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::canvas; + return is(node) && to(node).local_name() == HTML::TagNames::canvas; } } diff --git a/Libraries/LibWeb/DOM/HTMLElement.h b/Libraries/LibWeb/DOM/HTMLElement.h index f3b42191c9..054f7c613e 100644 --- a/Libraries/LibWeb/DOM/HTMLElement.h +++ b/Libraries/LibWeb/DOM/HTMLElement.h @@ -34,7 +34,7 @@ class HTMLElement : public Element { public: using WrapperType = Bindings::HTMLElementWrapper; - HTMLElement(Document&, const FlyString& tag_name); + HTMLElement(Document&, const FlyString& local_name); virtual ~HTMLElement() override; String title() const { return attribute(HTML::AttributeNames::title); } diff --git a/Libraries/LibWeb/DOM/HTMLFontElement.h b/Libraries/LibWeb/DOM/HTMLFontElement.h index 4f9484d370..15da127d47 100644 --- a/Libraries/LibWeb/DOM/HTMLFontElement.h +++ b/Libraries/LibWeb/DOM/HTMLFontElement.h @@ -32,7 +32,7 @@ namespace Web { class HTMLFontElement : public HTMLElement { public: - HTMLFontElement(Document&, const FlyString& tag_name); + HTMLFontElement(Document&, const FlyString& local_name); virtual ~HTMLFontElement() override; virtual void apply_presentational_hints(StyleProperties&) const override; @@ -41,7 +41,7 @@ public: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::font; + return is(node) && to(node).local_name() == HTML::TagNames::font; } } diff --git a/Libraries/LibWeb/DOM/HTMLFormElement.h b/Libraries/LibWeb/DOM/HTMLFormElement.h index db0297e1f2..5986653ea6 100644 --- a/Libraries/LibWeb/DOM/HTMLFormElement.h +++ b/Libraries/LibWeb/DOM/HTMLFormElement.h @@ -33,7 +33,7 @@ namespace Web { class HTMLFormElement : public HTMLElement { public: - HTMLFormElement(Document&, const FlyString& tag_name); + HTMLFormElement(Document&, const FlyString& local_name); virtual ~HTMLFormElement() override; String action() const { return attribute(HTML::AttributeNames::action); } @@ -45,7 +45,7 @@ public: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::form; + return is(node) && to(node).local_name() == HTML::TagNames::form; } } diff --git a/Libraries/LibWeb/DOM/HTMLHRElement.h b/Libraries/LibWeb/DOM/HTMLHRElement.h index 31c23deae4..3e8f84e71a 100644 --- a/Libraries/LibWeb/DOM/HTMLHRElement.h +++ b/Libraries/LibWeb/DOM/HTMLHRElement.h @@ -32,14 +32,14 @@ namespace Web { class HTMLHRElement : public HTMLElement { public: - HTMLHRElement(Document&, const FlyString& tag_name); + HTMLHRElement(Document&, const FlyString& local_name); virtual ~HTMLHRElement() override; }; template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::hr; + return is(node) && to(node).local_name() == HTML::TagNames::hr; } } diff --git a/Libraries/LibWeb/DOM/HTMLHeadElement.h b/Libraries/LibWeb/DOM/HTMLHeadElement.h index f20f5ef414..fb4661605e 100644 --- a/Libraries/LibWeb/DOM/HTMLHeadElement.h +++ b/Libraries/LibWeb/DOM/HTMLHeadElement.h @@ -32,14 +32,14 @@ namespace Web { class HTMLHeadElement : public HTMLElement { public: - HTMLHeadElement(Document&, const FlyString& tag_name); + HTMLHeadElement(Document&, const FlyString& local_name); virtual ~HTMLHeadElement() override; }; template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name().equals_ignoring_case("head"); + return is(node) && to(node).local_name().equals_ignoring_case("head"); } } diff --git a/Libraries/LibWeb/DOM/HTMLHeadingElement.h b/Libraries/LibWeb/DOM/HTMLHeadingElement.h index 06e2e4af58..d2372c14c2 100644 --- a/Libraries/LibWeb/DOM/HTMLHeadingElement.h +++ b/Libraries/LibWeb/DOM/HTMLHeadingElement.h @@ -32,7 +32,7 @@ namespace Web { class HTMLHeadingElement : public HTMLElement { public: - HTMLHeadingElement(Document&, const FlyString& tag_name); + HTMLHeadingElement(Document&, const FlyString& local_name); virtual ~HTMLHeadingElement() override; }; diff --git a/Libraries/LibWeb/DOM/HTMLHtmlElement.h b/Libraries/LibWeb/DOM/HTMLHtmlElement.h index 814b869f7a..c57815c4cc 100644 --- a/Libraries/LibWeb/DOM/HTMLHtmlElement.h +++ b/Libraries/LibWeb/DOM/HTMLHtmlElement.h @@ -32,14 +32,14 @@ namespace Web { class HTMLHtmlElement : public HTMLElement { public: - HTMLHtmlElement(Document&, const FlyString& tag_name); + HTMLHtmlElement(Document&, const FlyString& local_name); virtual ~HTMLHtmlElement() override; }; template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name().equals_ignoring_case("html"); + return is(node) && to(node).local_name().equals_ignoring_case("html"); } } diff --git a/Libraries/LibWeb/DOM/HTMLIFrameElement.h b/Libraries/LibWeb/DOM/HTMLIFrameElement.h index acfd870324..1fe26cc090 100644 --- a/Libraries/LibWeb/DOM/HTMLIFrameElement.h +++ b/Libraries/LibWeb/DOM/HTMLIFrameElement.h @@ -32,7 +32,7 @@ namespace Web { class HTMLIFrameElement final : public HTMLElement { public: - HTMLIFrameElement(Document&, const FlyString& tag_name); + HTMLIFrameElement(Document&, const FlyString& local_name); virtual ~HTMLIFrameElement() override; virtual RefPtr create_layout_node(const StyleProperties* parent_style) override; @@ -54,7 +54,7 @@ private: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::iframe; + return is(node) && to(node).local_name() == HTML::TagNames::iframe; } } diff --git a/Libraries/LibWeb/DOM/HTMLImageElement.h b/Libraries/LibWeb/DOM/HTMLImageElement.h index fff36b0359..a7e0d40e68 100644 --- a/Libraries/LibWeb/DOM/HTMLImageElement.h +++ b/Libraries/LibWeb/DOM/HTMLImageElement.h @@ -40,7 +40,7 @@ class HTMLImageElement final : public HTMLElement { public: using WrapperType = Bindings::HTMLImageElementWrapper; - HTMLImageElement(Document&, const FlyString& tag_name); + HTMLImageElement(Document&, const FlyString& local_name); virtual ~HTMLImageElement() override; virtual void parse_attribute(const FlyString& name, const String& value) override; @@ -63,7 +63,7 @@ private: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::img; + return is(node) && to(node).local_name() == HTML::TagNames::img; } } diff --git a/Libraries/LibWeb/DOM/HTMLInputElement.h b/Libraries/LibWeb/DOM/HTMLInputElement.h index 4a087391b0..a894efa321 100644 --- a/Libraries/LibWeb/DOM/HTMLInputElement.h +++ b/Libraries/LibWeb/DOM/HTMLInputElement.h @@ -32,7 +32,7 @@ namespace Web { class HTMLInputElement : public HTMLElement { public: - HTMLInputElement(Document&, const FlyString& tag_name); + HTMLInputElement(Document&, const FlyString& local_name); virtual ~HTMLInputElement() override; virtual RefPtr create_layout_node(const StyleProperties* parent_style) override; @@ -45,7 +45,7 @@ public: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::input; + return is(node) && to(node).local_name() == HTML::TagNames::input; } } diff --git a/Libraries/LibWeb/DOM/HTMLLinkElement.h b/Libraries/LibWeb/DOM/HTMLLinkElement.h index 07eb119a7b..d6beb03fad 100644 --- a/Libraries/LibWeb/DOM/HTMLLinkElement.h +++ b/Libraries/LibWeb/DOM/HTMLLinkElement.h @@ -35,7 +35,7 @@ class HTMLLinkElement final : public HTMLElement , public ResourceClient { public: - HTMLLinkElement(Document&, const FlyString& tag_name); + HTMLLinkElement(Document&, const FlyString& local_name); virtual ~HTMLLinkElement() override; virtual void inserted_into(Node&) override; @@ -67,7 +67,7 @@ private: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::link; + return is(node) && to(node).local_name() == HTML::TagNames::link; } } diff --git a/Libraries/LibWeb/DOM/HTMLObjectElement.h b/Libraries/LibWeb/DOM/HTMLObjectElement.h index 337cb99074..d8caab1b38 100644 --- a/Libraries/LibWeb/DOM/HTMLObjectElement.h +++ b/Libraries/LibWeb/DOM/HTMLObjectElement.h @@ -37,7 +37,7 @@ class LayoutDocument; class HTMLObjectElement final : public HTMLElement { public: - HTMLObjectElement(Document&, const FlyString& tag_name); + HTMLObjectElement(Document&, const FlyString& local_name); virtual ~HTMLObjectElement() override; virtual void parse_attribute(const FlyString& name, const String& value) override; @@ -55,7 +55,7 @@ private: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::object; + return is(node) && to(node).local_name() == HTML::TagNames::object; } } diff --git a/Libraries/LibWeb/DOM/HTMLScriptElement.h b/Libraries/LibWeb/DOM/HTMLScriptElement.h index 9d89ecd812..b9fbb57d92 100644 --- a/Libraries/LibWeb/DOM/HTMLScriptElement.h +++ b/Libraries/LibWeb/DOM/HTMLScriptElement.h @@ -33,7 +33,7 @@ namespace Web { class HTMLScriptElement : public HTMLElement { public: - HTMLScriptElement(Document&, const FlyString& tag_name); + HTMLScriptElement(Document&, const FlyString& local_name); virtual ~HTMLScriptElement() override; bool is_non_blocking() const { return m_non_blocking; } @@ -68,7 +68,7 @@ private: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::script; + return is(node) && to(node).local_name() == HTML::TagNames::script; } } diff --git a/Libraries/LibWeb/DOM/HTMLStyleElement.h b/Libraries/LibWeb/DOM/HTMLStyleElement.h index f4d6f30c73..efe6c89ecb 100644 --- a/Libraries/LibWeb/DOM/HTMLStyleElement.h +++ b/Libraries/LibWeb/DOM/HTMLStyleElement.h @@ -34,7 +34,7 @@ class StyleSheet; class HTMLStyleElement : public HTMLElement { public: - HTMLStyleElement(Document&, const FlyString& tag_name); + HTMLStyleElement(Document&, const FlyString& local_name); virtual ~HTMLStyleElement() override; virtual void children_changed() override; @@ -47,7 +47,7 @@ private: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::style; + return is(node) && to(node).local_name() == HTML::TagNames::style; } diff --git a/Libraries/LibWeb/DOM/HTMLTableCellElement.h b/Libraries/LibWeb/DOM/HTMLTableCellElement.h index 15de7c51b0..8d1f2d90f6 100644 --- a/Libraries/LibWeb/DOM/HTMLTableCellElement.h +++ b/Libraries/LibWeb/DOM/HTMLTableCellElement.h @@ -32,7 +32,7 @@ namespace Web { class HTMLTableCellElement final : public HTMLElement { public: - HTMLTableCellElement(Document&, const FlyString& tag_name); + HTMLTableCellElement(Document&, const FlyString& local_name); virtual ~HTMLTableCellElement() override; private: @@ -42,7 +42,7 @@ private: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name().is_one_of(HTML::TagNames::td, HTML::TagNames::th); + return is(node) && to(node).local_name().is_one_of(HTML::TagNames::td, HTML::TagNames::th); } } diff --git a/Libraries/LibWeb/DOM/HTMLTableElement.h b/Libraries/LibWeb/DOM/HTMLTableElement.h index a6b8689a85..777a6f96f5 100644 --- a/Libraries/LibWeb/DOM/HTMLTableElement.h +++ b/Libraries/LibWeb/DOM/HTMLTableElement.h @@ -32,7 +32,7 @@ namespace Web { class HTMLTableElement final : public HTMLElement { public: - HTMLTableElement(Document&, const FlyString& tag_name); + HTMLTableElement(Document&, const FlyString& local_name); virtual ~HTMLTableElement() override; private: @@ -42,7 +42,7 @@ private: template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::table; + return is(node) && to(node).local_name() == HTML::TagNames::table; } } diff --git a/Libraries/LibWeb/DOM/HTMLTableRowElement.h b/Libraries/LibWeb/DOM/HTMLTableRowElement.h index 6e48579914..3940e1b02d 100644 --- a/Libraries/LibWeb/DOM/HTMLTableRowElement.h +++ b/Libraries/LibWeb/DOM/HTMLTableRowElement.h @@ -32,14 +32,14 @@ namespace Web { class HTMLTableRowElement : public HTMLElement { public: - HTMLTableRowElement(Document&, const FlyString& tag_name); + HTMLTableRowElement(Document&, const FlyString& local_name); virtual ~HTMLTableRowElement() override; }; template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name() == HTML::TagNames::tr; + return is(node) && to(node).local_name() == HTML::TagNames::tr; } } diff --git a/Libraries/LibWeb/DOM/HTMLTitleElement.h b/Libraries/LibWeb/DOM/HTMLTitleElement.h index d769f26b65..b162d24341 100644 --- a/Libraries/LibWeb/DOM/HTMLTitleElement.h +++ b/Libraries/LibWeb/DOM/HTMLTitleElement.h @@ -32,14 +32,14 @@ namespace Web { class HTMLTitleElement : public HTMLElement { public: - HTMLTitleElement(Document&, const FlyString& tag_name); + HTMLTitleElement(Document&, const FlyString& local_name); virtual ~HTMLTitleElement() override; }; template<> inline bool is(const Node& node) { - return is(node) && to(node).tag_name().equals_ignoring_case("title"); + return is(node) && to(node).local_name().equals_ignoring_case("title"); } } diff --git a/Libraries/LibWeb/DOMTreeModel.cpp b/Libraries/LibWeb/DOMTreeModel.cpp index 1b7030d4fc..c87f48f7c8 100644 --- a/Libraries/LibWeb/DOMTreeModel.cpp +++ b/Libraries/LibWeb/DOMTreeModel.cpp @@ -134,7 +134,7 @@ GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, Role role) const auto& element = to(node); StringBuilder builder; builder.append('<'); - builder.append(element.tag_name()); + builder.append(element.local_name()); element.for_each_attribute([&](auto& name, auto& value) { builder.append(' '); builder.append(name); diff --git a/Libraries/LibWeb/Dump.cpp b/Libraries/LibWeb/Dump.cpp index ce10f2a68b..1225027e50 100644 --- a/Libraries/LibWeb/Dump.cpp +++ b/Libraries/LibWeb/Dump.cpp @@ -51,7 +51,7 @@ void dump_tree(const Node& node) if (is(node)) { dbgprintf("*Document*\n"); } else if (is(node)) { - dbgprintf("<%s", to(node).tag_name().characters()); + dbgprintf("<%s", to(node).local_name().characters()); to(node).for_each_attribute([](auto& name, auto& value) { dbgprintf(" %s=%s", name.characters(), value.characters()); }); @@ -88,7 +88,7 @@ void dump_tree(const LayoutNode& layout_node) else if (is(layout_node.node())) tag_name = "#document"; else if (is(layout_node.node())) - tag_name = to(*layout_node.node()).tag_name(); + tag_name = to(*layout_node.node()).local_name(); else tag_name = "???"; diff --git a/Libraries/LibWeb/LayoutTreeModel.cpp b/Libraries/LibWeb/LayoutTreeModel.cpp index 87dcfb4c30..6a3444d225 100644 --- a/Libraries/LibWeb/LayoutTreeModel.cpp +++ b/Libraries/LibWeb/LayoutTreeModel.cpp @@ -138,7 +138,7 @@ GUI::Variant LayoutTreeModel::data(const GUI::ModelIndex& index, Role role) cons } else { auto& element = to(*node.node()); builder.append('<'); - builder.append(element.tag_name()); + builder.append(element.local_name()); element.for_each_attribute([&](auto& name, auto& value) { builder.append(' '); builder.append(name); diff --git a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp index 9099f4e7d6..83df56146b 100644 --- a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp +++ b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp @@ -379,7 +379,7 @@ Element& HTMLDocumentParser::node_before_current_node() HTMLDocumentParser::AdjustedInsertionLocation HTMLDocumentParser::find_appropriate_place_for_inserting_node() { auto& target = current_node(); - if (m_foster_parenting && target.tag_name().is_one_of(HTML::TagNames::table, HTML::TagNames::tbody, HTML::TagNames::tfoot, HTML::TagNames::thead, HTML::TagNames::tr)) { + if (m_foster_parenting && target.local_name().is_one_of(HTML::TagNames::table, HTML::TagNames::tbody, HTML::TagNames::tfoot, HTML::TagNames::thead, HTML::TagNames::tr)) { // FIXME: There's a bunch of steps for