1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:57:44 +00:00

LibWeb: Remove is<BlockContainer> check for fragments in hit testing

This change introduces a method for direct access to the paintable of
a PaintableFragment. This method is intended to replace the usage of
the layout node pointer. Currently, we are only eliminating the use
of `layout_node()` in hit testing.

Additionally, we no longer check if a fragment's layout node is a
`BlockContainer` before recursing into its children during hit testing.
This check was likely relevant when all fragments were owned by
`PaintableWithLines`, but now it should be safe to remove this check.
This commit is contained in:
Aliaksandr Kalenik 2024-01-25 15:29:12 +01:00 committed by Andreas Kling
parent 09124fc3a5
commit 270bbf43ab
3 changed files with 13 additions and 12 deletions

View file

@ -20,6 +20,7 @@ public:
explicit PaintableFragment(Layout::LineBoxFragment const&);
Layout::Node const& layout_node() const { return m_layout_node; }
Paintable const& paintable() const { return *m_layout_node->paintable(); }
int start() const { return m_start; }
int length() const { return m_length; }