mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibWeb: Specialize is<DOM::Element>() and is<Layout::Box>()
These two show up in profiles, so let's add specializations for them.
This commit is contained in:
parent
d3046a2649
commit
0fd577084f
Notes:
sideshowbarker
2024-07-19 00:03:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0fd577084ff
3 changed files with 22 additions and 0 deletions
|
@ -116,3 +116,12 @@ private:
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
namespace AK {
|
||||
template<>
|
||||
inline bool is<Web::DOM::Element>(const Web::DOM::Node& input)
|
||||
{
|
||||
return input.is_element();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -123,6 +123,8 @@ protected:
|
|||
Vector<LineBox> m_line_boxes;
|
||||
|
||||
private:
|
||||
virtual bool is_box() const final { return true; }
|
||||
|
||||
Gfx::FloatPoint m_offset;
|
||||
Gfx::FloatSize m_size;
|
||||
|
||||
|
@ -133,3 +135,12 @@ private:
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
namespace AK {
|
||||
template<>
|
||||
inline bool is<Web::Layout::Box>(const Web::Layout::Node& input)
|
||||
{
|
||||
return input.is_box();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -115,6 +115,8 @@ public:
|
|||
virtual void paint_fragment(PaintContext&, const LineBoxFragment&, PaintPhase) const { }
|
||||
virtual void after_children_paint(PaintContext&, PaintPhase) {};
|
||||
|
||||
virtual bool is_box() const { return false; }
|
||||
|
||||
bool is_floating() const;
|
||||
bool is_positioned() const;
|
||||
bool is_absolutely_positioned() const;
|
||||
|
|
Loading…
Reference in a new issue