Bug 18787 - Canvas fallback is not activated on script failure
Canvas fallback is not activated on script failure
Status: RESOLVED INVALID
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec
unspecified
PC Windows NT
: P2 normal
: ---
Assigned To: Edward O'Connor
HTML WG Bugzilla archive list
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-06 07:40 UTC by Peter Winnberg
Modified: 2012-09-06 18:53 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Winnberg 2012-09-06 07:40:10 UTC
When the script that is responsible for drawing something onto a canvas element fails to load (unable to download the file or syntax error) the fallback for that canvas element is not activated. The specification only seems to cover how fallback content should be handled when scripting is completely disabled and when the canvas element is unsupported.

That the fallback content on the canvas element isn’t activated when the script cannot be downloaded is also inconsistent with how fallback content is handled on the img element. If the image associated with the img element cannot be downloaded, the fallback is activated.

Is there a need to have an more explicit relationship between the drawing method and the canvas element so failures like this can be detected?
Comment 1 Edward O'Connor 2012-09-06 17:17:07 UTC
I'll take this one.
Comment 2 Edward O'Connor 2012-09-06 18:31:34 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the Editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this document:

   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: No change.
Rationale: <canvas> is simply an image whose contents may be changed
programmatically. Whether or not script ever actually does so (and why)
is irrelevant.
Comment 3 Peter Winnberg 2012-09-06 18:53:28 UTC
No, if that was the case it would be possible to load the initial image using for example a src attribute that a script could change later (and if that image fails to load the fallback would be activated).

Nothing will be drawn on the canvas element without a script which means that the canvas element is not usable without that script (could of course be spread over several javascript files) and because of that the fallback needs to be activated. Why not try to avoid situations when the canvas element has no content at all (because of errors) and there is fallback content that is hidden?

I’ve not decided if I’ll have time to try to put together a change proposal so no TRACKERREQUEST yet.