Intent to Deprecate and Remove: remove darker composite operator

132 views
Skip to first unread message

Dongseong Hwang

unread,
Dec 16, 2014, 10:52:43 AM12/16/14
to blin...@chromium.org

Primary eng (and PM) emails

dongseo...@intel.com


Summary

Remove darker composite operator


Motivation

1. Compositing spec [1] doesn't contain "darker" composite operator. [1] http://dev.w3.org/fxtf/compositing-1

2. "darker" is a quirk that is exclusive to WebKit.

3. "darker" composite operator is implemented in the same way to "darken" blend mode. So web developers can use "darken" instead of "darker".


Compatibility Risk

Only WebKit and Chromium support "darker", non-standard API.


Alternative implementation suggestion for web developers

Web developers can use "darken" blend mode for exactly same effect to current "darker" in chromium.

One thing worth to note is that chromium "darker" implementation has been wrong since "darker" was introduced. WebKit "darker" shows similar but different composition effect from chromium.


Usage information from UseCounter

Currently, 0.0002% of sites use "darker".

https://www.chromestatus.com/metrics/feature/timeline/popularity/577


Entry on chromestatus.com, crbug.com, or MDN


Requesting approval to remove too?

“Yes”

Justin Novosad

unread,
Dec 16, 2014, 11:33:25 AM12/16/14
to Dongseong Hwang, blink-dev
Sounds right to me.
With such tiny usage, I wonder if we should just skip deprecation and go straight to removal.

Dimitri Glazkov

unread,
Dec 16, 2014, 12:36:08 PM12/16/14
to Dongseong Hwang, blink-dev
LGTM.

Philip Jägenstedt

unread,
Dec 16, 2014, 5:48:43 PM12/16/14
to Dimitri Glazkov, Dongseong Hwang, blink-dev
LGTM2
> To unsubscribe from this group and stop receiving emails from it, send an
> email to blink-dev+...@chromium.org.

Chris Harrelson

unread,
Dec 17, 2014, 1:55:40 PM12/17/14
to Philip Jägenstedt, Dimitri Glazkov, Dongseong Hwang, blink-dev
LGTM3

PhistucK

unread,
Dec 19, 2014, 7:06:52 AM12/19/14
to Chris Harrelson, Philip Jägenstedt, Dimitri Glazkov, Dongseong Hwang, blink-dev
This is an intent to deprecate and remove - does that mean it is deprecated for some time (how much? based on what?) and then removed?

Justin suggested outright removing it and I think I support this. If this is outright removed, though, can this be merged to Chrome 40?

Unless I am mistaken, Chrome 40 ships "mix-blend-mode" which lets the developer specify "darker" as the mode. This should not be enabled in the first place and removed after one release.
I know "background-blend-mode" also uses this, so, obviously, the preferred way forward would be to either deprecate it there and not support it at all in "mix-blend-mode", or remove it from both of them.
Anyway, it should not be a supported value in "mix-blend-mode".


PhistucK

Dongseong Hwang

unread,
Dec 19, 2014, 7:46:57 AM12/19/14
to blin...@chromium.org, chri...@chromium.org, phi...@opera.com, dgla...@chromium.org, dongseo...@intel.com
Thank you for LGTM and @junov, thank you for clear direction.


On Friday, December 19, 2014 2:06:52 PM UTC+2, PhistucK wrote:
This is an intent to deprecate and remove - does that mean it is deprecated for some time (how much? based on what?) and then removed?

Thank you for careful consideration. IMO I'll remove it in canary, and keep eyes on whether developers complain as going on canary to beta to stable.
 
Justin suggested outright removing it and I think I support this. If this is outright removed, though, can this be merged to Chrome 40?

So it'll not be merged in Chrome 40.
 
Unless I am mistaken, Chrome 40 ships "mix-blend-mode" which lets the developer specify "darker" as the mode. This should not be enabled in the first place and removed after one release.
I know "background-blend-mode" also uses this, so, obviously, the preferred way forward would be to either deprecate it there and not support it at all in "mix-blend-mode", or remove it from both of them.
Anyway, it should not be a supported value in "mix-blend-mode".

Fortunately, "mix-blend-mode" and "background-blend-mode" can get only "blend-mode" as spec [1] defines. "darker" belongs to "composite-mode". Currently, only canvas's globalCompositeOperation and -webkit-background-composite can get "composite-mode". The usage of "darker" in canvas globalCompositeOperation is 0.002% and -webkit-background-composite is a quirk that is exclusive to WebKit and is replaced to "background-blend-mode".
So exposing "mix-blend-mode" and "background-blend-mode" without removing "darker" is totally fine.

PhistucK

unread,
Dec 19, 2014, 8:04:31 AM12/19/14
to Dongseong Hwang, blink-dev, Chris Harrelson, Philip Jägenstedt, Dimitri Glazkov
Oh, sorry. That is much clearer.

Please, make sure this kind of information is mentioned in future intents so we know where these values are actually used.


PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Dongseong Hwang

unread,
Dec 19, 2014, 8:19:43 AM12/19/14
to blin...@chromium.org, dongseo...@intel.com, chri...@chromium.org, phi...@opera.com, dgla...@chromium.org


On Friday, December 19, 2014 3:04:31 PM UTC+2, PhistucK wrote:
Oh, sorry. That is much clearer.

Please, make sure this kind of information is mentioned in future intents so we know where these values are actually used.

Yes, I'll. Sorry for confusing you.

Dimitri Glazkov

unread,
Apr 1, 2015, 7:36:10 PM4/1/15
to Dongseong Hwang, blink-dev, Chris Harrelson, Philip Jägenstedt
Sounds like this entry was never updated. This is shipping in M42, right?

:DG<

Dongseong Hwang

unread,
Apr 2, 2015, 5:48:29 AM4/2/15
to blin...@chromium.org, dongseo...@intel.com, chri...@chromium.org, phi...@opera.com
yes, it was shipped M42 because it was fixed in 14th Jan.

Thanks, DS

Alex Komoroske

unread,
Apr 2, 2015, 10:23:13 AM4/2/15
to Dongseong Hwang, blink-dev, Chris Harrelson, Philip Jägenstedt
Hmmm, a lot of our launch process (including the Chromium Beta posts, developer relations outreach, etc) is driven off of keeping the chromestatus.com entries up to date, which it looks like didn't happen here. In this particular case, folks who were going to be affected by the change were even watching chromestatus.com itself.

This implies to me in the future that we either need to make the "keep the chromestatus.com entry up-to-date" step more clear for folks, or make our process more resilient to those entries accidentally not being updated. For example, we could skim through bit.ly/blinkintents right after the branch point and ensure the chromestatus.com list of features for that release isn't missing any features mentioned in the last 6 weeks of "intents".


Justin Novosad

unread,
Apr 2, 2015, 1:03:07 PM4/2/15
to Alex Komoroske, Dongseong Hwang, blink-dev, Chris Harrelson, Philip Jägenstedt
Update: Dongseong lined-up a patch to put back the canvas part of the feature, along with a console deprecation message. The timing is tight, but we can still undo this in time for the M42 stable release.  Discussion on what to do is ongoing. Will update this thread with further info when final decision is made.

Justin Novosad

unread,
Apr 2, 2015, 3:11:21 PM4/2/15
to Alex Komoroske, Dongseong Hwang, blink-dev, Chris Harrelson, Philip Jägenstedt
Update: We intend to backtrack on the removal of the "darker" compositing mode for 2d canvas in Chrome 42. The related "plus-darker" CSS mode will stay removed.  If all goes as planned, Chrome 42 stable will support "darker", as an alias for "darken", with a deprecation warning printed to the dev console.

Rik Cabanier

unread,
Apr 2, 2015, 4:14:15 PM4/2/15
to Justin Novosad, Alex Komoroske, Dongseong Hwang, blink-dev, Chris Harrelson, Philip Jägenstedt
On Thu, Apr 2, 2015 at 12:11 PM, Justin Novosad <ju...@chromium.org> wrote:
Update: We intend to backtrack on the removal of the "darker" compositing mode for 2d canvas in Chrome 42. The related "plus-darker" CSS mode will stay removed.  If all goes as planned, Chrome 42 stable will support "darker", as an alias for "darken", with a deprecation warning printed to the dev console.

'darken' and 'darker' are not the same operator so they might produce different results.

That being said, the output will be fairly similar and also I suspect that very few people use this feature.
A github search [1] shows mostly compositing tests. Most of the code that uses "darker" also has fallbacks.

Justin Novosad

unread,
Apr 2, 2015, 4:36:26 PM4/2/15
to Rik Cabanier, Alex Komoroske, Dongseong Hwang, blink-dev, Chris Harrelson, Philip Jägenstedt
On Thu, Apr 2, 2015 at 4:14 PM, Rik Cabanier <caba...@gmail.com> wrote:


On Thu, Apr 2, 2015 at 12:11 PM, Justin Novosad <ju...@chromium.org> wrote:
Update: We intend to backtrack on the removal of the "darker" compositing mode for 2d canvas in Chrome 42. The related "plus-darker" CSS mode will stay removed.  If all goes as planned, Chrome 42 stable will support "darker", as an alias for "darken", with a deprecation warning printed to the dev console.

'darken' and 'darker' are not the same operator so they might produce different results.

'darker' is not implemented in skia. Perhaps older versions of Chrome on Mac that used the CoreGraphics port of WebKit may have had an implementation of 'darker' that varied from 'darken'.  

Elliott Sprehn

unread,
Apr 2, 2015, 6:39:26 PM4/2/15
to Justin Novosad, Rik Cabanier, Alex Komoroske, Dongseong Hwang, blink-dev, Chris Harrelson, Philip Jägenstedt
On Thu, Apr 2, 2015 at 1:36 PM, Justin Novosad <ju...@chromium.org> wrote:


On Thu, Apr 2, 2015 at 4:14 PM, Rik Cabanier <caba...@gmail.com> wrote:


On Thu, Apr 2, 2015 at 12:11 PM, Justin Novosad <ju...@chromium.org> wrote:
Update: We intend to backtrack on the removal of the "darker" compositing mode for 2d canvas in Chrome 42. The related "plus-darker" CSS mode will stay removed.  If all goes as planned, Chrome 42 stable will support "darker", as an alias for "darken", with a deprecation warning printed to the dev console.

'darken' and 'darker' are not the same operator so they might produce different results.

'darker' is not implemented in skia. Perhaps older versions of Chrome on Mac that used the CoreGraphics port of WebKit may have had an implementation of 'darker' that varied from 'darken'.  


It seems they did do something different, but also that it uses the private CAFilter which has no documentation for what the difference between kCAFilterPlusD and kCAFilterDarkenBlendMode is.

Rik Cabanier

unread,
Apr 2, 2015, 7:03:51 PM4/2/15
to Elliott Sprehn, Justin Novosad, Alex Komoroske, Dongseong Hwang, blink-dev, Chris Harrelson, Philip Jägenstedt
On Thu, Apr 2, 2015 at 3:38 PM, Elliott Sprehn <esp...@chromium.org> wrote:


On Thu, Apr 2, 2015 at 1:36 PM, Justin Novosad <ju...@chromium.org> wrote:


On Thu, Apr 2, 2015 at 4:14 PM, Rik Cabanier <caba...@gmail.com> wrote:


On Thu, Apr 2, 2015 at 12:11 PM, Justin Novosad <ju...@chromium.org> wrote:
Update: We intend to backtrack on the removal of the "darker" compositing mode for 2d canvas in Chrome 42. The related "plus-darker" CSS mode will stay removed.  If all goes as planned, Chrome 42 stable will support "darker", as an alias for "darken", with a deprecation warning printed to the dev console.

'darken' and 'darker' are not the same operator so they might produce different results.

'darker' is not implemented in skia. Perhaps older versions of Chrome on Mac that used the CoreGraphics port of WebKit may have had an implementation of 'darker' that varied from 'darken'.  


It seems they did do something different, but also that it uses the private CAFilter which has no documentation for what the difference between kCAFilterPlusD and kCAFilterDarkenBlendMode is.

The CG darker blend mode is defined in the Apple documentation [1]: 
R = MAX(0, 1 - ((1 - D) + (1 - S)))
The CA Filter is supposed to match so it's likely the same.

The 'Darken' blend mode is defined in CSS compositing [2] and the full formula is quite complex:
αs x (1 - αb) x Cs + αs x αb x min(Cb, Cs) + (1 - αs) x αb x Cb
but can be simplified (See the skia impl [3])

Dongseong Hwang

unread,
Apr 3, 2015, 3:46:46 AM4/3/15
to blin...@chromium.org, esp...@chromium.org, ju...@chromium.org, komo...@chromium.org, dongseo...@intel.com, chri...@chromium.org, phi...@opera.com


On Friday, April 3, 2015 at 2:03:51 AM UTC+3, Rik Cabanier wrote:


On Thu, Apr 2, 2015 at 3:38 PM, Elliott Sprehn <esp...@chromium.org> wrote:


On Thu, Apr 2, 2015 at 1:36 PM, Justin Novosad <ju...@chromium.org> wrote:


On Thu, Apr 2, 2015 at 4:14 PM, Rik Cabanier <caba...@gmail.com> wrote:


On Thu, Apr 2, 2015 at 12:11 PM, Justin Novosad <ju...@chromium.org> wrote:
Update: We intend to backtrack on the removal of the "darker" compositing mode for 2d canvas in Chrome 42. The related "plus-darker" CSS mode will stay removed.  If all goes as planned, Chrome 42 stable will support "darker", as an alias for "darken", with a deprecation warning printed to the dev console.

'darken' and 'darker' are not the same operator so they might produce different results.

'darker' is not implemented in skia. Perhaps older versions of Chrome on Mac that used the CoreGraphics port of WebKit may have had an implementation of 'darker' that varied from 'darken'.  


It seems they did do something different, but also that it uses the private CAFilter which has no documentation for what the difference between kCAFilterPlusD and kCAFilterDarkenBlendMode is.

The CG darker blend mode is defined in the Apple documentation [1]: 
R = MAX(0, 1 - ((1 - D) + (1 - S)))
The CA Filter is supposed to match so it's likely the same.

The 'Darken' blend mode is defined in CSS compositing [2] and the full formula is quite complex:
αs x (1 - αb) x Cs + αs x αb x min(Cb, Cs) + (1 - αs) x αb x Cb
but can be simplified (See the skia impl [3])

Thank you Rik for explaining the detail. However, 'darker' has been same to 'darken' in chromium since 'darker' was introduced.
The plan is to support 'darker' for canvas temporarily because of this launch process failure. So we support 'darker' as-is, instead of mathematically correct version.

- DS
Reply all
Reply to author
Forward
0 new messages