W3C home > Mailing lists > Public > www-style@w3.org > April 2009

Re: [Backgrounds/Borders] What to do when a border-image fails to load

From: Brad Kemper <brad.kemper@gmail.com>
Date: Wed, 1 Apr 2009 10:30:22 -0700
Cc: www-style@w3.org
Message-Id: <4261AF63-57C2-4573-97AF-70A25262B44C@gmail.com>
To: "L. David Baron" <dbaron@dbaron.org>

On Apr 1, 2009, at 9:41 AM, L. David Baron wrote:

> On Sunday 2009-03-29 00:40 -0700, Brad Kemper wrote:
>> I written up a proposal that I think solves this problem, plus a  
>> couple
>> others that I think are even bigger for authors. I'd appreciate it if
>> everyone could take a look and let me know what you think. In the
>> following link, I describe three problems (including this one), and a
>> nice solution that I would love to see implemented:
>>
>> http://www.bradclicks.com/cssplay/border-image/Thinking_Outside_The_Box.html
>
> I think I like this proposal, except the piece I'm not sure about is
> the outside-the-border images part (the additional syntax that goes
> after the second slash).  I'm not sure how important that
> requirement is relative to the implentation costs of the extra piece
> of syntax and handling another case that can cause pieces of an
> element to appear outside the element's border box.  (Or, to put it
> another way, is the desire for things that stick out really specific
> to border-image, or is it just a general issue that ought to be
> solved by negative margins?)

Well, with a lot of decorative borders, there is a strong rectangular  
element and then things that stick out of it, so it fits well with  
this. Negative margins is more of a hack, in that they make the whole  
box bigger, when really it is just an issue with the border being in  
the wrong place.

Also, I don't like the idea of using different margins and padding and  
such than I would if images are not loaded or are turned off. Even  
during load time, if a whole box became wider and taller during the  
few seconds when large images loaded, that would look pretty bad, and  
maybe even obscure other content.

And thirdly, this would allow a background that still fit inside the  
box, even if bits of the border (with alpha transparency) stuck out  
into the margin or into other boxes.

Surely there are cases where using positioning or negative margins on  
some content will give a similar "breaking out of the grid" feel, but  
I don't think those fit as well as just putting the irregularly shaped  
border where you want it to fall along the grid-conforming,  
rectangular box.

> I presume that if the part after the first slash is omitted, the
> border image slices would still be resized as they are now to fit
> the 'border-width' property?

We were discussing this some in one of the follow-up messages.[1] It  
didn't seem like resizing the images based on the border-width was the  
right thing to do. It would be better if omitting the first numbers  
after the slash caused it to use 1 CSS pixel for every image pixel.  
That would be far more common for the way authors would use this.

In fact the second set of numbers is mainly useful for scaling to some  
other width (which would be much less common, and require a lot more  
authorial care to keep things proportional), or for specifying in non- 
pixel units (which would also create image scaling, sometime ugly). If  
I were to eliminate a group of numbers, it would be the second group,  
not the third group I proposed. I'd find the third group far more  
useful.



[1] like this one: http://lists.w3.org/Archives/Public/www-style/2009Mar/0403.html
Received on Wednesday, 1 April 2009 17:30:59 GMT

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