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

LibWeb: Use rect of containing block instead of parent to clip overflow

Move overflow clipping from `before_children_paint` into separate
method and call this method on containing block instead of parent.

Example that got fixed:
```html
<!DOCTYPE html><html><head><style>
    * {
      border: 2px solid black;
    }
    body {
      overflow: hidden;
    }
    .inner {
      position: absolute;
      width: 100px;
      height: 100px;
      background: lime;
    }
</style></head><body><div class=inner></div>
```
This commit is contained in:
Aliaksandr Kalenik 2023-01-25 04:50:14 +03:00 committed by Andreas Kling
parent ee4ba7617c
commit 08f217526a
4 changed files with 37 additions and 16 deletions

View file

@ -88,6 +88,9 @@ public:
virtual void before_children_paint(PaintContext&, PaintPhase) const { }
virtual void after_children_paint(PaintContext&, PaintPhase) const { }
virtual void apply_clip_overflow_rect(PaintContext&, PaintPhase) const { }
virtual void clear_clip_overflow_rect(PaintContext&, PaintPhase) const { }
virtual Optional<HitTestResult> hit_test(CSSPixelPoint, HitTestType) const;
virtual bool wants_mouse_events() const { return false; }