diff --git a/Tests/LibWeb/Ref/reference/scrollable-contains-boxes-with-hidden-overflow-and-opacity-ref.html b/Tests/LibWeb/Ref/reference/scrollable-contains-boxes-with-hidden-overflow-and-opacity-ref.html
new file mode 100644
index 0000000000..7dc0049208
--- /dev/null
+++ b/Tests/LibWeb/Ref/reference/scrollable-contains-boxes-with-hidden-overflow-and-opacity-ref.html
@@ -0,0 +1,52 @@
+
+
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
diff --git a/Tests/LibWeb/Ref/scrollable-contains-boxes-with-hidden-overflow-and-opacity.html b/Tests/LibWeb/Ref/scrollable-contains-boxes-with-hidden-overflow-and-opacity.html
new file mode 100644
index 0000000000..a1f7c43b5b
--- /dev/null
+++ b/Tests/LibWeb/Ref/scrollable-contains-boxes-with-hidden-overflow-and-opacity.html
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.h b/Userland/Libraries/LibWeb/Painting/PaintableBox.h
index 8c9ab16e84..a2e6b24eb5 100644
--- a/Userland/Libraries/LibWeb/Painting/PaintableBox.h
+++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.h
@@ -198,6 +198,8 @@ public:
void set_enclosing_scroll_frame_offset(CSSPixelPoint offset) { m_enclosing_scroll_frame_offset = offset; }
void set_corner_clip_radii(BorderRadiiData const& corner_radii) { m_corner_clip_radii = corner_radii; }
+ Optional
scroll_frame_id() const { return m_scroll_frame_id; }
+
protected:
explicit PaintableBox(Layout::Box const&);
diff --git a/Userland/Libraries/LibWeb/Painting/RecordingPainter.h b/Userland/Libraries/LibWeb/Painting/RecordingPainter.h
index 9dc1e56fbd..d6dd682046 100644
--- a/Userland/Libraries/LibWeb/Painting/RecordingPainter.h
+++ b/Userland/Libraries/LibWeb/Painting/RecordingPainter.h
@@ -122,7 +122,7 @@ struct PushStackingContext {
void translate_by(Gfx::IntPoint const& offset)
{
- post_transform_translation.translate_by(offset);
+ source_paintable_rect.translate_by(offset);
}
};
diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp
index ca26d63aae..5caabaa5e1 100644
--- a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp
+++ b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp
@@ -319,9 +319,13 @@ void StackingContext::paint(PaintContext& context) const
}
}
+ context.recording_painter().save();
+ if (paintable().is_paintable_box() && paintable_box().scroll_frame_id().has_value())
+ context.recording_painter().set_scroll_frame_id(*paintable_box().scroll_frame_id());
context.recording_painter().push_stacking_context(push_stacking_context_params);
paint_internal(context);
context.recording_painter().pop_stacking_context();
+ context.recording_painter().restore();
}
template