mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibWeb: Add more fast_is<T> helpers for layout and paintable nodes
This commit is contained in:
parent
0f2dd7039c
commit
9a4a76ac5c
4 changed files with 20 additions and 0 deletions
|
@ -101,6 +101,7 @@ public:
|
|||
virtual bool is_svg_geometry_box() const { return false; }
|
||||
virtual bool is_svg_mask_box() const { return false; }
|
||||
virtual bool is_svg_svg_box() const { return false; }
|
||||
virtual bool is_svg_graphics_box() const { return false; }
|
||||
virtual bool is_label() const { return false; }
|
||||
virtual bool is_replaced_box() const { return false; }
|
||||
virtual bool is_list_item_box() const { return false; }
|
||||
|
@ -108,6 +109,7 @@ public:
|
|||
virtual bool is_fieldset_box() const { return false; }
|
||||
virtual bool is_legend_box() const { return false; }
|
||||
virtual bool is_table_wrapper() const { return false; }
|
||||
virtual bool is_node_with_style() const { return false; }
|
||||
virtual bool is_node_with_style_and_box_model_metrics() const { return false; }
|
||||
|
||||
template<typename T>
|
||||
|
@ -245,6 +247,8 @@ protected:
|
|||
NodeWithStyle(DOM::Document&, DOM::Node*, NonnullOwnPtr<CSS::ComputedValues>);
|
||||
|
||||
private:
|
||||
virtual bool is_node_with_style() const final { return true; }
|
||||
|
||||
void reset_table_box_computed_values_used_by_wrapper_to_init_values();
|
||||
void propagate_style_to_anonymous_wrappers();
|
||||
|
||||
|
@ -252,6 +256,9 @@ private:
|
|||
RefPtr<CSS::AbstractImageStyleValue const> m_list_style_image;
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool Node::fast_is<NodeWithStyle>() const { return is_node_with_style(); }
|
||||
|
||||
class NodeWithStyleAndBoxModelMetrics : public NodeWithStyle {
|
||||
GC_CELL(NodeWithStyleAndBoxModelMetrics, NodeWithStyle);
|
||||
|
||||
|
|
|
@ -23,6 +23,12 @@ public:
|
|||
SVG::SVGGraphicsElement const& dom_node() const { return as<SVG::SVGGraphicsElement>(SVGBox::dom_node()); }
|
||||
|
||||
virtual GC::Ptr<Painting::Paintable> create_paintable() const override;
|
||||
|
||||
private:
|
||||
virtual bool is_svg_graphics_box() const override { return true; }
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool Node::fast_is<SVGGraphicsBox>() const { return is_svg_graphics_box(); }
|
||||
|
||||
}
|
||||
|
|
|
@ -125,6 +125,7 @@ public:
|
|||
[[nodiscard]] virtual bool is_paintable_box() const { return false; }
|
||||
[[nodiscard]] virtual bool is_paintable_with_lines() const { return false; }
|
||||
[[nodiscard]] virtual bool is_svg_paintable() const { return false; }
|
||||
[[nodiscard]] virtual bool is_svg_svg_paintable() const { return false; }
|
||||
[[nodiscard]] virtual bool is_text_paintable() const { return false; }
|
||||
|
||||
DOM::Document const& document() const;
|
||||
|
|
|
@ -28,6 +28,12 @@ public:
|
|||
|
||||
protected:
|
||||
SVGSVGPaintable(Layout::SVGSVGBox const&);
|
||||
|
||||
private:
|
||||
virtual bool is_svg_svg_paintable() const final { return true; }
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool Paintable::fast_is<SVGSVGPaintable>() const { return is_svg_svg_paintable(); }
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue