mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:57:45 +00:00
LibWeb: Use the StackingContext tree for hit testing
This makes it possible to click links that are above other content due to stacking context order (e.g via CSS z-index.)
This commit is contained in:
parent
f7a900367f
commit
392b055806
8 changed files with 36 additions and 1 deletions
|
@ -725,6 +725,8 @@ HitTestResult LayoutBlock::hit_test(const Gfx::IntPoint& position) const
|
|||
HitTestResult last_good_candidate;
|
||||
for (auto& line_box : m_line_boxes) {
|
||||
for (auto& fragment : line_box.fragments()) {
|
||||
if (is<LayoutBox>(fragment.layout_node()) && to<LayoutBox>(fragment.layout_node()).stacking_context())
|
||||
continue;
|
||||
if (enclosing_int_rect(fragment.absolute_rect()).contains(position)) {
|
||||
if (fragment.layout_node().is_block())
|
||||
return to<LayoutBlock>(fragment.layout_node()).hit_test(position);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue