This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
What if an image need to fill a certain amount of space, i.e. a div container is of a particular size and the inner image should fill the maximum space (or a percentage) of the container without altering its aspect ratio. I suggest adding a "keepAspectRatio" or "preserveAspectRatio" attribute on img tag. When this attribute has "true" as a value, whatever width or height are set (either by setting width or height attributes or by setting them via CSS) the image will fill the maximum space it can inside this width and height preserving its aspect ratio.
This seems like something that CSS should be able to do already.
It is something already done by CSS. It is defined in [CSS Image Values and Replaced Content Module Level 3][1] and a [tutorial][2] for it. [1]: http://dev.w3.org/csswg/css3-images/ [2]: http://dev.opera.com/articles/view/css3-object-fit-object-position/
Mass move to "HTML WG"
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the Editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the Tracker Issue; or you may create a Tracker Issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Rejected Change Description: No spec change Rationale: As noted, CSS provides the requested functionality.