W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2006

[whatwg] Canvas and DOM elements

From: Peter Hall <peterjoel@gmail.com>
Date: Tue, 9 May 2006 19:57:50 +0100
Message-ID: <9ac110a90605091157i3a164efai47596b63d48cbdc2@mail.gmail.com>
I disagree, for a number of reasons.

1. When an element is resized, the bitmap and context get re-initialized to
their default state. This doesn't happen in any other scenario, and I think
it would be non-obvious and difficult to work with. For example, if you draw
a custom bullet point, you wouldn't want to redraw it every time you resize
the element, since the actual graphic isn't changing size. Best practice
would evolve to discourage your suggested usage by always using a dedicated
<div> for graphics.

2. It's much cleaner to keep all the canvas-related attributes and methods
together, without having to contaminate other DOM elements, that aren't
going to use them.

3. Your argument about placing graphics above and below other content seems
invalid. Since, <canvas> supports transparency, you could position it above
or below any other element, and get the same effect.

Peter

On 5/9/06, Martijn <martijn.martijn at gmail.com> wrote:
>
> On 5/5/06, Andrew Fedoniouk <news at terrainformatica.com> wrote:
> >
> > Having dedicated DOM element (<canvas>) for drawings looks a bit strange
> as
> > a design decision.
> > Logically any block DOM element can provide graphics.
> > Ideally getContext method should have one more parameter - layer -
> > background/content/foreground -
> > so graphics could be mixed with the content of the element, drawn on top
> > and/or below the content.
>
> Yeah, I think you make a good point here.
>
> Regards,
> Martijn
>
>
> > <optional>
> > Only as an example, Sciter allows to draw on any block element:
> > http://terrainformatica.com/sciter/sciter.zip at
> > http://terrainformatica.com/sciter/
> > Samples are in /samples/graphics/*.htm
> > </optional>
> >
> > Andrew Fedoniouk.
> > http://terrainformatica.com
> >
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20060509/5b07723d/attachment.htm>
Received on Tuesday, 9 May 2006 11:57:50 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:27 UTC