These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:06 pm Advanced search

svg hearts canvas

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

Do you think canvas in SVG is a good idea

yes
2
100%
no
0
No votes
 
Total votes : 2

svg hearts canvas

Postby Fenring » Sun Dec 02, 2007 4:28 pm

SVG and video seems to flirt these days, with the help of svg 1.2.
Do you think it would be possible to make SVG go out with canvas too ?
For some uses, SVG is simpler. For others, canvas suits better.

Do you think one day, I will be able to code something like :
Code: Select all
<svg>
  <circle/>
  <canvas/>
  <rect/> 
</svg>

?

maybe we should enclose <canvas> in a <foreignObject> (?)

It would be great I think.

edit : sorry I didn't read the sticky post. I'm reformulating and developing.

» What is the problem you are trying to solve?

SVG vs canvas duality. For some use cases, SVG is simpler. For others, canvas suits better. Usually declarative (svg) is more easily maintained, and it has the advantage of being scalable. Sometimes you don't need SVG and are happy to have a canvas that doesn't memorize the drawn objects.
And dynamically drawing on a canvas is sometimes less verbose.
But at the moment, you can't do both at a time.

» What is the feature you are suggesting to help solve it?

Provide a svg extension to include a <canvas> into a svg document.
Code: Select all
    <foreignObject width="100" height="50" requiredExtensions="http://spec.whatwg.org/SVGExtensions/Canvas">
      <canvas id="aCanvas" width="100" height="50"></canvas>
    </foreignObject>

» What is the processing model for that feature, including error handling?

The canvas will render at the layer of its foreignObject parent, taking the transforms and filters of its ancestors into account.
Any affecting function call to the canvas API will trigger the required redaw of the dirty region.
I don't think any of the canvas attributes should be animatable.
All DOMEvents to foreignObject will be forwared to the canvas.
All other mechanism are defined by the xml, dom specs.

» Why do you think browsers would implement this feature?

SVG already have the concept of canvas. I have a feeling that a html canvas and a svg canvas already share the same codebase for the implementors. The two are very similar I think.

» Why do you think authors would use this feature?

If they want to develop an online whiteboard for example. The whiteboard itself is a canvas. The controls, buttons, menus, dialogs, etc... will be programmed with clean declarative xml svgElements.

» What evidence is there that this feature is desparately needed?

Once some authors will have to reprogram their webapp from svg to canvas or from canvas to svg because they have misevaluated the consequences when starting, they will be desperate. ;-)
Although, you can already find some implementations of scripted svg2canvas or canvas2svg transformers on the web. Which clearly mean that some people hesitate between the two.


The first answer to this post is very informative.
Thanks Simon !
This request refers to the last line of that article.
--end of edit

Thanks.
David
Last edited by Fenring on Sun Dec 02, 2007 8:19 pm, edited 1 time in total.
Fenring
<h6>
 
Posts: 3
Joined: Sat Oct 20, 2007 5:29 pm

Postby zcorpan » Sun Dec 02, 2007 8:02 pm

This page might contain some relevant information: http://wiki.whatwg.org/wiki/SVG_and_canvas
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden


Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest