mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-01 13:49:05 +00:00
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.
This commit is contained in:
parent
11ede565a8
commit
bee4df7bfb
Notes:
sideshowbarker
2024-07-17 05:13:53 +09:00
Author: https://github.com/Lubrsi
Commit: bee4df7bfb
Pull-request: https://github.com/SerenityOS/serenity/pull/15964
Reviewed-by: https://github.com/awesomekling
1 changed files with 4 additions and 0 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue