Re: [csswg-drafts] [css-backgrounds] background-size: cover spec seems to not reflect implementations (#4049)

I don't see the problem with your example:  In order to cover the 100px width of your (zero-height) content box, the image is being scaled to 100px wide.  If you make both width _and_ height 0, then other browsers show nothing.  Similarly, if you set the image size to `contain` (and keep one dimension 0), then it gets scaled down to nothing in the other browsers, as well.

We certainly can't change the "cover" reference box in the general case of a valid-sized content-box; there is nothing broken in that situation.

I'd say that this—not drawing a cover-sized image if one dimension of the reference box is 0—is a Firefox bug. (Sorry.)

The only real edge case, to me is what to do with _repeats_ of a scaled-to-zero image. But that's something that needs to be dealt with regardless of how the base image size is computed.  And the last paragraph of the [`background-size` spec](https://drafts.csswg.org/css-backgrounds/#background-size) gives the rule: if the used image size is zero for either width or height, then the image is treated as a transparent layer. My guess is that the Firefox code is checking for this zero value a little too soon in the case of `cover` sizing.



-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4049#issuecomment-504600187 using your GitHub account

Received on Friday, 21 June 2019 23:10:00 UTC