mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibWeb: Fix pointer-events check in hit_test
This commit is contained in:
parent
ebd93c8d57
commit
66e424a084
Notes:
sideshowbarker
2024-07-17 05:16:45 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 66e424a084
Pull-request: https://github.com/SerenityOS/serenity/pull/15711
2 changed files with 8 additions and 10 deletions
|
@ -379,10 +379,6 @@ Optional<HitTestResult> StackingContext::hit_test(Gfx::FloatPoint const& positio
|
|||
return {};
|
||||
}
|
||||
|
||||
if (paintable().computed_values().pointer_events() == CSS::PointerEvents::None) {
|
||||
return {};
|
||||
}
|
||||
|
||||
// NOTE: Hit testing basically happens in reverse painting order.
|
||||
// https://www.w3.org/TR/CSS22/visuren.html#z-index
|
||||
|
||||
|
@ -393,7 +389,7 @@ Optional<HitTestResult> StackingContext::hit_test(Gfx::FloatPoint const& positio
|
|||
if (child.m_box.computed_values().z_index().value_or(0) < 0)
|
||||
break;
|
||||
auto result = child.hit_test(transformed_position, type);
|
||||
if (result.has_value())
|
||||
if (result.has_value() && result->paintable->visible_for_hit_testing())
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -413,13 +409,13 @@ Optional<HitTestResult> StackingContext::hit_test(Gfx::FloatPoint const& positio
|
|||
}
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
if (result.has_value())
|
||||
if (result.has_value() && result->paintable->visible_for_hit_testing())
|
||||
return result;
|
||||
|
||||
// 5. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks.
|
||||
if (m_box.children_are_inline() && is<Layout::BlockContainer>(m_box)) {
|
||||
auto result = paintable().hit_test(transformed_position, type);
|
||||
if (result.has_value())
|
||||
if (result.has_value() && result->paintable->visible_for_hit_testing())
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -438,7 +434,7 @@ Optional<HitTestResult> StackingContext::hit_test(Gfx::FloatPoint const& positio
|
|||
}
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
if (result.has_value())
|
||||
if (result.has_value() && result->paintable->visible_for_hit_testing())
|
||||
return result;
|
||||
|
||||
// 3. the in-flow, non-inline-level, non-positioned descendants.
|
||||
|
@ -457,7 +453,7 @@ Optional<HitTestResult> StackingContext::hit_test(Gfx::FloatPoint const& positio
|
|||
}
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
if (result.has_value())
|
||||
if (result.has_value() && result->paintable->visible_for_hit_testing())
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -468,7 +464,7 @@ Optional<HitTestResult> StackingContext::hit_test(Gfx::FloatPoint const& positio
|
|||
if (child.m_box.computed_values().z_index().value_or(0) >= 0)
|
||||
break;
|
||||
auto result = child.hit_test(transformed_position, type);
|
||||
if (result.has_value())
|
||||
if (result.has_value() && result->paintable->visible_for_hit_testing())
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue