[whatwg] Minor addition/rewording for canvas section

Oliver Hunt oliver at apple.com
Sun Jan 13 05:42:51 PST 2008


Ah ha, i see i have misinterpreted that section, apologies for wasting  
peoples time.

--Oliver

On Jan 13, 2008, at 5:33 AM, Philip Taylor wrote:

> On 13/01/2008, Oliver Hunt <oliver at apple.com> wrote:
>> I did wonder about why other origins could read anything myself, so
>> you're not
>> alone -- it just seemed especially odd to allow images to be written
>> safely but not
>> ImageData.
>
> As far as I'm aware, different origins can never read and write the
> same canvas. Images are given special consideration because scripts
> already have access to Image objects where the image has a different
> origin to the script, like:
>
>  // on a page on www.example.com
>  var img = new Image();
>  img.onload = function () { ctx.drawImage(img, 0, 0); }
>  img.src = 'http://google.com/images/logo.gif';
>
> The canvas reading/writing all happens in the same origin - it's just
> the image itself that is not the same origin.
>
> The same does not apply to ImageData, because scripts don't have
> access to ImageData objects from other origins.
>
> -- 
> Philip Taylor
> excors at gmail.com




More information about the whatwg mailing list