summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout/Progress.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-03-17Libraries: Use default constructors/destructors in LibWebLenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2022-03-11LibWeb: Remove a bunch of no-longer needed #includesAndreas Kling
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: 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.
2022-03-11LibWeb: Rename Painting::Box => PaintableAndreas Kling
Calling this "Box" made it very confusing to look at code that used both Layout::Box and Painting::Box. Let's try calling it Paintable instead.
2022-03-11LibWeb: Move StackingContext and PaintPhase into the Painting namespaceAndreas Kling
2022-03-11LibWeb: Add Painting::Box and move things from Layout::Box into itAndreas Kling
The "paintable" state in Layout::Box was actually not safe to access until after layout had been performed. As a first step towards making this harder to mess up accidentally, this patch moves painting information from Layout::Box to a new class: Painting::Box. Every layout can have a corresponding paint box, and it holds the final used metrics determined by layout. The paint box is created and populated by FormattingState::commit(). I've also added DOM::Node::paint_box() as a convenient way to access the paint box (if available) of a given DOM node. Going forward, I believe this will allow us to better separate data that belongs to layout vs painting, and also open up opportunities for naturally invalidating caches in the paint box (since it's reconstituted by every layout.)
2022-02-16LibWeb: Add basic implementation of progress bar elementRafał Babiarz