1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:07:36 +00:00

LibWeb: Move StackingContext and PaintPhase into the Painting namespace

This commit is contained in:
Andreas Kling 2022-03-10 02:13:28 +01:00
parent a4d51b3dc2
commit f0d833a3d7
41 changed files with 105 additions and 103 deletions

View file

@ -9,11 +9,19 @@
#include <AK/Vector.h>
#include <LibWeb/Layout/Node.h>
namespace Web::Layout {
namespace Web::Painting {
enum class PaintPhase {
Background,
Border,
Foreground,
FocusOutline,
Overlay,
};
class StackingContext {
public:
StackingContext(Box&, StackingContext* parent);
StackingContext(Layout::Box&, StackingContext* parent);
StackingContext* parent() { return m_parent; }
const StackingContext* parent() const { return m_parent; }
@ -26,14 +34,14 @@ public:
FocusAndOverlay,
};
void paint_descendants(PaintContext&, Node&, StackingContextPaintPhase);
void paint_descendants(PaintContext&, Layout::Node&, StackingContextPaintPhase);
void paint(PaintContext&);
HitTestResult hit_test(const Gfx::IntPoint&, HitTestType) const;
Layout::HitTestResult hit_test(Gfx::IntPoint const&, Layout::HitTestType) const;
void dump(int indent = 0) const;
private:
Box& m_box;
Layout::Box& m_box;
StackingContext* const m_parent { nullptr };
Vector<StackingContext*> m_children;