summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-03-10 15:44:43 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-11 00:21:49 +0100
commitcc8e429126f95aa27c675817f79cbdc8002e18a0 (patch)
treeed2c4c6f0d8bfae52301e56d2f7b519493a5f9e3 /Userland
parentf0d833a3d7d404fae17fd5199a42dfdddc268f3f (diff)
downloadserenity-cc8e429126f95aa27c675817f79cbdc8002e18a0.zip
LibWeb: Make StackingContext paint functions const
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/Painting/StackingContext.cpp6
-rw-r--r--Userland/Libraries/LibWeb/Painting/StackingContext.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp
index 9b4ef3b83f..103b41ee42 100644
--- a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp
+++ b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp
@@ -34,7 +34,7 @@ StackingContext::StackingContext(Layout::Box& box, StackingContext* parent)
}
}
-void StackingContext::paint_descendants(PaintContext& context, Layout::Node& box, StackingContextPaintPhase phase)
+void StackingContext::paint_descendants(PaintContext& context, Layout::Node& box, StackingContextPaintPhase phase) const
{
if (phase == StackingContextPaintPhase::Foreground)
box.before_children_paint(context, PaintPhase::Foreground);
@@ -91,7 +91,7 @@ void StackingContext::paint_descendants(PaintContext& context, Layout::Node& box
box.after_children_paint(context, PaintPhase::Foreground);
}
-void StackingContext::paint_internal(PaintContext& context)
+void StackingContext::paint_internal(PaintContext& context) const
{
// For a more elaborate description of the algorithm, see CSS 2.1 Appendix E
// Draw the background and borders for the context root (steps 1, 2)
@@ -122,7 +122,7 @@ void StackingContext::paint_internal(PaintContext& context)
paint_descendants(context, m_box, StackingContextPaintPhase::FocusAndOverlay);
}
-void StackingContext::paint(PaintContext& context)
+void StackingContext::paint(PaintContext& context) const
{
Gfx::PainterStateSaver saver(context.painter());
if (m_box.is_fixed_position()) {
diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.h b/Userland/Libraries/LibWeb/Painting/StackingContext.h
index 089d6c4fc1..ebbc384387 100644
--- a/Userland/Libraries/LibWeb/Painting/StackingContext.h
+++ b/Userland/Libraries/LibWeb/Painting/StackingContext.h
@@ -34,8 +34,8 @@ public:
FocusAndOverlay,
};
- void paint_descendants(PaintContext&, Layout::Node&, StackingContextPaintPhase);
- void paint(PaintContext&);
+ void paint_descendants(PaintContext&, Layout::Node&, StackingContextPaintPhase) const;
+ void paint(PaintContext&) const;
Layout::HitTestResult hit_test(Gfx::IntPoint const&, Layout::HitTestType) const;
void dump(int indent = 0) const;
@@ -45,7 +45,7 @@ private:
StackingContext* const m_parent { nullptr };
Vector<StackingContext*> m_children;
- void paint_internal(PaintContext&);
+ void paint_internal(PaintContext&) const;
};
}