Editing SVG transform This edit will create a new revision. Your details (optional) Name Email (won’t be displayed; might be used for Gravatar) URL Test case details Title * Published (uncheck if you want to fiddle around before making the page public) Description (in case you feel further explanation is needed)(Markdown syntax is allowed) A slight modification to this test. I was trying to use the cached method in IE10 and needed to return the transform returned from the appendItem method, which appears to be different than the transform returned from the createSVGTransform method. This approach still appears to work in the latest Chrome (21.0.1180.79) and FF (14.0.1) at the time of creation. Are you a spammer? (just answer the question) Preparation code Preparation code HTML (this will be inserted in the <body> of a valid HTML5 document in standards mode) (useful when testing DOM operations or including libraries) <script> function createRect(y){ var r = document.createElementNS(ns, 'rect'); r.setAttribute('height', 10); r.setAttribute('width', 10); r.setAttribute('y', y); r.setAttribute('x', 10); r.setAttribute('stroke', '#000000'); r.setAttribute('fill', '#007fff'); svg.appendChild(r); return r; } function createTransform(rect) { var t1 = rect.ownerSVGElement.createSVGTransform(); var t2 = rect.transform.baseVal.appendItem(t1); return t2; } var value = 42; var ns = "http://www.w3.org/2000/svg"; var svg = document.createElementNS(ns, 'svg'); document.body.appendChild(svg); var x = 0; var r1 = createRect(10); var r2 = createRect(50); var r3 = createRect(90); var r4 = createRect(130); var r2Transform = createTransform(r2); var r3Transform = createTransform(r3); var r4Transform = createTransform(r4); var r4Matrix = r4Transform.matrix; </script> Include JavaScript libraries as follows: <script src="//cdn.ext/library.js"></script> Define setup for all tests (variables, functions, arrays or other objects that will be used in the tests) (runs before each clocked test loop, outside of the timed code region) (e.g. define local test variables, reset global variables, clear canvas, etc.) (see FAQ) Define teardown for all tests (runs after each clocked test loop, outside of the timed code region) (see FAQ) Code snippets to compare Test 1 Title Async (check if this is an asynchronous test) Code x = (x+5) % 123; r1.setAttribute("transform", "translate(" + x + " 0)"); Test 2 Title Async (check if this is an asynchronous test) Code x = (x+5) % 123; r2.transform.baseVal.getItem(0).matrix.e = x; Test 3 Title Async (check if this is an asynchronous test) Code x = (x+5) % 123; r3Transform.matrix.e = x