Re: css-shapes] Comments on CSS Shapes ED

On 9/13/13 2:36 PM, "Håkon Wium Lie" <howcome@opera.com> wrote:

>Alan Stearns wrote:
>
> > > - we should base runaround shapes on the actural rendered content,
> > >   not external resources.
> > 
> > I agree that this should eventually be supported, and I believe the
> > correct way of supporting this is by using the element() function when
>it
> > becomes a widely-supported <image> value.
>
>What would the syntax look like?

I don't yet have a proposal for this. I've been monitoring the development
of element() to see when it would be appropriate to start thinking of how
it would be used in this context. As far as I can tell, it's still too
soon.

>
> > The shape-outside property can be used for all of the proposed
> > shape-generating mechanisms, and I'd prefer a single property than
>several
> > one-off properties that accomplish the same thing.
>
>I'm not sure what you're referring to here -- in my proposal I don't
>use any properties to find external resources.

In your proposal, you have a property (exclude-level) that only works on
rendered contours. It would not be extensible to include basic shapes or
external resources. The shape-outside property can be used for all of
these cases. I think we should have one property that can determine the
shape used for wrapping around floats, extensible through additional value
types.

> > 
> > Wrapping around an initial cap does not require a tight wrap against
>the
> > rendered content (in most cases, that would be something to avoid). The
> > detail in a glyph will in most cases be much more fine than the size of
> > the line boxes being wrapped. So using a basic shape to suggest the
> > general shape of a glyph just works [1]. Describing a circle with a
>radius
> > somewhat larger than the drop cap line-height for wrapping around an
>'O'
> > or a 'D' doesn't require a tool.
>
>But it's easier for authors if they don't have to specify rules at all,
>no?

In the case of wrapping around an 'O' you'd either need to:

1. Turn on wrapping around rendered contours
2. Specify an offset (because tight wrapping isn't good)

Or

1. Describe a circle that includes the 'O' with enough padding

We can argue over which is simpler, and which we should do first, but I
think both should eventually be supported.

>
> > The example you link to was produced with
> > a simple 4-sided polygon coded by hand, and in this case I think the
> > straight edge to wrap around is preferable to having the first line
> > shortened further by the serif on the 'y'.
>
>So, what would your code look like that would produce this example?
>
>  http://dev.w3.org/csswg/css-page-floats/exclusions-dropcap.png

That's my example, you know.

I described a four-sided polygon using percentages of the float's width,
with a diagonal right side. While the diagonal from the shape does not
match the diagonal of the glyph, it looked good enough for you to have
copied it into your spec :)

>
>
> > >I also think that:
> > >
> > >  - if there is an alpha channel available in the image, it makes
> > >    sense to use it. Perhaps the switch could be automatic: if alpha
> > >    is available, use it; otherwise use the luminence.
> > 
> > For the security implications of wrapping around image data, I think
>it's
> > better to have a separate property where we can limit access to the
>alpha
> > or luminance data.
>
>But the luminance is in the image, no? If you restrict access to the
>luminance you don't have an image.
>
>Also, I don't understand the security implications for alpha data. PNG
>images routinly has alpha channels in them and I don't see whey this
>is dangerous.

I did not understand the implications either, at first. We discussed the
issue in Tokyo. While you can fairly promiscuously display an image with
its alpha data on a web page, what you don't get is scripted access to the
data. For the same reason that cross-origin images can taint a Canvas such
that you cannot retrieve the pixel information, you should not be able to
use shape-outside on untrusted pages to use cross-origin images. You can
wrap arbitrarily-small text lines around the shape, allowing scripted
access to the alpha data contours. Combined with filters that map
arbitrary image data to the alpha channel, you'd get scripted access to
all of the pixel data. It's that scripted access that we need to avoid
exposing.

Thanks,

Alan

Received on Friday, 13 September 2013 13:22:08 UTC