Open Bug 1732780 Opened 3 years ago Updated 3 years ago

SVG viewbox doesn't affect min/max/pref size

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect, P3)

defect

Tracking

()

People

(Reporter: emilio, Unassigned)

References

Details

Attachments

(2 files)

Attached file Testcase

See attached test-case. This causes one test failure after bug 1732759, but because we were not parsing fit-content properly.

I haven't quite dug if this is right or wrong, but it's definitely different from Chromium.

Attachment #9243116 - Attachment mime type: text/plain → text/html

Yeah, there are some known compat issues around intrinsic sizing for SVG elements that lack an intrinsic size but have a viewBox.

IIRC we treat the viewBox as providing an intrinsic aspect ratio but not providing any intrinsic dimensions. So we end up treating this SVG image as having an intrinsic width and height of 0.

Attached file testcase 2

simplified the testcase a bit, and added a section with *-available (which is stretch from css-sizing-4).

It sort of looks like Chromium is doing "stretchy" behavior for all of the supposedly-content-dependent keywords, which seems wrong. In contrast, we're behaving as if the content were 0-sized, but will happily grow to fill the containing block if given a sizing keyword that prompts that behavior. Or something along those lines...

Changing severity to S3 because it seems a long-standing behavior different and we're not aware of it causing compat issues in the wild.

Severity: -- → S3
Priority: -- → P3
See Also: → 1521882
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: