summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Layout/LayoutBlock.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-01 19:02:28 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-01 19:10:58 +0200
commit392b05580690b271d21dde89a9f9b2b05988f234 (patch)
tree2834e39d37bf47e46b299b5277d6f64a81fb2bae /Libraries/LibWeb/Layout/LayoutBlock.cpp
parentf7a900367f802796d94742c5bbb272aa07b4450e (diff)
downloadserenity-392b05580690b271d21dde89a9f9b2b05988f234.zip
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.)
Diffstat (limited to 'Libraries/LibWeb/Layout/LayoutBlock.cpp')
-rw-r--r--Libraries/LibWeb/Layout/LayoutBlock.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Layout/LayoutBlock.cpp b/Libraries/LibWeb/Layout/LayoutBlock.cpp
index a043f3c216..d475fc37a9 100644
--- a/Libraries/LibWeb/Layout/LayoutBlock.cpp
+++ b/Libraries/LibWeb/Layout/LayoutBlock.cpp
@@ -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);