summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp
AgeCommit message (Collapse)Author
2023-01-11LibWeb: Make the paint tree GC-allocatedAndreas Kling
This simplifies the ownership model between DOM/layout/paint nodes immensely by deferring to the garbage collector for figuring out what's live and what's not.
2022-12-14LibWeb: Convert Paintable coordinates to new pixel unitsSam Atkins
This fixes a few sizing issues too. The page size is now correct in most cases! \o/ We get to remove some of the `to_type<>()` shenanigans, though it reappears in some other places.
2022-11-15LibWeb: Clip hidden overflow by absolute rect of containing blockAliaksandr Kalenik
Since handling overflow: hidden in PaintableBox::before_children_paint while following paint traversal order can't result in correctly computed clip rectangle for elements that create their own stacking context (because before_children_paint is called only for parent but overflow: hidden can be set somewhere deeper but not in direct ancestor), here introduced new function PaintableBox::clip_rect() that computes clip rectangle by looking into containing block. should_clip_overflow flag that disables clip for absolutely positioned elements in before_children_paint and after_children_paint is removed because after changing clip rectangle to be computed from not parent but containing block it is not needed anymore (absolutely positioned item is clipped if it's containing block has hidden overflow)
2022-09-14LibWeb: Don't clip to containing block when painting abspos descendantsAndreas Kling
2022-03-19LibWeb: Make SVG <svg> elements behave as CSS replaced elementsAndreas Kling
This makes SVG-in-HTML behave quite a bit better by following general replaced layout rules. It also turns <svg> elements into inline-level boxes instead of block-level boxes.
2022-03-11LibWeb: Make Paintable ref-countedAndreas Kling
This will allow us to use a protective NonnullRefPtr to keep paintables alive while running arbitrary JavaScript in response to events.
2022-03-11LibWeb: Split Paintable into Paintable and PaintableBoxAndreas Kling
To prepare for paintable inline content, we take the basic painting functionality and hoist it into a base class.
2022-03-11LibWeb: Let Paintable perform the paintingAndreas Kling
This patch adds a bunch of Paintable subclasses, each corresponding to the Layout::Node subclasses that had a paint() override. All painting logic is moved from layout nodes into their corresponding paintables. Paintables are now created by asking a Layout::Box to produce one: static NonnullOwnPtr<Paintable> Layout::Box::create_paintable() Note that inline nodes still have their painting logic. Since they are not boxes, and all paintables have a corresponding box, we'll need to come up with some other solution for them.