1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:17:45 +00:00

LibWeb: Make IFC happy to layout anything as long as it's inline outside

Before this, whenever encountering something other than dumb text
content in an inline flow, we assumed it had to be either a replaced
element, or an inline-block.

This removes the special-casing of inline-block so that IFC can size and
layout anything as long as it's inline on the outside.
This commit is contained in:
Andreas Kling 2022-10-06 20:29:31 +02:00
parent be80ac619f
commit 97bbb630c8

View file

@ -122,7 +122,9 @@ void InlineFormattingContext::dimension_box_on_line(Box const& box, LayoutMode l
return;
}
if (box.display().is_flow_root_inside()) {
// Any box that has simple flow inside should have generated line box fragments already.
VERIFY(!box.display().is_flow_inside());
auto const& width_value = box.computed_values().width();
if (width_value.is_auto()) {
auto result = calculate_shrink_to_fit_widths(box);
@ -158,13 +160,6 @@ void InlineFormattingContext::dimension_box_on_line(Box const& box, LayoutMode l
if (independent_formatting_context)
independent_formatting_context->parent_context_did_dimension_child_root_box();
return;
}
// Non-replaced, non-inline-block, box on a line!?
// I don't think we should be here. Dump the box tree so we can take a look at it.
dbgln("FIXME: I've been asked to dimension a non-replaced, non-inline-block box on a line:");
dump_tree(box);
}
void InlineFormattingContext::apply_justification_to_fragments(CSS::TextJustify text_justify, LineBox& line_box, bool is_last_line)