mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 04:22:28 +00:00
LibWeb: Add fast_is<TextPaintable>()
This commit is contained in:
parent
1987318cc2
commit
2be47c3d7a
Notes:
sideshowbarker
2024-07-17 07:43:05 +09:00
Author: https://github.com/awesomekling
Commit: 2be47c3d7a
Pull-request: https://github.com/SerenityOS/serenity/pull/23626
2 changed files with 6 additions and 0 deletions
|
@ -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(); }
|
||||
|
||||
}
|
||||
|
|
|
@ -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 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue