W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2008

[whatwg] Minor addition/rewording for canvas section

From: Oliver Hunt <oliver@apple.com>
Date: Sun, 13 Jan 2008 05:42:51 -0800
Message-ID: <AB0C249F-D041-4F2D-B815-ADA4FEFFEA57@apple.com>
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
Received on Sunday, 13 January 2008 05:42:51 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:00 UTC