mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 08:11:13 +00:00
LibWeb: Print FIXME instead of crashing in abspos SVG element layout
Currently we are crashing in `verify_cast<BlockContainer>(box)` on attempt to create BFC for SVG box.
This commit is contained in:
parent
e3e0041c7f
commit
fa907029ee
Notes:
github-actions[bot]
2024-09-18 13:56:19 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/fa907029ee6 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1428
14
Tests/LibWeb/Layout/expected/svg/abspos-svg-polygon.txt
Normal file
14
Tests/LibWeb/Layout/expected/svg/abspos-svg-polygon.txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x216 [BFC] children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x200 children: not-inline
|
||||
BlockContainer <div> at (8,8) content-size 784x200 positioned children: inline
|
||||
frag 0 from SVGSVGBox start: 0, length: 0, rect: [8,8 200x200] baseline: 200
|
||||
SVGSVGBox <svg> at (8,8) content-size 200x200 [SVG] children: not-inline
|
||||
SVGGeometryBox <polygon> at (48,18) content-size 120x170 positioned [BFC] children: not-inline
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x216]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x200]
|
||||
PaintableWithLines (BlockContainer<DIV>) [8,8 784x200]
|
||||
SVGSVGPaintable (SVGSVGBox<svg>) [8,8 200x200]
|
||||
SVGPathPaintable (SVGGeometryBox<polygon>) [48,18 120x170]
|
1
Tests/LibWeb/Layout/input/svg/abspos-svg-polygon.html
Normal file
1
Tests/LibWeb/Layout/input/svg/abspos-svg-polygon.html
Normal file
|
@ -0,0 +1 @@
|
|||
<!DOCTYPE html><div style="position: relative"><svg width="200" height="200"><polygon points="100,10 40,180 160,180" style="position:absolute; top: 100px; left: 100px;" />
|
|
@ -1222,6 +1222,11 @@ StaticPositionRect FormattingContext::calculate_static_position_rect(Box const&
|
|||
|
||||
void FormattingContext::layout_absolutely_positioned_element(Box const& box, AvailableSpace const& available_space)
|
||||
{
|
||||
if (box.is_svg_box()) {
|
||||
dbgln("FIXME: Implement support for absolutely positioned SVG elements.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto& containing_block_state = m_state.get_mutable(*box.containing_block());
|
||||
|
||||
// The size of the containing block of an abspos box is always definite from the perspective of the abspos box.
|
||||
|
|
Loading…
Reference in a new issue