소스 검색

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()); }
     const LayoutNodeWithStyle* layout_node() const { return static_cast<const LayoutNodeWithStyle*>(Node::layout_node()); }
 
+    String name() const { return attribute("name"); }
+
 private:
     RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) const override;