Re: Border-Images and 'round': CSS Backgrounds and Borders Module Level 3

On Mon, Sep 28, 2009 at 12:27 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
> On Sep 28, 2009, at 10:05 AM, Tab Atkins Jr. wrote:
>>> 2) when the "repeat" keyword is used with border-image, that the
>>> left-over
>>> space be distributed between and around the tiles, instead of just on the
>>> ends of the row of abutting tiles.
>>
>> I don't like this.  I think the current behavior makes sense and is
>> most closely analogous to 'repeat' in backgrounds.
>
> Backgrounds don't need to be symmetrical the way border image sides do.
> Background images can get clipped in ways that border image tiles do not. So
> the "create a row of tiles and then add space to the ends to center them"
> idea is not that close to what background images do.
>
> I don't see the need to be slavishly consistent with how backgrounds tile,
> just because of the re-use of the same keyword. Is there any other
> advantage, other than just "that's closer to how background tiling works"?
> Or are you saying there is some advantage because you could get the
> background-image tiles to line up with the border-image tiles?

That is indeed the major advantage I was thinking of.  You can just
set the background to 50% and tile it, and it'll automatically match.
Plus, hey, clustering as many copies as will fit into the center is
still a nice visual effect, distinct from what you get by distributing
the space.

>>> 3) that the wording of the "position" step of the drawing process be
>>> changed, so that it doesn't talk about how the tiles are aligned
>>> (centered,
>>> left, etc.), since "stretch" and "round" would not produce different
>>> results
>>> based on alignment, and neither would "repeat" if #2, above, is adopted.
>>
>> Actually, the current wording makes sense, since the tiling doesn't
>> occur until later.  'stretch' could conceivably be left-aligned (it
>> doesn't matter at all), but 'round' *would* produce a different visual
>> effect if the image was centered before tiling - what if you had an
>> even number of copies?
>
> I don't know what you mean. In what space is the image centered before
> tiling? Doesn't "round" cause the image to be resized in one dimension until
> it fits perfectly and leaves no left over space? How does odd or even number
> matter? Am I completely misunderstanding what "round" is supposed to do?

It's centered in the border-image area, and then drawn/tiled in the
step after that.  So, if you have a 200px wide box, and a 120px wide
image, round will downscale it to 100px wide.  How it is supposed to
work if you then center the 100px-wide image before tiling it?  You'd
only have 50px to either side.

(If you center the group of tiled images, it of course works, because
there's nothing to center - the group fills the space perfectly by
design.  But that's not how the algorithm works.)

~TJ

Received on Monday, 28 September 2009 17:44:14 UTC