mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 23:30:20 +00:00
LibWeb: Layout foreignObject as block-level element with hidden overflow
This is according to the default user-agent style from the SVG2 spec. In order for this to work correctly, we also have to assign width and height to foreignObject boxes during SVG layout, since they are handled manually by SVGFormattingContext.
This commit is contained in:
parent
b3fd939628
commit
b4708510fb
Notes:
github-actions[bot]
2025-07-09 12:37:48 +00:00
Author: https://github.com/awesomekling
Commit: b4708510fb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5369
Reviewed-by: https://github.com/gmta ✅
4 changed files with 35 additions and 17 deletions
|
@ -282,6 +282,8 @@ void SVGFormattingContext::layout_svg_element(Box const& child)
|
|||
bfc.run(*m_available_space);
|
||||
auto& child_state = m_state.get_mutable(child);
|
||||
child_state.set_content_offset(child_state.offset.translated(m_svg_offset));
|
||||
child_state.set_content_width(child.computed_values().width().to_px(child, m_available_space->width.to_px_or_zero()));
|
||||
child_state.set_content_height(child.computed_values().height().to_px(child, m_available_space->height.to_px_or_zero()));
|
||||
child.for_each_child_of_type<SVGMaskBox>([&](SVGMaskBox const& child) {
|
||||
layout_svg_element(child);
|
||||
return IterationDecision::Continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue