From 227ccfc61a543764bea5dcacdc4f27aa3a5b9c98 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 11 May 2021 09:40:47 -0400 Subject: LibWeb: Paint an element's foreground before painting its children The current implementation is missing the emphasized text of the following rule in the painting order spec: 7. Otherwise: *first for the element*, then for all its in-flow, non-positioned, block-level descendants in tree order... This ensures the foreground is painted for the current element before descending into its children. --- Userland/Libraries/LibWeb/Painting/StackingContext.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Userland/Libraries') diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp index bbd9e8ae76..7be1bfd14e 100644 --- a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp +++ b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp @@ -85,6 +85,7 @@ void StackingContext::paint(PaintContext& context) // Draw the non-positioned floats (step 5) paint_descendants(context, m_box, StackingContextPaintPhase::Floats); // Draw inline content, replaced content, etc. (steps 6, 7) + m_box.paint(context, PaintPhase::Foreground); paint_descendants(context, m_box, StackingContextPaintPhase::Foreground); // Draw other positioned descendants (steps 8, 9) for (auto* child : m_children) { -- cgit v1.2.3