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

On Fri, May 29, 2015 at 11:49 PM, Brad Kemper <brad.kemper@gmail.com> wrote:

> So, I don't understand why safari and chrome are not drawing the green box
> in columns 1 and 3 of the example,

WebKit and Blink were buggy: See

https://bugs.webkit.org/show_bug.cgi?id=142650
https://code.google.com/p/chromium/issues/detail?id=493088

> or why the green box is shrunk is shrunk
> in the second column of the second row, since that green box does have have
> fixed dimensions. When I view the SVG by itself in a window, it first change
> size when I resize the window. Firefox seems to have all those as I'd
> expect.

It's shrunk because Blink and older WebKit tries to scale each piece
using the scale factor between image slice width and border-width (and
what's left in the middle). This do give strange and unexpected
results sometimes.

> But I can't explain why Firefox renders the last 2 example s of the 2nd row
> the way it does. I would expect the third one of the second row to be all
> green (20px sliced off edges of images and stretched into zero-width
> borders). I would expect the fourth one of the second row to be a red box
> with the green box (and the black border-box within it) in its upper left
> corner, as it is in Safari 8.06, since the border width and the slice width
> are the same.

When I try to come up with a reasonable explanation of this behavior I
end up with something like:

"Because the SVG doesn't have any particular size or a way to scale,
there is no way to place the image slices (no way to express 20 pixels
from right edge, because there is no right edge), so we might as well
paint each piece from origin unscaled."

When looking into the Blink bug related to this
https://code.google.com/p/chromium/issues/detail?id=492485 I wrote
https://docs.google.com/document/d/1OcebuhY45_RdLUCxXu1yKPYL3u4Pf1yrERqfbGNJwzE/edit?usp=sharing
essentially ending up with favoring not drawing anything in the case
when there is no intrinsic dimensions at all. WDYT?

David

Received on Monday, 15 June 2015 11:51:34 UTC