1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 18:45:08 +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:
Andreas Kling 2020-06-18 18:57:35 +02:00
parent abe811104f
commit cfab53903f
22 changed files with 109 additions and 95 deletions

View file

@ -210,7 +210,7 @@ void PageView::paint_event(GUI::PaintEvent& event)
RenderingContext context(painter, palette(), { horizontal_scrollbar().value(), vertical_scrollbar().value() });
context.set_should_show_line_box_borders(m_should_show_line_box_borders);
context.set_viewport_rect(viewport_rect_in_content_coordinates());
layout_root()->render(context);
layout_root()->paint_all_phases(context);
}
void PageView::mousemove_event(GUI::MouseEvent& event)