diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 62877487..b998c15e 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -28,7 +28,7 @@ var isOpera = !!window.opera, // this defines which elements and attributes that we support // TODO: add elements to this -// TODO: add to this +// TODO: add to this and marker attributes // TODO: add to this // TODO: add to this // TODO: add to this @@ -52,7 +52,7 @@ var isOpera = !!window.opera, "svg": ["id", "height", "requiredFeatures", "systemLanguage", "transform", "viewBox", "width", "xmlns", "xmlns:xlink"], "text": ["fill", "fill-opacity", "fill-rule", "font-family", "font-size", "font-style", "font-weight", "id", "opacity", "requiredFeatures", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "systemLanguage", "transform", "text-anchor", "x", "xml:space", "y"], "title": [], - "use": ["height", "width", "x", "xlink:href", "y"] + "use": ["height", "id", "width", "x", "xlink:href", "y"] }, @@ -1097,7 +1097,7 @@ function BatchCommand(text) { // else, remove this element else { // remove all children from this node and insert them before this node - // FIXME: in the case of animation elements or tspans this will hardly ever be correct + // FIXME: in the case of animation elements this will hardly ever be correct var children = []; while (node.hasChildNodes()) { children.push(parent.insertBefore(node.firstChild, node)); diff --git a/test/test1.html b/test/test1.html index 6c71c409..ad87b524 100644 --- a/test/test1.html +++ b/test/test1.html @@ -63,6 +63,24 @@ "Expected identity matrix when multiplying a matrix by its inverse, got " + matrixString(I)); }); + module("Import Module"); + + test("Test import use", function() { + expect(2); + + svgCanvas.setSvgString("" + + "" + + "" + + "" + + ""); + + var u = document.getElementById("the-use"), + fu = document.getElementById("foreign-use"); + + equals(true, (u && u.nodeName == "use"), "Did not import element"); + equals(null, fu, "Imported a that references a foreign element"); + }); + });