W3C home > Mailing lists > Public > public-fx@w3.org > July to September 2013

Re: [css-images][css-compositing] Blurring an elementís backdrop

From: Rik Cabanier <cabanier@gmail.com>
Date: Thu, 19 Sep 2013 16:05:23 -0700
Message-ID: <CAGN7qDBsWN_C18=f32SWMEyx+=e_+Z15wQX-ZE3+K_7Xz+YZWQ@mail.gmail.com>
To: Dean Jackson <dino@apple.com>
Cc: Dirk Schulze <dschulze@adobe.com>, Lea Verou <leaverou@gmail.com>, "public-fx@w3.org" <public-fx@w3.org>, www-style list <www-style@w3.org>
On Thu, Sep 19, 2013 at 11:19 AM, Dean Jackson <dino@apple.com> wrote:

>
> On 19 Sep 2013, at 11:01 am, Rik Cabanier <cabanier@gmail.com> wrote:
>
> So, here is where it gets tricky. Background/drop filtering is quite
>> expensive, and sometimes extremely expensive in some compositing set ups.
>> In the worst case a browser will have to draw the tree twice, possibly
>> reading back pixels before applying the effect. And that could be per
>> element that has a filter. We can define isolation groups to make this
>> easier, but this will be quite difficult to understand.
>>
>
> Well, we're already there with CSS filters and blending:-)
>
>
> Yes. But this is why weíre hesitant to add blending even though it would
> be extremely useful.
>

Stacking contexts are indeed hard to grock for authors.
I wish there was a way to clearly show them in the inspector to make them
less surprising. z-index for instance gets complex very quickly.

If authors use tools like Photoshop or Illustrator, they should already
familiar with the concept of group isolation. So, if the tools improve and
we can

As you point out, the advantage of having just blending within your parent
is better performance. (Flash for instance had the same limitation so it
could speed up rendering)
At a later point, the 'isolation' property will be extended so we can
implement the natural non-isolated model. [1]


>
> Itís quite funny really. Typically in these standards discussions we
> mostly understand how to implement and spend all our time arguing over the
> way to expose it to CSS/HTML/JS/etc. In the case of blending and backgdrop
> filters, the exposition is pretty uncontroversial - itís the implementation
> details that are difficult and which either severely limit or confuse the
> feature.
>

I agree.


>
>
>> In our experimentation itís quite confusing that changes in sibling
>> elements or random properties can trigger a situation where the background
>> becomes difficult to obtain or radically slower.
>>
>> Window servers often do these effects with tricky hacks. Their content is
>> also nowhere near the complexity that a Web page can be.
>>
>> I guess Iím saying that, like blending/compositing, Iíd really love to
>> expose this, but it could be a pain to implement and difficult to author.
>
>
> Would it be possible to implement this practically on Safari? I thought
> there was an API to do apply a filter during compositing but I can't find
> it in the documentation.
>
>
> Sure itís possible. But the question is whether or not it is practical.
> Iíd really like to expose this feature but I think it needs a bit of
> experimentation first.
>
> BTW, I think youíre looking for CALayer.backgroundFilters [1].
>

Yes. Thanks!


>
> Two things of note:
>
> - "Typically this content belongs to the superlayer that acts as the
> parent of the layer.Ē This explains why itís tricky in CSS. This feature is
> asking to apply an effect to *all* the content behind the element, not just
> its parent. (Also, due to complexities in CSS, an elementís parent in the
> compositing tree might not be itís direct DOM parent).
>

Yes. that's how the blending spec defines it too.


>
> - This does not apply on iOS (like I said, the window server does special
> magic to achieve the effect)
>
>
1: http://dev.w3.org/fxtf/compositing-1/#isolation
Received on Thursday, 19 September 2013 23:05:54 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:49:46 UTC