summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-04-07 15:29:58 +0200
committerAndreas Kling <kling@serenityos.org>2022-04-07 17:06:02 +0200
commit3c4bdd7cfa1b387e7a36df1e84a1a3c2f0b03f4f (patch)
tree949429093a44572e152528fcc9edf7e1aaa062f0 /Userland/Libraries
parent85dd8918117855ff6cffd9beef7e7ad7ca899bb8 (diff)
downloadserenity-3c4bdd7cfa1b387e7a36df1e84a1a3c2f0b03f4f.zip
LibWeb: Ignore non-painting layout nodes when hit testing
We currently have to check this because the paint tree hangs from the layout tree and has no independent means of traversal.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/Painting/StackingContext.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp
index 92151efc7c..048b56a663 100644
--- a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp
+++ b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp
@@ -341,6 +341,8 @@ Optional<HitTestResult> StackingContext::hit_test(Gfx::FloatPoint const& positio
if (!m_box.children_are_inline()) {
m_box.for_each_in_subtree_of_type<Layout::Box>([&](Layout::Box const& box) {
if (!box.is_absolutely_positioned() && !box.is_floating()) {
+ if (!box.paint_box())
+ return IterationDecision::Continue;
if (auto candidate = box.paint_box()->hit_test(transformed_position, type); candidate.has_value())
result = move(candidate);
}