瀏覽代碼

LibWeb: Add tightly-typed DOM node accessors for Layout::ListItemBox

ListItemBox is always constructed with a non-null DOM::Element, so we
can make dom_node() return a DOM::Element&.
Andreas Kling 3 年之前
父節點
當前提交
ca28a118ae
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Userland/Libraries/LibWeb/Layout/ListItemBox.h

+ 3 - 0
Userland/Libraries/LibWeb/Layout/ListItemBox.h

@@ -20,6 +20,9 @@ public:
 
     void layout_marker();
 
+    DOM::Element& dom_node() { return static_cast<DOM::Element&>(*BlockBox::dom_node()); }
+    DOM::Element const& dom_node() const { return static_cast<DOM::Element const&>(*BlockBox::dom_node()); }
+
 private:
     RefPtr<ListItemMarkerBox> m_marker;
 };