Re: [css-compositing] why general blending is confusing

On Oct 12, 2013, at 3:00 AM, Dean Jackson <dino@apple.com> wrote:

> As Adobe and Apple were looking into implementing blending in WebKit, we’ve exposed
> a pretty good example of why it’s both tricky to implement and can produce unexpected
> results (especially in today’s compositors).
> 
> Example file: https://bug-99200-attachments.webkit.org/attachment.cgi?id=214039
> Screenshot: https://bug-99200-attachments.webkit.org/attachment.cgi?id=214040
> 
> Basically the issue is that you can only blend with your parent layer, and 
> whether or not your parent has a layer is not so easy to plan around. In the example
> I’m difference blending a vertical orange -> blue gradient over a horizontal
> rainbow.
> 
> 1. Just the rainbow parent.
> 2. Rainbow parent plus child with no blending
> 3. Rainbow parent with child that does a difference blend
> 4. Same as 4 but parent has a translateZ(0)
> 
> Notice that in 4, the child does NOT blend outside its parents bounds. That’s
> because it doesn’t have any background pixels to blend with at that point. Sure, the
> translateZ(0) forced a stacking context (compositing layer) on the parent, but
> this could have happened for a number of reasons - e.g. a sibling of the parent
> having a hover effect that triggered compositing.
> 
> I’m not sure there are any good ways around this without accumulating buffers
> (potentially prohibitively expensive), and even then things like animations
> and media will make it harder.
> 
> We might be stuck with background blending, and possibly controlling how element
> content blends directly into its background (have we investigated that? it would
> allow for things like text blending over an image background, which seems
> pretty common)

>From what you describe this is exactly the behavior that we agreed on to the last two F2F meetings. The behavior that you describe as "parent layer" is described as isolation to the next stacking context. I would not say that this is confusing. It is something that you can experience with isolation in other graphic applications as well. In future levels we get a new property value for 'isolation' that allows authors to blend with the whole backdrop, but first browsers need to catch up.

Greetings,
Dirk

> 
> Dean
> 
> 

Received on Saturday, 12 October 2013 06:16:23 UTC