Browse Source

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 years ago
parent
commit
ca28a118ae
1 changed files with 3 additions and 0 deletions
  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();
     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:
 private:
     RefPtr<ListItemMarkerBox> m_marker;
     RefPtr<ListItemMarkerBox> m_marker;
 };
 };