mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
LibWeb: Separate layout tree rendering into phases
CSS defines a very specific paint order. This patch starts steering us towards respecting that by introducing the PaintPhase enum with values: - Background - Border - Foreground - Overlay (internal overlays used by inspector) Basically, to get the right visual result, we have to render the page multiple times, going one phase at a time.
This commit is contained in:
@@ -89,7 +89,7 @@ const LayoutBlock* LayoutNode::containing_block() const
|
||||
return nearest_block_ancestor();
|
||||
}
|
||||
|
||||
void LayoutNode::render(RenderingContext& context)
|
||||
void LayoutNode::render(RenderingContext& context, PaintPhase phase)
|
||||
{
|
||||
if (!is_visible())
|
||||
return;
|
||||
@@ -97,7 +97,7 @@ void LayoutNode::render(RenderingContext& context)
|
||||
for_each_child([&](auto& child) {
|
||||
if (child.is_box() && to<LayoutBox>(child).stacking_context())
|
||||
return;
|
||||
child.render(context);
|
||||
child.render(context, phase);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user