Re: Border-Images and 'round': CSS Backgrounds and Borders Module Level 3

Brad Kemper wrote:
> fantasai wrote:
>> Brad Kemper wrote:
>>>
>>> On Sep 29, 2009, at 7:44 PM, fantasai wrote:
>>>
>>>> Brad Kemper wrote:
>>>>> Does anyone remember why it is reduce-only? If it is a matter of the 
>>>>> tile losing resolution as it grows, I think that is more acceptable 
>>>>> for the smaller adjustments that may be needed that having much 
>>>>> larger adjustments required.
>>>>
>>>> It's reduce-only to avoid losing resolution, yes. Probably that 
>>>> restriction
>>>> should be lifted for vector images at least.
>>>
>>> At least. At worst, the raster image will be no worse that images with 
>>> the "stretch" keyword. If authors are concerned, they can build more 
>>> resolution into their source images, or have them scaled down in 
>>> 'border-image-width'.
>>>
>>> Or, alternately, we could favor reductions by having any space that 
>>> was less than say 25% of a tile size result in widening, and 
>>> everything else resulting in width reduction.
>> 
>> Ok, I've updated the spec to say this.  
>>   http://dev.w3.org/cvsweb/csswg/css3-background/Overview.src.html.diff?r1=1.167&r2=1.168&f=h 
>> Bert, do you agree with this change?
> 
> Those look like all good changes to me

Bert responded on IRC:

<Bert> B.t.w, fantasai, I don't think your latest edit to Backgrounds is
   correct. ceil() is better than round(), bcause it creates fewer raster
   artifacts. Moreover, you introduced a risk of incompatibility by allowing
   UAs to use different algorithms in unspecified cases.

I think it's a good point about the incompatibility, but I also think
it makes sense to use round() in the cases where there's no problem
with raster artifacts. Vector images and images with sufficiently
high resolution are such cases. At the very least we should allow this
for vectors.

How about I tighten up the text to use round() normally, but require
ceil() when there's a raster image with insufficient resolution?
Something like this?
   http://dev.w3.org/cvsweb/csswg/css3-background/Overview.src.html.diff?r1=1.172&r2=1.173&f=h
(I'm not sure if I should replace "device pixel" there with "1px".)
What do you think, Bert?

~fantasai

Received on Thursday, 1 October 2009 00:18:54 UTC