summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2022-11-06 23:50:59 +0000
committerAndreas Kling <kling@serenityos.org>2022-11-07 14:10:41 +0100
commitbee4df7bfb9ace63e92d0172a8323b67cd7efa8b (patch)
treea7133bbcf6086e40731c0b650eef16c5e9226eda /Userland/Libraries/LibWeb
parent11ede565a865880a7155e687e14222fae15446bd (diff)
downloadserenity-bee4df7bfb9ace63e92d0172a8323b67cd7efa8b.zip
LibWeb: Skip hit testing a line box fragment if it has no container
The container appears to be null for certain elements such as the "update your browser" box when clicking on the document during certain parts of loading. Skipping it works fine, but should obviously be fixed, so it prints a debug output when this happens.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/Painting/PaintableBox.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
index 12e19ea2fd..3107927bb6 100644
--- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
+++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
@@ -673,6 +673,10 @@ Optional<HitTestResult> PaintableWithLines::hit_test(Gfx::FloatPoint const& posi
for (auto& fragment : line_box.fragments()) {
if (is<Layout::Box>(fragment.layout_node()) && static_cast<Layout::Box const&>(fragment.layout_node()).paint_box()->stacking_context())
continue;
+ if (!fragment.layout_node().containing_block()) {
+ dbgln("FIXME: PaintableWithLines::hit_test(): Missing containing block on {}", fragment.layout_node().debug_description());
+ continue;
+ }
auto fragment_absolute_rect = fragment.absolute_rect();
if (fragment_absolute_rect.contains(position)) {
if (is<Layout::BlockContainer>(fragment.layout_node()) && fragment.layout_node().paintable())