Inconsistent behaviour of globalCompositeOperation property

As we were reviewing the globalCompositeOperation property [1] of the Canvas 2D Context, we have noticed that there is a large inconsistency with the way web browsers implement this property.



Firefox 3.6.3 and Opera 10.5 have a similar behaviour that matches the current version of the Canvas 2D Context spec. Chrome 4.1 and Safari 4.0.5 behave similarly to each other, albeit differently from the spec. Today, web developers cannot reliably use this property in designing their webpages due to this interoperability issue.



We consider that the Safari implementation of the Drawing Model makes more sense from a web developer point of view. Most of the Canvas APIs are applied to the next primitive being drawn. However, the clipping behavior, as defined in the current Drawing Model [2], affects the current contents of the Canvas outside of the current primitive being drawn. The Safari Drawing Model calls for the clipping region to only affect the current primitive being drawn.



We recommend updating the spec to match the Safari Drawing Model. We would like to discuss this area in more detail.



Thank you,

Jatinder



[1] http://dev.w3.org/html5/2dcontext/#compositing

[2] http://dev.w3.org/html5/2dcontext/#drawing-model



Jatinder Mann | Microsoft Program Manager | jmann@microsoft.com<mailto:jmann@microsoft.com>

Received on Tuesday, 25 May 2010 18:57:14 UTC