Преглед на файлове

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.
Timothy Flynn преди 4 години
родител
ревизия
227ccfc61a
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  1. 1 0
      Userland/Libraries/LibWeb/Painting/StackingContext.cpp

+ 1 - 0
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) {