W3C home > Mailing lists > Public > www-style@w3.org > June 2015

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

From: David Vest <davve@opera.com>
Date: Mon, 15 Jun 2015 13:51:05 +0200
Message-ID: <CAHsiBXv-ZBTdQb+r7mZfMRTO_eu58rrxDbuQ3-KCO6w_fjjCPw@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: Florian Rivoal <florian@rivoal.net>, Dean Jackson <dino@apple.com>, www-style list <www-style@w3.org>
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


> 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
essentially ending up with favoring not drawing anything in the case
when there is no intrinsic dimensions at all. WDYT?

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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:54 UTC