Re: Re: xforms:output mediatype="text/html" and canvas element?

Posted by Alessandro Vernet on
URL: https://discuss.orbeon.com/xforms-output-mediatype-text-html-and-canvas-element-tp2549084p3006535.html

Hi Florian,

Sorry for the delay with this response! I hope you will still get
this, and that it is not too late for us to help. The clean-html.xsl
is only used in "input", when the <xforms:textarea
mediatype="text/html"> receives content from the browser:

http://wiki.orbeon.com/forms/doc/developer-guide/xforms-controls#TOC-HTML-cleanup

So I am not sure why the <xhtml:canvas> wouldn't show. Your code was
pasted as is in your email, and the markup didn't make it. If this is
still an issue, could you resend your test case as an attachment?

Alex

On Thu, Sep 23, 2010 at 1:17 AM, Florian Schmitt
<[hidden email]> wrote:

> I've attached a test xforms page to demonstrate the problem - it
> contains two instances with html content and canvas elements and some
> attempts to render that html content using xforms:output. To check if
> the canvas element works, the xhtml:body contains some plain html
> content including similar canvas elements and some javascript to make
> firefox render the canvas elements.
>
> Using a newer firefox version, the canvas elements that are "hard-coded"
> in the html body are displayed correctly, but those which should be
> included in the xforms:output seem to be stripped from the output.
>
> The test won't work with IE, i think, because canvas is still a
> proprietary element. I've modified ops/xforms/clean-html.xsl, adding the
> canvas element to the list of "safe" elements; also, modifying tagsoup
> to let custom tags pass didn't help.
>
> It would be great if anyone could help! Because of a recent update,
> firefox doesn't allow inserting custom elements using the insertHtml
> function any more. The canvas element would be an perfect replacement
> for a certain custom tag i used up to now in my app, but i can't update
> my app until orbeon supports displaying the canvas element in
> xforms:output....
>
> TIA
> florian
>
>
> Canvas Test <div> <p>First canvas: <canvas id="rd21" /></p> <p>Second canvas <canvas id="rd33333" /></p> </div>
>
> First canvas:
>
> Second canvas
>
> Canvas-Test First canvas: Second canvas XForms - escaped test1 - value - saxon:parse test2 - value - no mediatype test3 - ref - no mediatype test4 - value - xxforms:serialize test5 - ref - mediatype XForms 2 - unescaped test1 - value - saxon:parse test2 - value - no mediatype test3 - ref - no mediatype test4 - value - xxforms:serialize test5 - ref - mediatype var myKontext; var myId; var width; var myText var len; var x; var y; var canv = document.getElementsByTagName("canvas"); for ( var int = 0; int < canv.length; int++) { myKontext = canv[int].getContext("2d"); myId = canv[int].getAttribute("id"); myText = 'canvas with ID ' + myId; // passe Canvas-Größe an Text-Inhalt an len = myKontext.measureText(myText).width; width = canv[int].width = len + 24 canv[int].height = 18 // Textposition: aus Mitte bzw von unten verschoben wg. Schatten x = (width-len) / 2; y = canv[int].height - 4; // gelber Hintergrund myKontext.fillStyle = "lightblue"; myKontext.fillRect(0,0,width,18); // schreibe Inhalt myKontext.fillStyle = "black"; myKontext.fillText(myText, x, y); }
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet