mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-10-12 21:35:12 +03:00
LibWeb: Don't attempt to layout the inside of childless boxes
Some boxes cannot have children (most commonly replaced elements), and so there is nothing meaningful inside them to layout. We now use the can_have_children() flag to quickly skip over such boxes instead of creating a formatting context and other pointless busywork.
This commit is contained in:
parent
d9e0fd8823
commit
dfeb4550d5
Notes:
sideshowbarker
2024-07-18 02:59:38 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/dfeb4550d54
@ -76,6 +76,9 @@ bool FormattingContext::creates_block_formatting_context(const Box& box)
|
||||
|
||||
void FormattingContext::layout_inside(Box& child_box, LayoutMode layout_mode)
|
||||
{
|
||||
if (!child_box.can_have_children())
|
||||
return;
|
||||
|
||||
if (is<SVGSVGBox>(child_box)) {
|
||||
SVGFormattingContext context(child_box, this);
|
||||
context.run(child_box, layout_mode);
|
||||
|
Loading…
Reference in New Issue
Block a user