W3C home > Mailing lists > Public > public-fx@w3.org > January to March 2013

Re: Utility of background-composite and background-blend-mode?

From: Robert O'Callahan <robert@ocallahan.org>
Date: Wed, 6 Mar 2013 15:06:49 +1300
Message-ID: <CAOp6jLZS1YmNhB4Z30O4y0NzvuXixTbiMb_i+erKQ=aHdv8S=w@mail.gmail.com>
To: Rik Cabanier <cabanier@gmail.com>
Cc: public-fx@w3.org
On Tue, Mar 5, 2013 at 7:45 PM, Rik Cabanier <cabanier@gmail.com> wrote:

> If you follow the spec [1], each background image is drawn during the step
> '2. background image of element'. The background that is available for the
> blend operation at that time is everything up to an ancestor that created a
> stacking context.

Hmm. I see that the spec says "Everything in CSS that creates a stacking
context <http://www.w3.org/TR/CSS21/zindex.html> must be considered a
group." I don't like that. An ancestor that created a stacking context just
because it's absolute-positioned with z-index not 'auto' shouldn't impact
blending and shouldn't create an isolated group; it'll create a performance
penalty for existing Web content.

You also say "In SVG, every element must create a group. This seems costly
but implementations can optimize this by not treating elements with default
arguments as groups." You also need to check that the element doesn't
contain any descendants that use non-default blending. This can be done but
it could be costly.

BTW I noticed that you require clip-to-self behavior for compositing. This
is tricky because it means you have to define for everything that can be
rendered by CSS exactly what the clip-to-self shape is, and it's not always
obvious. For this reason we adopted non-clip-to-self behavior for canvas.

BTW^32 knockout groups are subtle and under-defined because an "element"
doesn't correspond one-to-one with actual drawing operations. For example,
if I have an element with a background, border and outline, all of which
overlap, does the border knock out the background? Does the outline knock
out the border? Note that there could be other content between the border
and the outline in z-order.

Getting back to the point of this thread: it seems to me that
background-composite and background-blend-mode are not that useful if we
have mix-blend-mode and mix-composite. You can do the same sorts of
effects, just with more markup. With Web Components and intelligent use of
pseudo-elements, you might not even need more markup. I think I'm still in
favour of eliminating background-composite and background-blend-mode.

Wrfhf pnyyrq gurz gbtrgure naq fnvq, “Lbh xabj gung gur ehyref bs gur
Tragvyrf ybeq vg bire gurz, naq gurve uvtu bssvpvnyf rkrepvfr nhgubevgl
bire gurz. Abg fb jvgu lbh. Vafgrnq, jubrire jnagf gb orpbzr terng nzbat
lbh zhfg or lbhe freinag, naq jubrire jnagf gb or svefg zhfg or lbhe fynir
— whfg nf gur Fba bs Zna qvq abg pbzr gb or freirq, ohg gb freir, naq gb
tvir uvf yvsr nf n enafbz sbe znal.” [Znggurj 20:25-28]
Received on Wednesday, 6 March 2013 02:07:17 UTC

This archive was generated by hypermail 2.3.1 : Monday, 22 June 2015 03:33:49 UTC