Skip to content

Commit

Permalink
LibWeb: Log a FIXME when encountering an unexpected block-level box
Browse files Browse the repository at this point in the history
I've seen a crash when trying to verify_cast some block-level box to a
BlockContainer when it's actually something else.

This patch adds a debug log message so we can learn more about it next
time it happens somewhere.
  • Loading branch information
awesomekling committed Mar 22, 2024
1 parent 8aae50f commit 34954f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
Expand Up @@ -623,6 +623,11 @@ void BlockFormattingContext::layout_block_level_box(Box const& box, BlockContain

auto independent_formatting_context = create_independent_formatting_context_if_needed(m_state, box);

if (!independent_formatting_context && !is<BlockContainer>(box)) {
dbgln("FIXME: Block-level box is not BlockContainer but does not create formatting context: {}", box.debug_description());
return;
}

m_margin_state.update_block_waiting_for_final_y_position();
CSSPixels margin_top = m_margin_state.current_collapsed_margin();

Expand Down

0 comments on commit 34954f4

Please sign in to comment.