layout/reftests/svg/smil/container/deferred-tree-util.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

michael@0 1 function makeDiv()
michael@0 2 {
michael@0 3 const xhtmlns="http://www.w3.org/1999/xhtml";
michael@0 4 return document.createElementNS(xhtmlns, 'div');
michael@0 5 }
michael@0 6
michael@0 7 function makeSvg()
michael@0 8 {
michael@0 9 const svgns="http://www.w3.org/2000/svg";
michael@0 10 var svg = document.createElementNS(svgns, 'svg');
michael@0 11 svg.setAttribute('xmlns', svgns);
michael@0 12 svg.setAttribute('width', '200px');
michael@0 13 svg.setAttribute('height', '200px');
michael@0 14 var rect = document.createElementNS(svgns, 'rect');
michael@0 15 rect.setAttribute('x', '0');
michael@0 16 rect.setAttribute('y', '0');
michael@0 17 rect.setAttribute('width', '199');
michael@0 18 rect.setAttribute('height', '199');
michael@0 19 rect.setAttribute('style', 'fill: none; stroke: black');
michael@0 20 var ellipse = document.createElementNS(svgns, 'ellipse');
michael@0 21 ellipse.setAttribute('stroke-width', '1');
michael@0 22 ellipse.setAttribute('stroke', 'black');
michael@0 23 ellipse.setAttribute('fill', 'yellow');
michael@0 24 ellipse.setAttribute('cx', '100');
michael@0 25 ellipse.setAttribute('cy', '20');
michael@0 26 ellipse.setAttribute('rx', '40');
michael@0 27 ellipse.setAttribute('ry', '20');
michael@0 28 var anim = document.createElementNS(svgns, 'animate');
michael@0 29 anim.setAttribute('attributeName', 'cy');
michael@0 30 anim.setAttribute('attributeType', 'XML');
michael@0 31 anim.setAttribute('begin', '0s');
michael@0 32 anim.setAttribute('from', '20');
michael@0 33 anim.setAttribute('to', '170');
michael@0 34 anim.setAttribute('dur', '2s');
michael@0 35 ellipse.appendChild(anim);
michael@0 36 svg.appendChild(rect);
michael@0 37 svg.appendChild(ellipse);
michael@0 38 return svg;
michael@0 39 }

mercurial