W3C home > Mailing lists > Public > www-style@w3.org > September 2011

Re: [cssN backgrounds] background-repeat: extend;

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 20 Sep 2011 15:55:32 -0700
Message-ID: <CAAWBYDAq+G0BnsT1z6R+4tV0nL5W8seDhqcdUsA2Z5Q-n_Q2SQ@mail.gmail.com>
To: Brian Manthos <brianman@microsoft.com>
Cc: "www-style@w3.org" <www-style@w3.org>
On Tue, Sep 20, 2011 at 3:33 PM, Brian Manthos <brianman@microsoft.com> wrote:
> From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
>> On Tue, Sep 20, 2011 at 2:04 PM, Brian Manthos <brianman@microsoft.com> wrote:
>>> Ok, let me give you a simpler example.
>>>
>>> Why should these render differently?
>>>
>>> div {
>>>        width: 500px;
>>>        height: 500px;
>>>        background-size: 50px 50px;
>>>        background-repeat: extend;
>>> }
>>> div:nth-child(1) {
>>>        background-image: radial-gradient(cover, red, blue);
>>> }
>>> div:nth-child(2) {
>>>        background-image: url(radial-gradient-cover-red-blue.png);
>>> }
>>>
>>> For browsers and platforms that support "background-repeat: extend;" (someday) but can't or won't support radial-gradient, this would be a very useful consistency to have in CSS.
>>
>> I'll assume you meant 'contain' on the radial-gradient(), because
>> otherwise the answer is trivial.
>>
>> There's no particular reason for them to render differently, but
>> neither is there any particular reason for them to render the same.
>> I'm ambivalent on the matter.
>
> No, I meant cover.  Contain is a much simpler case that can be simulated with a solid background-color outside the image rect.

Oh, well then that's a very simple answer.  The browser has no idea
that the jpg is of a radial gradient, and can't possibly extrapolate
in the same way that it can with the radial-gradient() function.

~TJ
Received on Tuesday, 20 September 2011 22:56:19 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:44 GMT