Calculate img/video aspect ratio from width and height HTML attributes

# Frédéric Wang (3 days ago)


In [1], we will try and make WebKit rely on the width and height HTML attributes of the <img> and <video> elements in order to determine their

aspect ratio, so that it can be used for sizing the image using CSS, before the content loads.

HTML and CSS standardization groups already reached consensus on this proposal [2] and there are WPT tests for it. Moreover this is already shipped in Gecko [3] and Chromium [4].

[1] [2] WICG/intrinsicsize-attribute#16 [3]!msg/ [4]!searchin/blink-dev/Compute$20img$2Fvideo$20aspect$20ratio$20from$20width$20and$20height$20HTML$20attributes%7Csort:date/blink-dev/GePU9T8UpEc/uQWhDZeODwAJ

Contact us to advertise here

Want more features?

Request early access to our private beta of readable email premium.