summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Layout/LayoutDocument.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-05 16:55:56 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-05 16:57:51 +0200
commite2b4fef6c75070febdc689d7fadc21eb28c2315d (patch)
tree981ef1f04549f0d07f29e6cb8e5c369ebe1b85ea /Libraries/LibWeb/Layout/LayoutDocument.h
parent5cee150a91b6c3fab02240ebc3d7a48e5bbad56e (diff)
downloadserenity-e2b4fef6c75070febdc689d7fadc21eb28c2315d.zip
LibWeb: Specialize hit testing for text cursor purposes
The text cursor follows slightly different "intuitive" rules than the regular hit testing. Clicking past the right edge of a text box should still "hit" the text box, and place the cursor at its end, for example. We solve this by adding a HitTestType enum that is passed to hit_test() and determines whether past-the-edge candidates are considered.
Diffstat (limited to 'Libraries/LibWeb/Layout/LayoutDocument.h')
-rw-r--r--Libraries/LibWeb/Layout/LayoutDocument.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibWeb/Layout/LayoutDocument.h b/Libraries/LibWeb/Layout/LayoutDocument.h
index 5e6206f13e..79dbd7312a 100644
--- a/Libraries/LibWeb/Layout/LayoutDocument.h
+++ b/Libraries/LibWeb/Layout/LayoutDocument.h
@@ -43,7 +43,7 @@ public:
void paint_all_phases(PaintContext&);
virtual void paint(PaintContext&, PaintPhase) override;
- virtual HitTestResult hit_test(const Gfx::IntPoint&) const override;
+ virtual HitTestResult hit_test(const Gfx::IntPoint&, HitTestType) const override;
const LayoutRange& selection() const { return m_selection; }
LayoutRange& selection() { return m_selection; }