Browse Source

LibWeb: Include scrollable overflow in the "absolute paint rect"

This finally fixes the issue where stacking contexts that have either a
transform or opacity != 1 would clip their descendants to the root of
the stacking context.
Andreas Kling 2 years ago
parent
commit
158caf1b91
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Userland/Libraries/LibWeb/Painting/PaintableBox.cpp

+ 7 - 0
Userland/Libraries/LibWeb/Painting/PaintableBox.cpp

@@ -104,6 +104,13 @@ CSSPixelRect PaintableBox::compute_absolute_paint_rect() const
 {
     // FIXME: This likely incomplete:
     auto rect = absolute_border_box_rect();
+    if (has_scrollable_overflow()) {
+        auto scrollable_overflow_rect = this->scrollable_overflow_rect().value();
+        if (computed_values().overflow_x() == CSS::Overflow::Visible)
+            rect.unite_horizontally(scrollable_overflow_rect);
+        if (computed_values().overflow_y() == CSS::Overflow::Visible)
+            rect.unite_vertically(scrollable_overflow_rect);
+    }
     auto resolved_box_shadow_data = resolve_box_shadow_data();
     for (auto const& shadow : resolved_box_shadow_data) {
         if (shadow.placement == ShadowPlacement::Inner)