mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
LibWeb: Ignore invisible boxes and stacking contexts during hit testing
This commit is contained in:
parent
df8ef03957
commit
196a3eb239
2 changed files with 10 additions and 3 deletions
|
@ -286,8 +286,10 @@ Optional<HitTestResult> StackingContext::hit_test(Gfx::FloatPoint const& positio
|
|||
// 7. the child stacking contexts with positive stack levels (least positive first).
|
||||
for (ssize_t i = m_children.size() - 1; i >= 0; --i) {
|
||||
auto const& child = *m_children[i];
|
||||
if (!child.m_box.is_visible())
|
||||
continue;
|
||||
if (child.m_box.computed_values().z_index().value_or(0) < 0)
|
||||
break;
|
||||
continue;
|
||||
auto result = child.hit_test(transformed_position, type);
|
||||
if (result.has_value())
|
||||
return result;
|
||||
|
@ -340,7 +342,9 @@ Optional<HitTestResult> StackingContext::hit_test(Gfx::FloatPoint const& positio
|
|||
for (ssize_t i = m_children.size() - 1; i >= 0; --i) {
|
||||
auto const& child = *m_children[i];
|
||||
if (child.m_box.computed_values().z_index().value_or(0) < 0)
|
||||
break;
|
||||
continue;
|
||||
if (!child.m_box.is_visible())
|
||||
continue;
|
||||
auto result = child.hit_test(transformed_position, type);
|
||||
if (result.has_value())
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue