mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +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:
@@ -100,9 +100,17 @@ void LayoutDocument::did_set_viewport_rect(Badge<Frame>, const Gfx::IntRect& a_v
|
||||
});
|
||||
}
|
||||
|
||||
void LayoutDocument::render(RenderingContext& context)
|
||||
void LayoutDocument::paint_all_phases(RenderingContext& context)
|
||||
{
|
||||
stacking_context()->render(context);
|
||||
render(context, PaintPhase::Background);
|
||||
render(context, PaintPhase::Border);
|
||||
render(context, PaintPhase::Foreground);
|
||||
render(context, PaintPhase::Overlay);
|
||||
}
|
||||
|
||||
void LayoutDocument::render(RenderingContext& context, PaintPhase phase)
|
||||
{
|
||||
stacking_context()->render(context, phase);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user