mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
LibWeb: Apply CSS clip
property to an element as well as its children
d06d4eb
made the `clip` property apply to children of an absolute-
positioned element, but caused it not to be applied to the element the
property was applied to directly.
To fix this, apply the clip in new `before_paint()` and `after_paint()`
functions. Doing so keeps painter state from leaking from `paint()`,
but still allows subclasses of `PaintableBox` clip their contents
correctly without repeating the application of the clip rectangle.
This commit is contained in:
parent
2e45306d42
commit
9d4a1ac2b3
4 changed files with 47 additions and 9 deletions
|
@ -26,7 +26,9 @@ namespace Web::Painting {
|
|||
|
||||
static void paint_node(Paintable const& paintable, PaintContext& context, PaintPhase phase)
|
||||
{
|
||||
paintable.before_paint(context, phase);
|
||||
paintable.paint(context, phase);
|
||||
paintable.after_paint(context, phase);
|
||||
}
|
||||
|
||||
StackingContext::StackingContext(PaintableBox& paintable_box, StackingContext* parent, size_t index_in_tree_order)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue