1 // ┌─────────────────────────────────────────────────────────────────────┐ \\
2 // │ Raphaël 2 - JavaScript Vector Library │ \\
3 // ├─────────────────────────────────────────────────────────────────────┤ \\
5 // ├─────────────────────────────────────────────────────────────────────┤ \\
6 // │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
7 // │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\
8 // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
9 // └─────────────────────────────────────────────────────────────────────┘ \\
10 window.Raphael.vml && function (R) {
11 var has = "hasOwnProperty",
24 var map = {M: "m", L: "l", C: "c", Z: "x", m: "t", l: "r", c: "v", z: "x"},
25 bites = /([clmz]),?([^clmz]*)/gi,
26 blurregexp = / progid:\S+Blur\([^\)]+\)/g,
28 cssDot = "position:absolute;left:0;top:0;width:1px;height:1px",
30 pathTypes = {path: 1, rect: 1},
31 ovalTypes = {circle: 1, ellipse: 1},
32 path2vml = function (path) {
33 var total = /[ahqstv]/ig,
34 command = R._pathToAbsolute;
35 Str(path).match(total) && (command = path2curve);
37 if (command == R._pathToAbsolute && !Str(path).match(total)) {
38 var res = Str(path).replace(bites, function (all, command, args) {
40 isMove = lowerCase.call(command) == "m",
42 args.replace(val, function (value) {
43 if (isMove && vals.length == 2) {
44 res += vals + map[command == "m" ? "l" : "L"];
47 vals.push(round(value * zoom));
53 var pa = command(path), p, r;
55 for (var i = 0, ii = pa.length; i < ii; i++) {
57 r = pa[i][0].toLowerCase();
58 r == "z" && (r = "x");
59 for (var j = 1, jj = p.length; j < jj; j++) {
60 r += round(p[j] * zoom) + (j != jj - 1 ? "," : E);
66 compensation = function (deg, dx, dy) {
68 m.rotate(-deg, .5, .5);
74 setCoords = function (p, sx, sy, dx, dy, deg) {
85 s.visibility = "hidden";
89 o.coordsize = abs(kx) + S + abs(ky);
90 s.rotation = deg * (sx * sy < 0 ? -1 : 1);
92 var c = compensation(deg, dx, dy);
96 sx < 0 && (flip += "x");
97 sy < 0 && (flip += " y") && (y = -1);
99 o.coordorigin = (dx * -kx) + S + (dy * -ky);
100 if (fillpos || _.fillsize) {
101 var fill = o.getElementsByTagName(fillString);
102 fill = fill && fill[0];
105 c = compensation(deg, m.x(fillpos[0], fillpos[1]), m.y(fillpos[0], fillpos[1]));
106 fill.position = c.dx * y + S + c.dy * y;
109 fill.size = _.fillsize[0] * abs(sx) + S + _.fillsize[1] * abs(sy);
113 s.visibility = "visible";
115 R.toString = function () {
116 return "Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\xebl " + this.version;
118 addArrow = function (o, value, isEnd) {
119 var values = Str(value).toLowerCase().split("-"),
120 se = isEnd ? "end" : "start",
136 case "narrow": h = values[i]; break;
138 case "short": w = values[i]; break;
141 var stroke = o.node.getElementsByTagName("stroke")[0];
142 stroke[se + "arrow"] = type;
143 stroke[se + "arrowlength"] = w;
144 stroke[se + "arrowwidth"] = h;
146 setFillAndStroke = function (o, params) {
147 // o.paper.canvas.style.display = "none";
148 o.attrs = o.attrs || {};
153 newpath = pathTypes[o.type] && (params.x != a.x || params.y != a.y || params.width != a.width || params.height != a.height || params.cx != a.cx || params.cy != a.cy || params.rx != a.rx || params.ry != a.ry || params.r != a.r),
154 isOval = ovalTypes[o.type] && (a.cx != params.cx || a.cy != params.cy || a.r != params.r || a.rx != params.rx || a.ry != params.ry),
158 for (var par in params) if (params[has](par)) {
159 a[par] = params[par];
162 a.path = R._getPath[o.type](o);
165 params.href && (node.href = params.href);
166 params.title && (node.title = params.title);
167 params.target && (node.target = params.target);
168 params.cursor && (s.cursor = params.cursor);
169 "blur" in params && o.blur(params.blur);
170 "transform" in params && o.transform(params.transform);
171 if (params.path && o.type == "path" || newpath) {
172 node.path = path2vml(a.path);
177 rx = a.rx || a.r || 0,
178 ry = a.ry || a.r || 0;
179 node.path = R.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x", round((cx - rx) * zoom), round((cy - ry) * zoom), round((cx + rx) * zoom), round((cy + ry) * zoom), round(cx * zoom));
181 if ("clip-rect" in params) {
182 var rect = Str(params["clip-rect"]).split(separator);
183 if (rect.length == 4) {
184 rect[2] = +rect[2] + (+rect[0]);
185 rect[3] = +rect[3] + (+rect[1]);
186 var div = node.clipRect || g.doc.createElement("div"),
188 group = node.parentNode;
189 dstyle.clip = R.format("rect({1}px {2}px {3}px {0}px)", rect);
190 if (!node.clipRect) {
191 dstyle.position = "absolute";
194 dstyle.width = o.paper.width + "px";
195 dstyle.height = o.paper.height + "px";
196 group.parentNode.insertBefore(div, group);
197 div.appendChild(group);
201 if (!params["clip-rect"]) {
202 node.clipRect && (node.clipRect.style.clip = E);
206 var textpathStyle = o.textpath.style;
207 params.font && (textpathStyle.font = params.font);
208 params["font-family"] && (textpathStyle.fontFamily = '"' + params["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g, E) + '"');
209 params["font-size"] && (textpathStyle.fontSize = params["font-size"]);
210 params["font-weight"] && (textpathStyle.fontWeight = params["font-weight"]);
211 params["font-style"] && (textpathStyle.fontStyle = params["font-style"]);
213 if ("arrow-start" in params) {
214 addArrow(res, params["arrow-start"]);
216 if ("arrow-end" in params) {
217 addArrow(res, params["arrow-end"], 1);
219 if (params.opacity != null ||
220 params["stroke-width"] != null ||
221 params.fill != null ||
222 params.src != null ||
223 params.stroke != null ||
224 params["stroke-width"] != null ||
225 params["stroke-opacity"] != null ||
226 params["fill-opacity"] != null ||
227 params["stroke-dasharray"] != null ||
228 params["stroke-miterlimit"] != null ||
229 params["stroke-linejoin"] != null ||
230 params["stroke-linecap"] != null) {
231 var fill = node.getElementsByTagName(fillString),
233 fill = fill && fill[0];
234 !fill && (newfill = fill = createNode(fillString));
235 if (o.type == "image" && params.src) {
236 fill.src = params.src;
238 params.fill && (fill.on = true);
239 if (fill.on == null || params.fill == "none" || params.fill === null) {
242 if (fill.on && params.fill) {
243 var isURL = Str(params.fill).match(R._ISURL);
245 fill.parentNode == node && node.removeChild(fill);
249 var bbox = o.getBBox(1);
250 fill.position = bbox.x + S + bbox.y;
251 o._.fillpos = [bbox.x, bbox.y];
253 R._preload(isURL[1], function () {
254 o._.fillsize = [this.offsetWidth, this.offsetHeight];
257 fill.color = R.getRGB(params.fill).hex;
260 if (R.getRGB(params.fill).error && (res.type in {circle: 1, ellipse: 1} || Str(params.fill).charAt() != "r") && addGradientFill(res, params.fill, fill)) {
262 a.gradient = params.fill;
267 if ("fill-opacity" in params || "opacity" in params) {
268 var opacity = ((+a["fill-opacity"] + 1 || 2) - 1) * ((+a.opacity + 1 || 2) - 1) * ((+R.getRGB(params.fill).o + 1 || 2) - 1);
269 opacity = mmin(mmax(opacity, 0), 1);
270 fill.opacity = opacity;
275 node.appendChild(fill);
276 var stroke = (node.getElementsByTagName("stroke") && node.getElementsByTagName("stroke")[0]),
278 !stroke && (newstroke = stroke = createNode("stroke"));
279 if ((params.stroke && params.stroke != "none") ||
280 params["stroke-width"] ||
281 params["stroke-opacity"] != null ||
282 params["stroke-dasharray"] ||
283 params["stroke-miterlimit"] ||
284 params["stroke-linejoin"] ||
285 params["stroke-linecap"]) {
288 (params.stroke == "none" || params.stroke === null || stroke.on == null || params.stroke == 0 || params["stroke-width"] == 0) && (stroke.on = false);
289 var strokeColor = R.getRGB(params.stroke);
290 stroke.on && params.stroke && (stroke.color = strokeColor.hex);
291 opacity = ((+a["stroke-opacity"] + 1 || 2) - 1) * ((+a.opacity + 1 || 2) - 1) * ((+strokeColor.o + 1 || 2) - 1);
292 var width = (toFloat(params["stroke-width"]) || 1) * .75;
293 opacity = mmin(mmax(opacity, 0), 1);
294 params["stroke-width"] == null && (width = a["stroke-width"]);
295 params["stroke-width"] && (stroke.weight = width);
296 width && width < 1 && (opacity *= width) && (stroke.weight = 1);
297 stroke.opacity = opacity;
299 params["stroke-linejoin"] && (stroke.joinstyle = params["stroke-linejoin"] || "miter");
300 stroke.miterlimit = params["stroke-miterlimit"] || 8;
301 params["stroke-linecap"] && (stroke.endcap = params["stroke-linecap"] == "butt" ? "flat" : params["stroke-linecap"] == "square" ? "square" : "round");
302 if (params["stroke-dasharray"]) {
306 "-.": "shortdashdot",
307 "-..": "shortdashdotdot",
312 "--.": "longdashdot",
313 "--..": "longdashdotdot"
315 stroke.dashstyle = dasharray[has](params["stroke-dasharray"]) ? dasharray[params["stroke-dasharray"]] : E;
317 newstroke && node.appendChild(stroke);
319 if (res.type == "text") {
320 res.paper.canvas.style.display = E;
321 var span = res.paper.span,
323 fontSize = a.font && a.font.match(/\d+(?:\.\d*)?(?=px)/);
325 a.font && (s.font = a.font);
326 a["font-family"] && (s.fontFamily = a["font-family"]);
327 a["font-weight"] && (s.fontWeight = a["font-weight"]);
328 a["font-style"] && (s.fontStyle = a["font-style"]);
329 fontSize = toFloat(fontSize ? fontSize[0] : a["font-size"]);
330 s.fontSize = fontSize * m + "px";
331 res.textpath.string && (span.innerHTML = Str(res.textpath.string).replace(/</g, "<").replace(/&/g, "&").replace(/\n/g, "<br>"));
332 var brect = span.getBoundingClientRect();
333 res.W = a.w = (brect.right - brect.left) / m;
334 res.H = a.h = (brect.bottom - brect.top) / m;
335 res.paper.canvas.style.display = "none";
337 res.Y = a.y + res.H / 2;
339 ("x" in params || "y" in params) && (res.path.v = R.format("m{0},{1}l{2},{1}", round(a.x * zoom), round(a.y * zoom), round(a.x * zoom) + 1));
340 var dirtyattrs = ["x", "y", "text", "font", "font-family", "font-weight", "font-style", "font-size"];
341 for (var d = 0, dd = dirtyattrs.length; d < dd; d++) if (dirtyattrs[d] in params) {
346 // text-anchor emulation
347 switch (a["text-anchor"]) {
349 res.textpath.style["v-text-align"] = "left";
353 res.textpath.style["v-text-align"] = "right";
354 res.bbx = -res.W / 2;
357 res.textpath.style["v-text-align"] = "center";
361 res.textpath.style["v-text-kern"] = true;
363 // res.paper.canvas.style.display = E;
365 addGradientFill = function (o, gradient, fill) {
366 o.attrs = o.attrs || {};
372 o.attrs.gradient = gradient;
373 gradient = Str(gradient).replace(R._radial_gradient, function (all, fx, fy) {
378 pow(fx - .5, 2) + pow(fy - .5, 2) > .25 && (fy = math.sqrt(.25 - pow(fx - .5, 2)) * ((fy > .5) * 2 - 1) + .5);
383 gradient = gradient.split(/\s*\-\s*/);
384 if (type == "linear") {
385 var angle = gradient.shift();
386 angle = -toFloat(angle);
391 var dots = R._parseDots(gradient);
395 o = o.shape || o.node;
399 fill.method = "none";
400 fill.color = dots[0].color;
401 fill.color2 = dots[dots.length - 1].color;
403 for (var i = 0, ii = dots.length; i < ii; i++) {
404 dots[i].offset && clrs.push(dots[i].offset + S + dots[i].color);
406 fill.colors = clrs.length ? clrs.join() : "0% " + fill.color;
407 if (type == "radial") {
408 fill.type = "gradientTitle";
410 fill.focussize = "0 0";
411 fill.focusposition = fxfy;
414 // fill.rotate= true;
415 fill.type = "gradient";
416 fill.angle = (270 - angle) % 360;
422 Element = function (node, vml) {
423 this[0] = this.node = node;
426 node.raphaelid = this.id;
431 this.matrix = R.matrix();
442 !vml.bottom && (vml.bottom = this);
444 vml.top && (vml.top.next = this);
450 Element.prototype = elproto;
451 elproto.constructor = Element;
452 elproto.transform = function (tstr) {
454 return this._.transform;
456 R._extractTransform(this, tstr);
457 var matrix = this.matrix.clone(),
458 vbs = this.paper._viewBoxShift,
462 isGrad = Str(this.attrs.fill).indexOf("-") + 1;
463 matrix.translate(-.5, -.5);
465 matrix.scale(vbs.scale, vbs.scale, -1, -1);
466 matrix.translate(vbs.dx, vbs.dy);
468 if (isGrad || this.type == "image") {
469 skew.matrix = "1 0 0 1";
471 split = matrix.split();
472 if ((isGrad && split.noRotation) || !split.isSimple) {
473 o.style.filter = matrix.toFilter();
474 var bb = this.getBBox(),
475 bbt = this.getBBox(1),
478 o.coordorigin = (dx * -zoom) + S + (dy * -zoom);
479 setCoords(this, 1, 1, dx, dy, 0);
482 setCoords(this, split.scalex, split.scaley, split.dx, split.dy, split.rotate);
486 skew.matrix = Str(matrix);
487 skew.offset = matrix.offset();
491 elproto.rotate = function (deg, cx, cy) {
498 deg = Str(deg).split(separator);
499 if (deg.length - 1) {
500 cx = toFloat(deg[1]);
501 cy = toFloat(deg[2]);
503 deg = toFloat(deg[0]);
504 (cy == null) && (cx = cy);
505 if (cx == null || cy == null) {
506 var bbox = this.getBBox(1);
507 cx = bbox.x + bbox.width / 2;
508 cy = bbox.y + bbox.height / 2;
511 this.transform(this._.transform.concat([["r", deg, cx, cy]]));
514 elproto.translate = function (dx, dy) {
518 dx = Str(dx).split(separator);
522 dx = toFloat(dx[0]) || 0;
528 this.transform(this._.transform.concat([["t", dx, dy]]));
531 elproto.scale = function (sx, sy, cx, cy) {
535 sx = Str(sx).split(separator);
540 isNaN(cx) && (cx = null);
541 isNaN(cy) && (cy = null);
544 (sy == null) && (sy = sx);
545 (cy == null) && (cx = cy);
546 if (cx == null || cy == null) {
547 var bbox = this.getBBox(1);
549 cx = cx == null ? bbox.x + bbox.width / 2 : cx;
550 cy = cy == null ? bbox.y + bbox.height / 2 : cy;
552 this.transform(this._.transform.concat([["s", sx, sy, cx, cy]]));
556 elproto.hide = function () {
557 !this.removed && (this.node.style.display = "none");
560 elproto.show = function () {
561 !this.removed && (this.node.style.display = E);
564 elproto._getBBox = function () {
568 if (this.type == "text") {
570 x: this.X + (this.bbx || 0) - this.W / 2,
576 return pathDimensions(this.attrs.path);
579 elproto.remove = function () {
583 R.eve.unbind("*.*." + this.id);
584 R._tear(this, this.paper);
585 this.node.parentNode.removeChild(this.node);
586 this.shape && this.shape.parentNode.removeChild(this.shape);
587 for (var i in this) {
592 elproto.attr = function (name, value) {
598 for (var a in this.attrs) if (this.attrs[has](a)) {
599 res[a] = this.attrs[a];
601 res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient;
602 res.transform = this._.transform;
605 if (value == null && R.is(name, "string")) {
606 if (name == fillString && this.attrs.fill == "none" && this.attrs.gradient) {
607 return this.attrs.gradient;
609 var names = name.split(separator),
611 for (var i = 0, ii = names.length; i < ii; i++) {
613 if (name in this.attrs) {
614 out[name] = this.attrs[name];
615 } else if (R.is(this.paper.customAttributes[name], "function")) {
616 out[name] = this.paper.customAttributes[name].def;
618 out[name] = R._availableAttrs[name];
621 return ii - 1 ? out : out[names[0]];
623 if (this.attrs && value == null && R.is(name, "array")) {
625 for (i = 0, ii = name.length; i < ii; i++) {
626 out[name[i]] = this.attr(name[i]);
633 params[name] = value;
635 value == null && R.is(name, "object") && (params = name);
636 for (var key in params) {
637 R.eve("attr." + key + "." + this.id, this, params[key]);
640 for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
641 var par = this.paper.customAttributes[key].apply(this, [][concat](params[key]));
642 this.attrs[key] = params[key];
643 for (var subkey in par) if (par[has](subkey)) {
644 params[subkey] = par[subkey];
647 // this.paper.canvas.style.display = "none";
648 if (params.text && this.type == "text") {
649 this.textpath.string = params.text;
651 setFillAndStroke(this, params);
652 // this.paper.canvas.style.display = E;
656 elproto.toFront = function () {
657 !this.removed && this.node.parentNode.appendChild(this.node);
658 this.paper && this.paper.top != this && tofront(this, this.paper);
661 elproto.toBack = function () {
665 if (this.node.parentNode.firstChild != this.node) {
666 this.node.parentNode.insertBefore(this.node, this.node.parentNode.firstChild);
667 toback(this, this.paper);
671 elproto.insertAfter = function (element) {
675 if (element.constructor == Set) {
676 element = element[element.length - 1];
678 if (element.node.nextSibling) {
679 element.node.parentNode.insertBefore(this.node, element.node.nextSibling);
681 element.node.parentNode.appendChild(this.node);
683 R._insertafter(this, element, this.paper);
686 elproto.insertBefore = function (element) {
690 if (element.constructor == Set) {
691 element = element[0];
693 element.node.parentNode.insertBefore(this.node, element.node);
694 R._insertbefore(this, element, this.paper);
697 elproto.blur = function (size) {
698 var s = this.node.runtimeStyle,
700 f = f.replace(blurregexp, E);
702 this.attrs.blur = size;
703 s.filter = f + S + ms + ".Blur(pixelradius=" + (+size || 1.5) + ")";
704 s.margin = R.format("-{0}px 0 0 -{0}px", round(+size || 1.5));
708 delete this.attrs.blur;
712 R._engine.path = function (pathString, vml) {
713 var el = createNode("shape");
714 el.style.cssText = cssDot;
715 el.coordsize = zoom + S + zoom;
716 el.coordorigin = vml.coordorigin;
717 var p = new Element(el, vml),
718 attr = {fill: "none", stroke: "#000"};
719 pathString && (attr.path = pathString);
723 setFillAndStroke(p, attr);
724 vml.canvas.appendChild(el);
725 var skew = createNode("skew");
727 el.appendChild(skew);
732 R._engine.rect = function (vml, x, y, w, h, r) {
733 var path = R._rectPath(x, y, w, h, r),
734 res = vml.path(path),
739 res.H = a.height = h;
745 R._engine.ellipse = function (vml, x, y, rx, ry) {
746 var res = vml.path(),
752 res.type = "ellipse";
753 setFillAndStroke(res, {
761 R._engine.circle = function (vml, x, y, r) {
762 var res = vml.path(),
766 res.W = res.H = r * 2;
768 setFillAndStroke(res, {
775 R._engine.image = function (vml, src, x, y, w, h) {
776 var path = R._rectPath(x, y, w, h),
777 res = vml.path(path).attr({stroke: "none"}),
780 fill = node.getElementsByTagName(fillString)[0];
785 res.H = a.height = h;
788 fill.parentNode == node && node.removeChild(fill);
792 res._.fillpos = [x, y];
793 res._.fillsize = [w, h];
794 node.appendChild(fill);
795 setCoords(res, 1, 1, 0, 0, 0);
798 R._engine.text = function (vml, x, y, text) {
799 var el = createNode("shape"),
800 path = createNode("path"),
801 o = createNode("textpath");
805 path.v = R.format("m{0},{1}l{2},{1}", round(x * zoom), round(y * zoom), round(x * zoom) + 1);
806 path.textpathok = true;
807 o.string = Str(text);
809 el.style.cssText = "position:absolute;left:0;top:0;width:1px;height:1px";
810 el.coordsize = zoom + S + zoom;
811 el.coordorigin = "0 0";
812 var p = new Element(el, vml),
813 attr = {fill: "#000", stroke: "none", font: availableAttrs.font, text: text};
818 p.attrs.text = Str(text);
823 setFillAndStroke(p, attr);
825 el.appendChild(path);
826 vml.canvas.appendChild(el);
827 var skew = createNode("skew");
829 el.appendChild(skew);
834 R._engine.setSize = function (width, height) {
835 var cs = this.canvas.style;
837 this.height = height;
838 width == +width && (width += "px");
839 height == +height && (height += "px");
842 cs.clip = "rect(0 " + width + " " + height + " 0)";
844 setViewBox.apply(this, this._viewBox);
848 R._engine.setViewBox = function (x, y, w, h, fit) {
849 R.eve("setViewBox", this, this._viewBox, [x, y, w, h, fit]);
850 var width = this.width,
851 height = this.height,
852 size = 1 / mmax(w / width, h / height),
858 x -= (width - w * H) / 2 / H;
860 if (h * W < height) {
861 y -= (height - h * W) / 2 / W;
864 this._viewBox = [x, y, w, h, !!fit];
865 this._viewBoxShift = {
870 this.forEach(function (el) {
876 initWin = function (win) {
877 var doc = win.document;
878 doc.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
880 !doc.namespaces.rvml && doc.namespaces.add("rvml", "urn:schemas-microsoft-com:vml");
881 createNode = function (tagName) {
882 return doc.createElement('<rvml:' + tagName + ' class="rvml">');
885 createNode = function (tagName) {
886 return doc.createElement('<' + tagName + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');
891 R._engine.create = function () {
892 var con = R._getContainer.apply(0, arguments),
893 container = con.container,
900 throw new Error("VML container not found.");
902 var res = new R._Paper,
903 c = res.canvas = R._g.doc.createElement("div"),
907 width = width || 512;
908 height = height || 342;
911 width == +width && (width += "px");
912 height == +height && (height += "px");
913 res.coordsize = zoom * 1e3 + S + zoom * 1e3;
914 res.coordorigin = "0 0";
915 res.span = R._g.doc.createElement("span");
916 res.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;";
917 c.appendChild(res.span);
918 cs.cssText = R.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden", width, height);
919 if (container == 1) {
920 R._g.doc.body.appendChild(c);
923 cs.position = "absolute";
925 if (container.firstChild) {
926 container.insertBefore(c, container.firstChild);
928 container.appendChild(c);
931 // plugins.call(res, res, R.fn);
932 res.renderfix = function () {};
935 R.prototype.clear = function () {
936 R.eve("clear", this);
937 this.canvas.innerHTML = E;
938 this.span = g.doc.createElement("span");
939 this.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";
940 this.canvas.appendChild(this.span);
941 this.bottom = this.top = null;
943 R.prototype.remove = function () {
944 R.eve("remove", this);
945 this.canvas.parentNode.removeChild(this.canvas);
946 for (var i in this) {
947 this[i] = removed(i);