RESOLVED FIXED273759
SVGs with absolute positioning are incorrectly sized when ancestor has padding
https://bugs.webkit.org/show_bug.cgi?id=273759
Summary SVGs with absolute positioning are incorrectly sized when ancestor has padding
Matt Moran
Reported 2024-05-06 02:11:39 PDT
Created attachment 471289 [details] Example file to reproduce bug SVGs with absolute positioning are incorrectly sized when ancestor has padding. There are two symptoms demonstrated in the attachment: 1. When I have an div that has `width: 200px; padding: 20px`, a child SVG with `position: absolute; left: 0; right: 0` has a width that matches the div's content width when it should match the div's padding width. 2. When I have an absolutely positioned div that has `padding: 20px` and a computed height of 200px, a child SVG with `position: absolute; height: 100%` has a height that matches the div's content height when it should match the div's padding height. Chrome and Firefox do not have this bug.
Attachments
Example file to reproduce bug (938 bytes, text/html)
2024-05-06 02:11 PDT, Matt Moran
no flags
Screenshot of current layout in Safari (67.04 KB, image/png)
2024-05-06 02:14 PDT, Matt Moran
no flags
Screenshot of current layout in Chrome (67.68 KB, image/png)
2024-05-06 02:15 PDT, Matt Moran
no flags
Screenshot of current layout in Firefox (71.18 KB, image/png)
2024-05-06 02:16 PDT, Matt Moran
no flags
Matt Moran
Comment 1 2024-05-06 02:14:27 PDT
Created attachment 471290 [details] Screenshot of current layout in Safari
Matt Moran
Comment 2 2024-05-06 02:15:51 PDT
Created attachment 471291 [details] Screenshot of current layout in Chrome
Matt Moran
Comment 3 2024-05-06 02:16:13 PDT
Created attachment 471292 [details] Screenshot of current layout in Firefox
Radar WebKit Bug Importer
Comment 4 2024-05-06 09:47:01 PDT
Taher
Comment 5 2025-09-15 15:12:02 PDT
EWS
Comment 6 2025-09-16 15:32:49 PDT
Committed 300054@main (f8ed5934eb9e): <https://commits.webkit.org/300054@main> Reviewed commits have been landed. Closing PR #50771 and removing active labels.
Ahmad Saleem
Comment 7 2025-11-13 19:56:28 PST
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/56028
Note You need to log in before you can comment on or make changes to this bug.