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: Brad Kemper <brad.kemper@gmail.com>
Date: Tue, 16 Jun 2015 17:27:41 -0700
Cc: Florian Rivoal <florian@rivoal.net>, Dean Jackson <dino@apple.com>, www-style list <www-style@w3.org>
Message-Id: <DB2FF610-ABC8-48EA-A2A0-77280124BDEB@gmail.com>
To: David Vest <davve@opera.com>
On Jun 16, 2015, at 12:53 AM, David Vest <davve@opera.com> wrote:
>> On Mon, Jun 15, 2015 at 9:49 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
>>> On Jun 15, 2015, at 4:51 AM, David Vest <davve@opera.com> wrote:
>>> 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?
>> I think the diagram that follows "we end up with a case like this" is incorrect. If the border image area is used as the default object size, then the bounding box dimensions of the svg should be stretched to be contained within the border image area, without distorting its intrinsic aspect ratio (which your example does seem to have).
> Thanks for the feedback

My pleasure.

> but first, what do you mean by "bounding box dimensions of the svg"

OK, so, I am no SVG expert (far from it). But it looks to me (and feel free to correct me, and I'm probably overgeneralizing) that your examples are based on the idea that if the SVG element itself has width and height, then those are intrinsic sizes. And that if it has a viewbox, then that gives it an intrinsic ratio. I don't really understand how the width and height don't also imply a ratio, or why the viewbox doesn't imply a width and height, but that's maybe due to my general SVG ignorance.

What I am suggesting is that if there is no viewbox, and no width or height, then intrinsic dimensions should be derived from the bounding box containing the content paths and shapes (and their strokes, filters, etc.), and their position offsets from 0,0. If you have both dimensions, then you have a ratio too.

> 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.
Received on Wednesday, 17 June 2015 00:28:13 UTC

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