Open Bug 1694295 Opened 5 years ago Updated 5 years ago

What is an SVG's min-content contribution without a specified width

Categories

(Core :: SVG, defect)

defect

Tracking

()

People

(Reporter: TYLin, Unassigned)

Details

Attachments

(1 file)

After fixing bug 1674302, https://webcompat.com/issues/55006 can reduce to the following question: what is an SVG's min-content contribution without a specified width?

See the testcase attached. We get 0px where Google Chrome get 150px.

That svg element is a replaced element so it should follow the rules for replaced elements. 150px is the fallback size for replaced elements when their width cannot be determined as in this case.

https://drafts.csswg.org/css-sizing-3/#auto-box-sizes says

min-content
    Use the min-content size in the relevant axis; for a box’s block size, unless otherwise specified, this is equivalent to its automatic size.

That seems at first glance to point to 0 as being the correct answer per https://drafts.csswg.org/css-images-3/#natural-dimensions since the svg in this case has no natural dimensions, not even a preferred aspect ratio as it's lacking a viewBox.

Not sure the specs are very clear here though.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: