1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

LibHTML: Implement naive hit testing

We don't have proper line boxes yet, so we can't easily hit test
inline text.
This commit is contained in:
Andreas Kling 2019-09-28 23:02:22 +02:00
parent 3ed41abba4
commit 3de4b99dc3
4 changed files with 38 additions and 0 deletions

View file

@ -9,7 +9,13 @@
#include <LibHTML/TreeNode.h>
class Node;
class Element;
class LayoutBlock;
class LayoutNode;
struct HitTestResult {
RefPtr<LayoutNode> layout_node;
};
class LayoutNode : public TreeNode<LayoutNode> {
public:
@ -22,6 +28,8 @@ public:
ComputedStyle& style() { return m_style; }
const ComputedStyle& style() const { return m_style; }
virtual HitTestResult hit_test(const Point&) const;
bool is_anonymous() const { return !m_node; }
const Node* node() const { return m_node; }