W3C home > Mailing lists > Public > public-html-testsuite@w3.org > March 2013

Re: throw or not when sw or sh is zero in drawImage(img, 0, 0, sw, wh, ...) (WHATWG r7589)

From: Kang-Hao (Kenny) Lu <kanghaol@oupeng.com>
Date: Fri, 22 Mar 2013 12:02:01 +0800
Message-ID: <514BD7B9.2070204@oupeng.com>
To: Rik Cabanier <cabanier@gmail.com>
CC: W3C Canvas Spec <public-canvas-api@w3.org>, HTML-related tests <public-html-testsuite@w3.org>, Tietao Wang <tietaow@opera.com>
(13/03/22 3:45), Rik Cabanier wrote:
> The spec was changed at the last minute by the WhatWG and it was actually
> done by accident. (Cameron did a global replace for WebIDL.)

How would doing a global replace for WebIDL change the spec prose? Just
curious.

> The W3C version reversed that change since the change was unintentional and
> there were already 2 independent implementations. Ian decided that the new
> prose made more sense and just left it in.

roc seemed to indicate that he has a patch for removing these errors[1]
(although I haven't found the relevant Bugzilla bug) so "having 2
independent implementations" doesn't seem like a stable assertion.

Should we raise a discussion on the WHATWG list if we intend to keep the
current prose in the W3C version as it is?

[1] http://lists.w3.org/Archives/Public/public-whatwg-archive/2013Mar/0020

> As a developer you should try to catch the exception since both Firefox and
> IE will throw. This will make your code work everywhere.

Not sure what you mean here. This doesn't look like an argument against
the backwards-compat argument. As UA developers, we don't want to do
unnecessary Web evangelism. As Web developer, I'd say using try and
catch in JS is not as common as in other languages.

> If those browser change their behavior, we will update the spec
> accordingly (but you will still have to account for old browsers)

A UA needs to account for old contents.

>> 2. Compatibility
>>
>> Currently only WebKit implements the WHATWG behavior (not throwing).
>> However, it seems very likely that this part of the Web (the WebKit Web
>> :( ) is already depending on drawImage not throwing. Google
>> "IndexSizeError" gives [3][4][5], and I bet there are much more. Also,
>> it is known that getting the Android WebView to change is hard, and
>> therefore not throwing seems like the way to converge.
>>
>>
>> Anyway, the baseline is that we shouldn't have a difference between the
>> two specs.
>>
>> [3] https://github.com/Animatron/player/pull/70
>> [4] https://github.com/aduros/flambe/issues/55
>> [5] http://groups.google.com/group/melonjs/msg/571b36150fd2760b

Cheers,
Kenny
-- 
Web Specialist, Opera Sphinx Game Force, Oupeng Browser, Beijing
Try Oupeng: http://www.oupeng.com/
Received on Friday, 22 March 2013 04:02:31 GMT

This archive was generated by hypermail 2.3.1 : Friday, 22 March 2013 04:02:31 GMT