mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Deduplicate clipping code
This makes it so that PaintableWithLines no longer has its own bespoke clipping logic, using the same code as regular scroll/ overflow clipping.
This commit is contained in:
parent
155e60a5ff
commit
85883ee5ce
Notes:
github-actions[bot]
2025-05-13 12:32:43 +00:00
Author: https://github.com/Psychpsyo
Commit: 85883ee5ce
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4565
Reviewed-by: https://github.com/gmta
Reviewed-by: https://github.com/kalenikaliaksandr
7 changed files with 52 additions and 44 deletions
|
@ -136,6 +136,12 @@ void ViewportPaintable::assign_clip_frames()
|
|||
});
|
||||
|
||||
for_each_in_subtree([&](auto const& paintable) {
|
||||
if (paintable.is_paintable_box()) {
|
||||
auto const& paintable_box = static_cast<PaintableBox const&>(paintable);
|
||||
if (auto clip_frame = clip_state.get(paintable_box); clip_frame.has_value()) {
|
||||
const_cast<PaintableBox&>(paintable_box).set_own_clip_frame(clip_frame.value());
|
||||
}
|
||||
}
|
||||
for (auto block = paintable.containing_block(); !block->is_viewport(); block = block->containing_block()) {
|
||||
if (auto clip_frame = clip_state.get(block); clip_frame.has_value()) {
|
||||
if (paintable.is_paintable_box()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue