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

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

From: Brian Manthos <brianman@microsoft.com>
Date: Tue, 20 Sep 2011 21:04:58 +0000
To: Tab Atkins Jr. <jackalmage@gmail.com>
CC: "www-style@w3.org" <www-style@w3.org>
Message-ID: <9710FCC2E88860489239BE0308AC5D17169A82@TK5EX14MBXC266.redmond.corp.microsoft.com>
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.


-----Original Message-----
From: Tab Atkins Jr. [mailto:jackalmage@gmail.com] 
Sent: Tuesday, September 20, 2011 1:34 PM
To: Brian Manthos
Cc: www-style@w3.org
Subject: Re: [cssN backgrounds] background-repeat: extend;

On Tue, Sep 20, 2011 at 1:26 PM, Brian Manthos <brianman@microsoft.com> wrote:
> So it sounds like it should live here, if you can convince Elika and Hakon.
> http://dev.w3.org/csswg/css4-background/


Yup.


> "This never happens with raster images"
> Why?  It seems totally reasonable for it to happen for raster images.
>
> More specifically why should these two examples behave in a fundamentally different way...
>
> background-image: url('sprites.svg#xywh=10,30,60,20');
> background-image: url('sprites.png#xywh=10,30,60,20');
>
> ... when married with "background-repeat: extend;"?

Hmm, I hadn't thought of MF in relation to this.  That might work,
sure.  On the other hand, MF are supposed to actually represent the
fragment itself.  I could go either way on whether it's semantically
valid, but if it is, then it would totally work.


> Also, there are cases where it would be useful to have the edge pixels be spread to fill the remaining space rather than to leave that region unpainted.  Like the attached.

I don't know if I'd call that "useful".  ^_^  But also, that would be
a very particular interpretation for what lies "beyond the concrete
object size" of raster images.

~TJ

Received on Tuesday, 20 September 2011 21:05:30 GMT

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