NEW 194815
SVG Image intrinsic size should be used if css style size is 'auto'
https://bugs.webkit.org/show_bug.cgi?id=194815
Summary SVG Image intrinsic size should be used if css style size is 'auto'
Frédéric Wang (:fredw)
Reported 2019-02-19 02:37:14 PST
"The CSS width and height properties are used for sizing some SVG elements. Specifically, they are used to size ‘rect’, ‘svg’, ‘image’ and ‘foreignObject’. All of these elements have ‘width’ and ‘height’ presentation attributes. The properties are also used for laying out embedded elements from the HTML namespace. " "The value auto for width and height on the ‘image’ element is calculated from the referenced image's intrinsic dimensions and aspect ratio, according to the CSS default sizing algorithm." (https://www.w3.org/TR/SVG2/geometry.html#Sizing) " A value of zero for either width or height disables rendering of the element and its embedded content. The 'auto' value for width or height is used to size the corresponding element automatically based on the intrinsic dimensions or intrinsic aspect ratio of the referenced resource. Computation of automatically-sized values follows the Default Sizing Algorithm defined for replaced elements in CSS layout [css-images-3]. In particular, when the referenced resource does not have an intrinsic size (such as an ‘iframe’ or an image types with no defined dimensions), it is assumed to have a width of 300px and a height of 150px." (https://www.w3.org/TR/SVG2/embedded.html#Placement) Essentially we should port Chromium's change: https://codereview.chromium.org/2230963002 https://bugs.chromium.org/p/chromium/issues/detail?id=493681
Attachments
Tentative Patch (4.32 KB, patch)
2019-02-21 07:15 PST, Frédéric Wang (:fredw)
no flags
Frédéric Wang (:fredw)
Comment 2 2019-02-21 07:15:16 PST
Created attachment 362604 [details] Tentative Patch Just trying to import https://chromium.googlesource.com/chromium/src.git/+/3c1a3822848d986337573cfaf2817c8a69417791 and align with Chromium. https://w3c-test.org/svg/geometry/svg-image-intrinsic-size-with-cssstyle-auto.html already times out without the patch applies, so there might be something wrong in WebKit's implementation.
Radar WebKit Bug Importer
Comment 3 2024-02-08 15:15:36 PST
Note You need to log in before you can comment on or make changes to this bug.