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

Re: 'border-image' confusion

From: Brad Kemper <brad.kemper@gmail.com>
Date: Mon, 7 Feb 2011 08:26:36 -0800
Cc: Simon Fraser <smfr@me.com>, "Eric A. Meyer" <eric@meyerweb.com>, "www-style@w3.org" <www-style@w3.org>
Message-Id: <1318F404-AACB-42F7-A114-281150ED65B0@gmail.com>
To: Tab Atkins Jr. <jackalmage@gmail.com>

On Feb 6, 2011, at 9:10 PM, Tab Atkins Jr. wrote:

> On Sun, Feb 6, 2011 at 3:41 PM, Simon Fraser <smfr@me.com> wrote:
>> On Feb 6, 2011, at 12:25 PM, Brad Kemper wrote:
>>> On Feb 6, 2011, at 10:12 AM, Simon Fraser <smfr@me.com> wrote:
>>>> I think there's also a valid use case for a single border-image that gets stretched, un-tiled, to the border box size, with the center clipped out. This would give us the ability to use a gradient image here, thus fulfilling the gradient border request.
>>> 
>>> Shouldn't that happen anyway with gradients? Since they are dimensionless, they should automatically stretch to the full dimensions of the border box & outsets, prior to slicing. At least, that is my expectation.
>> 
>> I actually have no idea how a gradient should respond to slicing for border-image. WebKit has bugs, but I'm not sure what the expected behavior is.
> 
> A gradient is an image, and once it's used, it has a definite size.
> It should act exactly like any other image of that size.  There's no
> magic behavior here.

Actually, I'm not seeing anything in Backgrounds & Borders 3 that says how to dimension an image that has no intrinsic dimension. It should be the same size as the border image area[1]. Maybe we need to say that somewhere, or say it more explicitly if it is implied in there somewhere and I'm just missing it. 

Because it is the same size as the border image area, the value of 'border-image-repeat' doesn't matter, as the sides will fit exactly, with no distortion, as long as 'border-image-slice' and 'border-image-width' are describing the same-size areas.

I have a concern about 'border-image-slice'. It doesn't seem to say anything about images without intrinsic dimensions if a <number> is the value. The spec says that "Numbers represent pixels in the image (if the image is a raster image) or vector coordinates (if the image is a vector image)." I don't think that gradients have vector coordinates, and counting pixels from all four sides also doesn't make sense. I think that what would make the most sense for dimensionless images (such as border-image-width) is to make any 'border-image-slice' <number> or <percentage> ignored, and just make it automatically the same as 'border-image-width'.






1. http://dev.w3.org/csswg/css3-background/#border-image-area
Received on Monday, 7 February 2011 16:27:14 GMT

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