Преглед изворни кода

LibHTML: Add Element::name() convenience attribute getter

Andreas Kling пре 5 година
родитељ
комит
202dfbd6cd
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      Libraries/LibHTML/DOM/Element.h

+ 2 - 0
Libraries/LibHTML/DOM/Element.h

@@ -54,6 +54,8 @@ public:
     LayoutNodeWithStyle* layout_node() { return static_cast<LayoutNodeWithStyle*>(Node::layout_node()); }
     LayoutNodeWithStyle* layout_node() { return static_cast<LayoutNodeWithStyle*>(Node::layout_node()); }
     const LayoutNodeWithStyle* layout_node() const { return static_cast<const LayoutNodeWithStyle*>(Node::layout_node()); }
     const LayoutNodeWithStyle* layout_node() const { return static_cast<const LayoutNodeWithStyle*>(Node::layout_node()); }
 
 
+    String name() const { return attribute("name"); }
+
 private:
 private:
     RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) const override;
     RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) const override;