mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:17:45 +00:00
LibWeb: Call before/after children_paint on parent in StackingContext
When it is called inside `box.for_each_child`, then it may not be called for the root element. By missing `SVGSVGBox::before_children_paint` the svg context is not created
This commit is contained in:
parent
566702ffa2
commit
eb1578e7c8
1 changed files with 6 additions and 2 deletions
|
@ -31,6 +31,9 @@ StackingContext::StackingContext(Box& box, StackingContext* parent)
|
||||||
|
|
||||||
void StackingContext::paint_descendants(PaintContext& context, Node& box, StackingContextPaintPhase phase)
|
void StackingContext::paint_descendants(PaintContext& context, Node& box, StackingContextPaintPhase phase)
|
||||||
{
|
{
|
||||||
|
if (phase == StackingContextPaintPhase::Foreground)
|
||||||
|
box.before_children_paint(context, PaintPhase::Foreground);
|
||||||
|
|
||||||
box.for_each_child([&](auto& child) {
|
box.for_each_child([&](auto& child) {
|
||||||
if (child.establishes_stacking_context())
|
if (child.establishes_stacking_context())
|
||||||
return;
|
return;
|
||||||
|
@ -55,9 +58,7 @@ void StackingContext::paint_descendants(PaintContext& context, Node& box, Stacki
|
||||||
case StackingContextPaintPhase::Foreground:
|
case StackingContextPaintPhase::Foreground:
|
||||||
if (!child.is_positioned()) {
|
if (!child.is_positioned()) {
|
||||||
child.paint(context, PaintPhase::Foreground);
|
child.paint(context, PaintPhase::Foreground);
|
||||||
child.before_children_paint(context, PaintPhase::Foreground);
|
|
||||||
paint_descendants(context, child, phase);
|
paint_descendants(context, child, phase);
|
||||||
child.after_children_paint(context, PaintPhase::Foreground);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case StackingContextPaintPhase::FocusAndOverlay:
|
case StackingContextPaintPhase::FocusAndOverlay:
|
||||||
|
@ -69,6 +70,9 @@ void StackingContext::paint_descendants(PaintContext& context, Node& box, Stacki
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (phase == StackingContextPaintPhase::Foreground)
|
||||||
|
box.after_children_paint(context, PaintPhase::Foreground);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StackingContext::paint_internal(PaintContext& context)
|
void StackingContext::paint_internal(PaintContext& context)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue