While this does exist (and is supported) as media feature already, browsers started to support it as regular CSS property as well: https://developer.mozilla.org/docs/Web/CSS/aspect-ratio
In Chromium 88 at least it does not needs to be enabled explicitly anymore but works OOTB according to my tests, so MDN web docs (while writing this) is outdated about this point.
With this it is e.g. possible to set both dimensions of an image relative to the parents width, preserving the aspect ratio of the image, even if the resource is not available or has not yet been loaded:
width: 100%
aspect-ratio: 16/9