This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17563 - Forbid use of canvas for decoration
Summary: Forbid use of canvas for decoration
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML Canvas 2D Context (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: rcabanie
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-21 01:56 UTC by Stefan Götz
Modified: 2012-09-28 18:08 UTC (History)
8 users (show)

See Also:


Attachments

Description Stefan Götz 2012-06-21 01:56:53 UTC
(coming from http://forums.whatwg.org/bb3/viewtopic.php?f=3&t=5016)

The spec for the canvas element states:
"The canvas element provides scripts with a resolution-dependent bitmap canvas, which can be used for rendering graphs, game graphics, or other visual images on the fly."

One could interpret that "other visual images" implies *decorative* images, too.

I suggest to explicitly mention that the canvas element should/must not be used for pure decorative images. 

Maybe similar to the section "A purely decorative image that doesn't add any information", which states for the img element:
"If an image is decorative but isn't especially page-specific — for example an image that forms part of a site-wide design scheme — the image should be specified in the site's CSS, not in the markup of the document."

Random examples for what could be considered as decorative use of canvas (if used as background animation in webpages *not about* canvas (or the animation) itself):
· http://timothypoon.com/blog/demos/canvas-particle-parallax/
· http://radikalfx.com/files/anibg/
· http://www.go2script.com/items/style/14/25/dark_blue
· http://hernan.amiune.com/labs/particle-system/hello-world.html
Comment 1 Glenn Adams 2012-06-21 05:32:34 UTC
purely decorative use of canvas is a legitimate use case
Comment 2 Simon Pieters 2012-06-25 05:04:22 UTC
The spec should be clearer about whether canvas-for-decoration is OK or not, I think.
Comment 3 Glenn Adams 2012-06-25 05:10:17 UTC
if the spec doesn't prohibit it, then it's permitted
Comment 4 Simon Pieters 2012-06-25 06:57:09 UTC
It's usually the other way around, actually. Please leave the bug open.
Comment 5 Glenn Adams 2012-06-25 14:39:53 UTC
(In reply to comment #4)
> It's usually the other way around, actually. Please leave the bug open.

Really? You think specs constrain their applicability of use by default? You and I must be reading different specs then. Any spec that arbitrarily constraints its applicability of use is not going to be very useful for the open web platform (or much else for that matter).

The fundamental purpose of canvas is to allow authoring an image using procedural means (JS), instead of declarative means (via raster or vector graphics). As such, its applicability of use should be close if not equivalent to that of an image element. Are you arguing otherwise?

Since you ask to leave this open, I will defer further resolution to the editor.
Comment 6 contributor 2012-07-18 16:00:01 UTC
This bug was cloned to create bug 18031 as part of operation convergence.
Comment 7 Silvia Pfeiffer 2012-08-11 05:58:33 UTC
Moved to canvas component.
Comment 8 Ian 'Hixie' Hickson 2012-08-11 21:19:44 UTC
Silvia, did you mean to assign this to me? (If so, please move it to the WHATWG product's HTML component.)
Comment 9 Silvia Pfeiffer 2012-08-12 00:06:08 UTC
No I didn't mean to, sorry. But you're still the default assignee for HTML Canvas 2D - need to change this.
Comment 10 rcabanie 2012-08-14 22:59:00 UTC
(In reply to comment #2)
> The spec should be clearer about whether canvas-for-decoration is OK or not, I
> think.

I assume that you're referring to the section "A purely decorative image that doesn't add any information but is still specific to the surrounding content" in http://www.w3.org/TR/2008/WD-html5-20080610/embedded0.html.

That particular part of the spec describes what the 'alt' attribute should contain. This does not prohibit using an image for purely decorative means. (Also, notice the 'in general' which does not prohibit decorative images).

> "The canvas element provides scripts with a resolution-dependent bitmap canvas,
> which can be used for rendering graphs, game graphics, or other visual images
> on the fly."
This description is talking about the content of the canvas. It's not saying how you can use that content (be it as a normal image or a decorative one as described in the image spec )
Comment 11 rcabanie 2012-08-23 19:57:16 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
Comment 12 Silvia Pfeiffer 2012-09-28 09:47:23 UTC
Would you mind if we applied the WHATWG fix for this, as it is simple:

https://github.com/w3c/html/commit/923c9ad84e7eb6d0b4a04cde1465055d9007b437
Comment 13 rcabanie 2012-09-28 18:08:25 UTC
(In reply to comment #12)
> Would you mind if we applied the WHATWG fix for this, as it is simple:
> 
> https://github.com/w3c/html/commit/923c9ad84e7eb6d0b4a04cde1465055d9007b437

That change was already integrated on Sept 18.
I'm unsure if it's related to this bug.