mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 23:30:20 +00:00
LibWeb: Resolve mask/clip in foreignObject's own coordinate space
We were neglecting to resolve these correctly, which caused them to get the same metrics as the nearest viewport above the foreignObject.
This commit is contained in:
parent
f5f3cd041a
commit
aae0b52403
Notes:
github-actions[bot]
2025-07-09 12:37:30 +00:00
Author: https://github.com/awesomekling
Commit: aae0b52403
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5369
Reviewed-by: https://github.com/gmta ✅
3 changed files with 35 additions and 4 deletions
|
@ -295,10 +295,11 @@ void SVGFormattingContext::layout_svg_element(Box const& child)
|
|||
child_state.set_content_offset(transformed_rect.location());
|
||||
child_state.set_content_width(transformed_rect.width());
|
||||
child_state.set_content_height(transformed_rect.height());
|
||||
child.for_each_child_of_type<SVGMaskBox>([&](SVGMaskBox const& child) {
|
||||
layout_svg_element(child);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
if (auto* mask_box = child.first_child_of_type<SVGMaskBox>())
|
||||
layout_mask_or_clip(*mask_box);
|
||||
|
||||
if (auto* clip_box = child.first_child_of_type<SVGClipBox>())
|
||||
layout_mask_or_clip(*clip_box);
|
||||
} else if (is<SVGGraphicsBox>(child)) {
|
||||
layout_graphics_element(static_cast<SVGGraphicsBox const&>(child));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue