W3C home > Mailing lists > Public > www-style@w3.org > July 2013

Re: [css-shapes] Using the rendered element as image source

From: Alan Stearns <stearns@adobe.com>
Date: Thu, 11 Jul 2013 12:00:35 -0700
To: François REMY <francois.remy.dev@outlook.com>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <CE04440D.3C541%stearns@adobe.com>
On 7/11/13 9:07 AM, "François REMY" <francois.remy.dev@outlook.com> wrote:

>While I was reviewing the css-shapes spec, I came accross this sample
>{see below} that I believe isn't very good practice because it's actually
>mixing content and styling by replicating the image source in the CSS
>styling.
>
...
>
>Wouldn't it be a good idea to support
>
>  <style>
>    #CSSlogo {
>      float: left;
>      shape-outside: from-rendering; // and also "from-background"
>      shape-image-threshold: 0.1;
>      shape-margin: 35px;
>    }
>  </style>
>
>? 
>
>Are there perf issues or particular circular dependencies that make that
>hard to implement?

We've talked before about adding keywords [1]. Your 'from-rendering' is
actually a next-level feature that we've discussed that could work on any
element, not just an image (though this has security implications). I
think I'd like to have an 'image' keyword that would use the alpha shape
as actually rendered given whatever image sizing and placement occurs.
This would have to be tied to the upcoming security model so that it would
only work when we can be trusted to use the image data. Adding a
'background' keyword to use the alpha data from a rendered background
could be a next step.

>
>
>_________________________
>
>PS: I envision "shape-inside: from-background" to be quite popular when
>"shape-inside" will become supported.
>
>PS2: Shouldn't "shape-margin" and "shape-image-threshould" be correctly
>namespaced as "shape-outside-margin" and
>"shape-outside-image-threshould"? 		 	   		

The margin only applies to shape-outside, so there's no need for
inside/outside duplication. The image-threshold might need to be split, if
there are use cases for an element having both a shape-inside and a
shape-outside, and wanting to use different thresholds for each. My
thought is that it is much more likely that a single threshold would be
used with different shape-margin and shape-padding.

Thanks,

Alan

[1] http://lists.w3.org/Archives/Public/www-style/2013Jun/0292.html
Received on Thursday, 11 July 2013 19:01:01 UTC

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