summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-03 19:15:27 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-03 21:45:41 +0100
commitd129e68da8938b653900f453c9c242579e4f580c (patch)
tree98083ad84e39ad50c63b247cd7e4a7f14dceab24 /Libraries/LibWeb
parentd6c2a61fa1949e3fa6723ae86cf10abb2821fca9 (diff)
downloadserenity-d129e68da8938b653900f453c9c242579e4f580c.zip
LibWeb: Move PaintPhase enum out of Layout::Node
Now it's just Layout::PaintPhase instead of Layout::Node::PaintPhase.
Diffstat (limited to 'Libraries/LibWeb')
-rw-r--r--Libraries/LibWeb/Forward.h1
-rw-r--r--Libraries/LibWeb/Layout/Node.h16
-rw-r--r--Libraries/LibWeb/Painting/StackingContext.cpp2
-rw-r--r--Libraries/LibWeb/Painting/StackingContext.h2
4 files changed, 11 insertions, 10 deletions
diff --git a/Libraries/LibWeb/Forward.h b/Libraries/LibWeb/Forward.h
index 3b0c20d156..7dd98c79e6 100644
--- a/Libraries/LibWeb/Forward.h
+++ b/Libraries/LibWeb/Forward.h
@@ -148,6 +148,7 @@ class SVGSVGElement;
namespace Web::Layout {
enum class LayoutMode;
+enum class PaintPhase;
class BlockBox;
class BlockFormattingContext;
class Box;
diff --git a/Libraries/LibWeb/Layout/Node.h b/Libraries/LibWeb/Layout/Node.h
index 8e3bb0c3c1..27809be760 100644
--- a/Libraries/LibWeb/Layout/Node.h
+++ b/Libraries/LibWeb/Layout/Node.h
@@ -46,6 +46,14 @@ enum class LayoutMode {
OnlyRequiredLineBreaks,
};
+enum class PaintPhase {
+ Background,
+ Border,
+ Foreground,
+ FocusOutline,
+ Overlay,
+};
+
struct HitTestResult {
RefPtr<Node> layout_node;
int index_in_node { 0 };
@@ -117,14 +125,6 @@ public:
virtual void handle_mouseup(Badge<EventHandler>, const Gfx::IntPoint&, unsigned button, unsigned modifiers);
virtual void handle_mousemove(Badge<EventHandler>, const Gfx::IntPoint&, unsigned buttons, unsigned modifiers);
- enum class PaintPhase {
- Background,
- Border,
- Foreground,
- FocusOutline,
- Overlay,
- };
-
virtual void before_children_paint(PaintContext&, PaintPhase) {};
virtual void paint(PaintContext&, PaintPhase);
virtual void after_children_paint(PaintContext&, PaintPhase) {};
diff --git a/Libraries/LibWeb/Painting/StackingContext.cpp b/Libraries/LibWeb/Painting/StackingContext.cpp
index daca00c597..5143876e6e 100644
--- a/Libraries/LibWeb/Painting/StackingContext.cpp
+++ b/Libraries/LibWeb/Painting/StackingContext.cpp
@@ -47,7 +47,7 @@ StackingContext::StackingContext(Box& box, StackingContext* parent)
}
}
-void StackingContext::paint(PaintContext& context, Node::PaintPhase phase)
+void StackingContext::paint(PaintContext& context, PaintPhase phase)
{
if (!m_box.is_root()) {
m_box.paint(context, phase);
diff --git a/Libraries/LibWeb/Painting/StackingContext.h b/Libraries/LibWeb/Painting/StackingContext.h
index 7e2e11e2d9..b0b212ed2d 100644
--- a/Libraries/LibWeb/Painting/StackingContext.h
+++ b/Libraries/LibWeb/Painting/StackingContext.h
@@ -38,7 +38,7 @@ public:
StackingContext* parent() { return m_parent; }
const StackingContext* parent() const { return m_parent; }
- void paint(PaintContext&, Layout::Node::PaintPhase);
+ void paint(PaintContext&, PaintPhase);
HitTestResult hit_test(const Gfx::IntPoint&, HitTestType) const;
void dump(int indent = 0) const;