mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
LubWeb: Call before_children_paint for positioned descendants
Add before_children_paint and after_children_paint calls for positioned descendants with z-index: auto during painting
This commit is contained in:
parent
f3d57e1157
commit
adf0262b54
1 changed files with 6 additions and 0 deletions
|
@ -177,6 +177,10 @@ void StackingContext::paint_internal(PaintContext& context) const
|
||||||
// At this point, `paint_box` is a positioned descendant with z-index: auto
|
// At this point, `paint_box` is a positioned descendant with z-index: auto
|
||||||
// but no stacking context of its own.
|
// but no stacking context of its own.
|
||||||
// FIXME: This is basically duplicating logic found elsewhere in this same function. Find a way to make this more elegant.
|
// FIXME: This is basically duplicating logic found elsewhere in this same function. Find a way to make this more elegant.
|
||||||
|
auto parent = paint_box.layout_node().parent();
|
||||||
|
auto* paintable = parent ? parent->paintable() : nullptr;
|
||||||
|
if (paintable)
|
||||||
|
paintable->before_children_paint(context, PaintPhase::Foreground);
|
||||||
paint_node(paint_box.layout_box(), context, PaintPhase::Background);
|
paint_node(paint_box.layout_box(), context, PaintPhase::Background);
|
||||||
paint_node(paint_box.layout_box(), context, PaintPhase::Border);
|
paint_node(paint_box.layout_box(), context, PaintPhase::Border);
|
||||||
paint_descendants(context, paint_box.layout_box(), StackingContextPaintPhase::BackgroundAndBorders);
|
paint_descendants(context, paint_box.layout_box(), StackingContextPaintPhase::BackgroundAndBorders);
|
||||||
|
@ -187,6 +191,8 @@ void StackingContext::paint_internal(PaintContext& context) const
|
||||||
paint_node(paint_box.layout_box(), context, PaintPhase::FocusOutline);
|
paint_node(paint_box.layout_box(), context, PaintPhase::FocusOutline);
|
||||||
paint_node(paint_box.layout_box(), context, PaintPhase::Overlay);
|
paint_node(paint_box.layout_box(), context, PaintPhase::Overlay);
|
||||||
paint_descendants(context, paint_box.layout_box(), StackingContextPaintPhase::FocusAndOverlay);
|
paint_descendants(context, paint_box.layout_box(), StackingContextPaintPhase::FocusAndOverlay);
|
||||||
|
if (paintable)
|
||||||
|
paintable->after_children_paint(context, PaintPhase::Foreground);
|
||||||
|
|
||||||
return TraversalDecision::Continue;
|
return TraversalDecision::Continue;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue