LibWeb: Add fast_is<TextPaintable>()

This commit is contained in:
Andreas Kling 2024-03-18 10:25:07 +01:00
parent 1987318cc2
commit 2be47c3d7a
Notes: sideshowbarker 2024-07-17 07:43:05 +09:00
2 changed files with 6 additions and 0 deletions

View File

@ -200,6 +200,7 @@ public:
[[nodiscard]] virtual bool is_paintable_with_lines() const { return false; }
[[nodiscard]] virtual bool is_inline_paintable() const { return false; }
[[nodiscard]] virtual bool is_svg_paintable() const { return false; }
[[nodiscard]] virtual bool is_text_paintable() const { return false; }
DOM::Document const& document() const { return layout_node().document(); }
DOM::Document& document() { return layout_node().document(); }
@ -256,4 +257,7 @@ inline bool Paintable::fast_is<PaintableBox>() const { return is_paintable_box()
template<>
inline bool Paintable::fast_is<PaintableWithLines>() const { return is_paintable_with_lines(); }
template<>
inline bool Paintable::fast_is<TextPaintable>() const { return is_text_paintable(); }
}

View File

@ -28,6 +28,8 @@ public:
CSSPixels text_decoration_thickness() const { return m_text_decoration_thickness; }
private:
virtual bool is_text_paintable() const override { return true; }
explicit TextPaintable(Layout::TextNode const&);
CSSPixels m_text_decoration_thickness { 0 };