Re: [css-backgrounds] border-image with an SVG resource that has no intrinsic size

> On Jun 17, 2015, at 12:02 AM, David Vest <davve@opera.com> wrote:
> 
> It doesn't suggest doing it by default until we hypothetically
> introduce new top-level element for SVG though (see issue 6). Probably
> because of compatibility reasons but there may be other details here.
> 
>>> and what effect should that have in this case?
>> 
>> This would mean that in your examples:
>> 
>> #1) intrinsic size=100x100 based on green rect, therefore ratio=1:1
>> #2) no intrinsic size or ratio, fills border image area
>> #3) intrinsic size=100x100 based on viewbox (or based on green rect, if using viewbox that way is somehow illegal), ratio=1:1
>> #4) intrinsic size=100x100, therefore ratio=1:1
>> #5) no intrinsic size or ratio, fills border image area. This gives it a concrete size of 200px in both dimensions, so the slices are 33% of that (66px) all the way around.
> 
> I we had such a fallback it would be another matter I agree. But we
> don't, AFAICT.

What harm does it do to allow this, at least in regard to to how SVG images are consumed by CSS? Clearly no one is depending on existing weird rendering of some of these cases in border-image, and probably not in 'list-style-image' or 'content' or 'background-image' either. 

In any case, I think my original point stands about the incorrectness of your statement (in the google docs thing you published) that "this basically means what the image draws has no relation to the image slices." The rendering that follows that statement does not seem to follow the default sizing algorithm. If there is no intrinsic size or ratio, it's size should be "resolved as a contain constraint against the default object size" (last line off the algorithm in 5.3.1). That means that if there is no ratio either, then the object should be the same size as the border image area.

Not having an intrinsic size or ratio doesn't mean you don't know where or how big to draw the image. If such an image is drawn by itself, and has contents that are 100% x 100% it fills up the window. For border-image, it should similarly fill up the border image area. 

Even if not 100% x 100% in the contents, it should do the same thing to the base "svg" element, because that is what is supposed to happen in CSS when the image has no intrinsic size or ratio. The contents wouldn't resize if they have fixed height and weight (assuming for the sake of this argument that SVG won't let you derive size and ratio from the contents). But it should be at though the was a height="100%" and width="100%" on the base "svg" element, since that is the effect of the default sizing algorithm. It's not useful for a lot of images to be used in border-image, perhaps, but it does give you a concrete size. 

With the concrete size, you can then compute percentage-based border-image-slice too. 

Is there something in css3-image or backgrounds that needs to be more clear about this?

Received on Wednesday, 17 June 2015 16:05:26 UTC