W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2011

[whatwg] Need clarification on DOM exceptions thrown by canvas 2D drawImage

From: Justin Novosad <junov@chromium.org>
Date: Mon, 8 Aug 2011 16:55:26 -0400
Message-ID: <CADBbOaW-vf1a28-V3Nofg2CYaBcnaKtX8dQLnt7d86QEekHi0g@mail.gmail.com>

This inquiry is regarding this page of the specification:
In section Images, about drawImage(), it is stated that
"If one of the sw or sh arguments is zero, the implementation must
raise an INDEX_SIZE_ERR exception"  There are no other references to
other circumstances under which INDEX_SIZE_ERR should be thrown, and
there is no indication of what the correct behavior is when the source
rectangle is completely or partially outside the bounds of the source

Right now there are discrepancies in how different browsers handle
this situation.
 -WebKit throws INDEX_SIZE_ERR when the source rectangle is completely
out of bounds
 -Internet Explorer 9 does not throw an exception (which I believe is
the correct behavior, given the current wording of the spec)
 -Firefox 5 throws an INDEX_SIZE_ERR if the source rectangle is out of
bounds to the top or left (negative sx or sy)

Also, this test agrees with (or perhaps influenced) the WebKit
interpretation of the specification:

This matter is currently under investigation in WebKit:

On the Firefox side, a patch was recently submitted to remove the
exception (be like IE)

Thanks providing clarification,

Received on Monday, 8 August 2011 13:55:26 UTC

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