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 18031 - Forbid use of canvas for decoration
Summary: Forbid use of canvas for decoration
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 15:59 UTC by contributor
Modified: 2012-09-15 21:55 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2012-07-18 15:59:58 UTC
This was was cloned from bug 17563 as part of operation convergence.
Originally filed: 2012-06-21 01:56:00 +0000
Original reporter: res-html@untief.org

================================================================================
 #0   res-html@untief.org                             2012-06-21 01:56:53 +0000 
--------------------------------------------------------------------------------
(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
================================================================================
 #1   Glenn Adams                                     2012-06-21 05:32:34 +0000 
--------------------------------------------------------------------------------
purely decorative use of canvas is a legitimate use case
================================================================================
 #2   Simon Pieters                                   2012-06-25 05:04:22 +0000 
--------------------------------------------------------------------------------
The spec should be clearer about whether canvas-for-decoration is OK or not, I think.
================================================================================
 #3   Glenn Adams                                     2012-06-25 05:10:17 +0000 
--------------------------------------------------------------------------------
if the spec doesn't prohibit it, then it's permitted
================================================================================
 #4   Simon Pieters                                   2012-06-25 06:57:09 +0000 
--------------------------------------------------------------------------------
It's usually the other way around, actually. Please leave the bug open.
================================================================================
 #5   Glenn Adams                                     2012-06-25 14:39:53 +0000 
--------------------------------------------------------------------------------
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 1 contributor 2012-09-15 21:55:36 UTC
Checked in as WHATWG revision r7357.
Check-in comment: Clarify that <canvas> can be used for art
http://html5.org/tools/web-apps-tracker?from=7356&to=7357