mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 07:33:20 +00:00
LibWeb: Check if transform is identity instead of has_css_transform()
...in clip and scroll frames calculation algorithm.
Fix a regression from 719a50c
where display-list recording disagreed
with the clipping logic about whether a stacking context is transformed.
`has_css_transform()` returns true whenever the computed transform is
not `none`, which differs from an identity-matrix check. These yield
different results for cases like `translate(0, 0)`.
This commit is contained in:
parent
719a50c9bf
commit
9bbc1cd618
Notes:
github-actions[bot]
2025-09-23 21:36:55 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 9bbc1cd618
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6285
4 changed files with 43 additions and 8 deletions
|
@ -326,10 +326,8 @@ void StackingContext::paint(DisplayListRecordingContext& context) const
|
|||
push_stacking_context_params.clip_path = path.copy_transformed(Gfx::AffineTransform {}.set_scale(device_pixel_scale, device_pixel_scale).set_translation(source_paintable_rect.location().to_type<float>()));
|
||||
}
|
||||
|
||||
auto has_css_transform = paintable_box().has_css_transform();
|
||||
if (has_css_transform) {
|
||||
if (!transform_matrix.is_identity())
|
||||
paintable_box().apply_clip_overflow_rect(context, PaintPhase::Foreground);
|
||||
}
|
||||
paintable_box().apply_scroll_offset(context);
|
||||
|
||||
auto mask_image = computed_values.mask_image();
|
||||
|
@ -376,7 +374,7 @@ void StackingContext::paint(DisplayListRecordingContext& context) const
|
|||
context.display_list_recorder().restore();
|
||||
}
|
||||
paintable_box().reset_scroll_offset(context);
|
||||
if (has_css_transform)
|
||||
if (!transform_matrix.is_identity())
|
||||
paintable_box().clear_clip_overflow_rect(context, PaintPhase::Foreground);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue