mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:27:45 +00:00
LibWeb: Change StackingContext::hit_test() to accept callback
This change modifies hit_test() to no longer return the first paintable encountered at a specified position. Instead, this function accepts a callback that is invoked for each paintable located at a position, in hit-testing order. This modification will allow us to reuse this call for `Document.elementsFromPoint()` in upcoming changes.
This commit is contained in:
parent
15d151ee66
commit
9c99182b1e
11 changed files with 120 additions and 104 deletions
|
@ -32,7 +32,7 @@ public:
|
|||
|
||||
virtual bool is_inline_paintable() const override { return true; }
|
||||
|
||||
virtual Optional<HitTestResult> hit_test(CSSPixelPoint, HitTestType) const override;
|
||||
virtual TraversalDecision hit_test(CSSPixelPoint, HitTestType, Function<TraversalDecision(HitTestResult)> const& callback) const override;
|
||||
|
||||
void set_box_shadow_data(Vector<ShadowData>&& box_shadow_data) { m_box_shadow_data = move(box_shadow_data); }
|
||||
Vector<ShadowData> const& box_shadow_data() const { return m_box_shadow_data; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue