Closed Bug 593266 Opened 14 years ago Closed 14 years ago

cannot <use> a canvas foreignObject

Categories

(Core :: SVG, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 579853

People

(Reporter: piratepenguin, Unassigned)

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:2.0b6pre) Gecko/20100902 Firefox/4.0b6pre
Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0b6pre) Gecko/20100902 Firefox/4.0b6pre

I am using <use> identifying a <g> element that contains appropriate foreignObject -> <xhtml:canvas> structure, however this appears unworkable on Firefox 4 nightlies (and btw, Chromium too).

See testcase code.

http://www.w3.org/TR/SVGTiny12/struct.html#UseElement This seems to suggest to me that my testcase should work.

"..
 The effect of a 'use'  element is as if the SVG element  contents of the referenced element were deeply cloned into a separate non-exposed DOM tree which had the 'use' element as its parent and all of the 'use'  element's ancestors as its higher-level ancestors. Because the cloned DOM tree is non-exposed, the SVG Document Object Model (DOM) only contains the 'use' element and its attributes. The SVG DOM does not show the referenced element's contents as children of the 'use'  element. **The deeply-cloned tree, also referred to as the shadow tree, is then kept in synchronization with the contents of the referenced element, so that any animation, DOM manipulation, or non-DOM interactive state occurring on the referenced element are also applied to the 'use'  element's deeply-cloned tree.**
.."

But I could be wrong.

Reproducible: Always

Steps to Reproduce:
1.see testcase
2.
3.
Actual Results:  
red, green squares

Expected Results:  
2 green squares
Attached image TESTCASE
modifying an xhtml p element works as expected, thus the problem lies with canvas.


I imagine there could be a problem here because the canvas """for all intents and purposes""" may be cloned and working in the <use> shadow tree, as CanvasElement.cloneNode() works -- i.e. the canvas is there but initialized transparent. This is a big problem in this case because (afaik) there is no way to access the shadowed canvas to call drawImage and workaround that.

Nevertheless it seems like commands sent to "defs #myCanvasUse canvas".getContext() should apply to the shadowed canvases -- no? (if canvas manipulation is covered by "non-DOM interactive state", if not this should be raised with the WG is my guess).

Regards.
I'm afraid that's not possible according to the way the SVG specification is written. So it's just as you suspected, that you'll need to raise it with the w3c SVG WG if you want things changed.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: