Canvas (HTML element)

From Wikipedia, the free encyclopedia

The canvas element is a third party extension to the HTML standard that allows for dynamic rendering of scriptable bitmap images.

It was initially introduced by Apple for use inside their own Mac OS X Webkit component, powering applications like Dashboard widgets and the Safari browser. Later, it was adopted by Gecko browsers (notably Mozilla and Firefox) and Opera[1], and standardized by the WHATWG on new proposed specifications for next generation web technologies. Novell manufactures an XForms processor plugin for Internet Explorer, which also provides support for the canvas element.[2] Independent efforts to support the canvas feature on Internet Explorer do not require plugins and are based solely on VML and JavaScript.[3] Google has also begun a project to add canvas abilities to Internet Explorer using the same techniques.[4]

Canvas consists of a drawable region defined in HTML code with height and width attributes. JavaScript code may access the area through a full set of drawing functions similar to other common 2D APIs, thus allowing for dynamically generated graphics. Some anticipated uses of the canvas include building graphs, animations, and image composition.

Contents

[edit] Reactions

At the time of its introduction the canvas element met with mixed reactions from the web standards community. Some complained about Apple's decision to create a new proprietary element instead of supporting the SVG standard, which still has not achieved broad web acceptance. Some others argued about the logic upon which canvas was conceived: being completely procedural and not having a descriptive counterpart allowed canvas to 'paint', but drawn elements are not identifiable in a DOM-like way. Other people raised concerns, not about the proprietary extension per se, but in regard to the proposed syntax for those elements. For example, they consider the absence of a namespace indication to be undesirable.[5]

A web developer unsatisfied by the level of SVG support in Safari has pushed himself to develop an SVG Tiny 1.2 to canvas rasteriser in JavaScript, as a proof of concept against claims that canvas was a lot easier to implement in Safari than a complete SVG integration.[6]

[edit] References

  1. ^ Opera 9.0 changelog
  2. ^ Novell XForms Explorer
  3. ^ Canvas in IE
  4. ^ Google's Canvas in IE project
  5. ^ Ian Hickson remarks regarding canvas and other Apple extensions to HTML
  6. ^ canvaSVG Javascript object for rendering SVG documents in canvas

[edit] Examples

[edit] See also

[edit] External links