mirror of
https://github.com/RGBCube/serenity
synced 2026-01-12 23:11:00 +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:
parent
ee4ba7617c
commit
08f217526a
4 changed files with 37 additions and 16 deletions
|
|
@ -114,8 +114,8 @@ public:
|
|||
DOM::Document const& document() const { return layout_box().document(); }
|
||||
DOM::Document& document() { return layout_box().document(); }
|
||||
|
||||
virtual void before_children_paint(PaintContext&, PaintPhase) const override;
|
||||
virtual void after_children_paint(PaintContext&, PaintPhase) const override;
|
||||
virtual void apply_clip_overflow_rect(PaintContext&, PaintPhase) const override;
|
||||
virtual void clear_clip_overflow_rect(PaintContext&, PaintPhase) const override;
|
||||
|
||||
virtual Optional<HitTestResult> hit_test(CSSPixelPoint, HitTestType) const override;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue