This is because the rules in the table in section 10.4 of CSS 2.1 only
apply when width and height are auto (which we already tested) and when
the image has an intrinsic ratio (which we did not).
I had hoped to simplify the code further, but there are tricky ordering
dependencies that make it hard to do. (In particular, in the branches
for one dimension auto and one non-auto, the non-auto dimension is
computed first.)