mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibWeb: Switch to using AK::is and AK::downcast
This commit is contained in:
@@ -36,8 +36,8 @@ public:
|
||||
LayoutReplaced(Document&, const Element&, NonnullRefPtr<StyleProperties>);
|
||||
virtual ~LayoutReplaced() override;
|
||||
|
||||
const Element& node() const { return to<Element>(*LayoutNode::node()); }
|
||||
Element& node() { return to<Element>(*LayoutNode::node()); }
|
||||
const Element& node() const { return downcast<Element>(*LayoutNode::node()); }
|
||||
Element& node() { return downcast<Element>(*LayoutNode::node()); }
|
||||
|
||||
virtual bool is_replaced() const final { return true; }
|
||||
|
||||
@@ -75,10 +75,8 @@ private:
|
||||
float m_intrinsic_ratio { 0 };
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool is<LayoutReplaced>(const LayoutNode& node)
|
||||
{
|
||||
return node.is_replaced();
|
||||
}
|
||||
|
||||
}
|
||||
AK_BEGIN_TYPE_TRAITS(Web::LayoutReplaced)
|
||||
static bool is_type(const Web::LayoutNode& layout_node) { return layout_node.is_replaced(); }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
||||
Reference in New Issue
Block a user