Fix for bug #111
parent
74cbaf763b
commit
1ae1f20d48
File diff suppressed because one or more lines are too long
|
@ -2027,8 +2027,8 @@ function getSomeDefs(el) {
|
|||
if (cache && contains(cache.ownerDocument.documentElement, cache)) {
|
||||
return cache;
|
||||
}
|
||||
var p = el.paper ||
|
||||
(el.node.parentNode && Snap(el.node.parentNode)) ||
|
||||
var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||
|
||||
(el.node.parentNode && wrap(el.node.parentNode)) ||
|
||||
Snap.select("svg") ||
|
||||
Snap(0, 0),
|
||||
defs = p.select("defs").node;
|
||||
|
@ -3086,8 +3086,14 @@ Snap.parse = function (svg) {
|
|||
}
|
||||
div.innerHTML = svg;
|
||||
svg = div.getElementsByTagName("svg")[0];
|
||||
while (svg && svg.firstChild) {
|
||||
f.appendChild(svg.firstChild);
|
||||
if (svg) {
|
||||
if (full) {
|
||||
f = svg;
|
||||
} else {
|
||||
while (svg.firstChild) {
|
||||
f.appendChild(svg.firstChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
div.innerHTML = E;
|
||||
return new Fragment(f);
|
||||
|
@ -5979,7 +5985,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
|
|||
};
|
||||
}
|
||||
var aUnit = a.match(reUnit),
|
||||
bUnit = b.match(reUnit);
|
||||
bUnit = Str(b).match(reUnit);
|
||||
if (aUnit && aUnit == bUnit) {
|
||||
return {
|
||||
from: parseFloat(a),
|
||||
|
|
|
@ -5709,7 +5709,7 @@ If key is not provided, removes all the data of the element.
|
|||
|
||||
<article id="Fragment.select">
|
||||
<header>
|
||||
<h3 class="dr-method">Fragment.select()<a href="#Fragment.select" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2356 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2356">➭</a></h3>
|
||||
<h3 class="dr-method">Fragment.select()<a href="#Fragment.select" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2362 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2362">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Fragment.select-extra"></div>
|
||||
|
@ -5734,7 +5734,7 @@ If key is not provided, removes all the data of the element.
|
|||
|
||||
<article id="Fragment.selectAll">
|
||||
<header>
|
||||
<h3 class="dr-method">Fragment.selectAll()<a href="#Fragment.selectAll" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2363 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2363">➭</a></h3>
|
||||
<h3 class="dr-method">Fragment.selectAll()<a href="#Fragment.selectAll" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2369 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2369">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Fragment.selectAll-extra"></div>
|
||||
|
@ -5759,7 +5759,7 @@ If key is not provided, removes all the data of the element.
|
|||
|
||||
<article id="Snap.fragment">
|
||||
<header>
|
||||
<h3 class="dr-method">Snap.fragment(varargs)<a href="#Snap.fragment" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2374 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2374">➭</a></h3>
|
||||
<h3 class="dr-method">Snap.fragment(varargs)<a href="#Snap.fragment" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2380 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2380">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Snap.fragment-extra"></div>
|
||||
|
@ -5819,7 +5819,7 @@ If key is not provided, removes all the data of the element.
|
|||
|
||||
<article id="Paper.el">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.el(name, attr)<a href="#Paper.el" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2575 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2575">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.el(name, attr)<a href="#Paper.el" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2581 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2581">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.el-extra"></div>
|
||||
|
@ -5909,7 +5909,7 @@ var c = paper.el("circle").attr({
|
|||
|
||||
<article id="Paper.rect">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.rect(x, y, width, height, [rx], [ry])<a href="#Paper.rect" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2598 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2598">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.rect(x, y, width, height, [rx], [ry])<a href="#Paper.rect" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2604 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2604">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.rect-extra"></div>
|
||||
|
@ -6009,7 +6009,7 @@ var c = paper.rect(40, 40, 50, 50, 10);</code></pre></section>
|
|||
|
||||
<article id="Paper.circle">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.circle(x, y, r)<a href="#Paper.circle" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2635 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2635">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.circle(x, y, r)<a href="#Paper.circle" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2641 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2641">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.circle-extra"></div>
|
||||
|
@ -6097,7 +6097,7 @@ var c = paper.rect(40, 40, 50, 50, 10);</code></pre></section>
|
|||
|
||||
<article id="Paper.image">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.image(src, x, y, width, height)<a href="#Paper.image" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2667 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2667">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.image(src, x, y, width, height)<a href="#Paper.image" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2673 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2673">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.image-extra"></div>
|
||||
|
@ -6219,7 +6219,7 @@ var c = paper.rect(40, 40, 50, 50, 10);</code></pre></section>
|
|||
|
||||
<article id="Paper.ellipse">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.ellipse(x, y, rx, ry)<a href="#Paper.ellipse" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2710 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2710">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.ellipse(x, y, rx, ry)<a href="#Paper.ellipse" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2716 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2716">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.ellipse-extra"></div>
|
||||
|
@ -6310,7 +6310,7 @@ var c = paper.rect(40, 40, 50, 50, 10);</code></pre></section>
|
|||
|
||||
<article id="Paper.path">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.path([pathString])<a href="#Paper.path" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2755 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2755">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.path([pathString])<a href="#Paper.path" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2761 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2761">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.path-extra"></div>
|
||||
|
@ -6578,7 +6578,7 @@ Note: there is a special case when a path consists of only three commands: <code
|
|||
|
||||
<article id="Paper.g">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.g([varargs])<a href="#Paper.g" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2786 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2786">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.g([varargs])<a href="#Paper.g" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2792 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2792">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.g-extra"></div>
|
||||
|
@ -6687,7 +6687,7 @@ g.add(c2, c1);</code></pre></section>
|
|||
|
||||
<article id="Paper.group">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.group()<a href="#Paper.group" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2792 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2792">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.group()<a href="#Paper.group" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2798 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2798">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.group-extra"></div>
|
||||
|
@ -6712,7 +6712,7 @@ g.add(c2, c1);</code></pre></section>
|
|||
|
||||
<article id="Paper.text">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.text(x, y, text)<a href="#Paper.text" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2820 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2820">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.text(x, y, text)<a href="#Paper.text" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2826 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2826">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.text-extra"></div>
|
||||
|
@ -6801,7 +6801,7 @@ var t2 = paper.text(50, 50, ["S","n","a","p"]);</code></pre></section>
|
|||
|
||||
<article id="Paper.line">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.line(x1, y1, x2, y2)<a href="#Paper.line" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2848 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2848">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.line(x1, y1, x2, y2)<a href="#Paper.line" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2854 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2854">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.line-extra"></div>
|
||||
|
@ -6892,7 +6892,7 @@ var t2 = paper.text(50, 50, ["S","n","a","p"]);</code></pre></section>
|
|||
|
||||
<article id="Paper.polyline">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.polyline(…)<a href="#Paper.polyline" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2877 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2877">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.polyline(…)<a href="#Paper.polyline" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2883 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2883">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.polyline-extra"></div>
|
||||
|
@ -7004,7 +7004,7 @@ var p2 = paper.polyline(10, 10, 100, 100);</code></pre></section>
|
|||
|
||||
<article id="Paper.polygon">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.polygon()<a href="#Paper.polygon" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2897 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2897">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.polygon()<a href="#Paper.polygon" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2903 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2903">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.polygon-extra"></div>
|
||||
|
@ -7029,7 +7029,7 @@ var p2 = paper.polyline(10, 10, 100, 100);</code></pre></section>
|
|||
|
||||
<article id="Paper.gradient">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.gradient(gradient)<a href="#Paper.gradient" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2950 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2950">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.gradient(gradient)<a href="#Paper.gradient" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2956 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2956">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.gradient-extra"></div>
|
||||
|
@ -7227,7 +7227,7 @@ half the width, from black to white:
|
|||
|
||||
<article id="Paper.toString">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.toString()<a href="#Paper.toString" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2966 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2966">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.toString()<a href="#Paper.toString" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2972 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2972">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.toString-extra"></div>
|
||||
|
@ -7269,7 +7269,7 @@ half the width, from black to white:
|
|||
|
||||
<article id="Paper.clear">
|
||||
<header>
|
||||
<h3 class="dr-method">Paper.clear()<a href="#Paper.clear" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2984 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2984">➭</a></h3>
|
||||
<h3 class="dr-method">Paper.clear()<a href="#Paper.clear" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 2990 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2990">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Paper.clear-extra"></div>
|
||||
|
@ -7294,7 +7294,7 @@ half the width, from black to white:
|
|||
|
||||
<article id="Snap.ajax">
|
||||
<header>
|
||||
<h3 class="dr-method">Snap.ajax(…)<a href="#Snap.ajax" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 3015 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3015">➭</a></h3>
|
||||
<h3 class="dr-method">Snap.ajax(…)<a href="#Snap.ajax" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 3021 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3021">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Snap.ajax-extra"></div>
|
||||
|
@ -7398,7 +7398,7 @@ half the width, from black to white:
|
|||
|
||||
<article id="Snap.load">
|
||||
<header>
|
||||
<h3 class="dr-method">Snap.load(url, callback, [scope])<a href="#Snap.load" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 3061 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3061">➭</a></h3>
|
||||
<h3 class="dr-method">Snap.load(url, callback, [scope])<a href="#Snap.load" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 3067 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3067">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Snap.load-extra"></div>
|
||||
|
@ -7447,7 +7447,7 @@ half the width, from black to white:
|
|||
|
||||
<article id="Snap.getElementByPoint">
|
||||
<header>
|
||||
<h3 class="dr-method">Snap.getElementByPoint(x, y)<a href="#Snap.getElementByPoint" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 3490 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3490">➭</a></h3>
|
||||
<h3 class="dr-method">Snap.getElementByPoint(x, y)<a href="#Snap.getElementByPoint" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 3496 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3496">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Snap.getElementByPoint-extra"></div>
|
||||
|
@ -7532,7 +7532,7 @@ half the width, from black to white:
|
|||
|
||||
<article id="Snap.plugin">
|
||||
<header>
|
||||
<h3 class="dr-method">Snap.plugin(f)<a href="#Snap.plugin" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 3525 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3525">➭</a></h3>
|
||||
<h3 class="dr-method">Snap.plugin(f)<a href="#Snap.plugin" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 3531 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3531">➭</a></h3>
|
||||
</header>
|
||||
<section>
|
||||
<div class="extra" id="Snap.plugin-extra"></div>
|
||||
|
|
|
@ -137,7 +137,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
|
|||
};
|
||||
}
|
||||
var aUnit = a.match(reUnit),
|
||||
bUnit = b.match(reUnit);
|
||||
bUnit = Str(b).match(reUnit);
|
||||
if (aUnit && aUnit == bUnit) {
|
||||
return {
|
||||
from: parseFloat(a),
|
||||
|
|
14
src/svg.js
14
src/svg.js
|
@ -1279,8 +1279,8 @@ function getSomeDefs(el) {
|
|||
if (cache && contains(cache.ownerDocument.documentElement, cache)) {
|
||||
return cache;
|
||||
}
|
||||
var p = el.paper ||
|
||||
(el.node.parentNode && Snap(el.node.parentNode)) ||
|
||||
var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||
|
||||
(el.node.parentNode && wrap(el.node.parentNode)) ||
|
||||
Snap.select("svg") ||
|
||||
Snap(0, 0),
|
||||
defs = p.select("defs").node;
|
||||
|
@ -2338,8 +2338,14 @@ Snap.parse = function (svg) {
|
|||
}
|
||||
div.innerHTML = svg;
|
||||
svg = div.getElementsByTagName("svg")[0];
|
||||
while (svg && svg.firstChild) {
|
||||
f.appendChild(svg.firstChild);
|
||||
if (svg) {
|
||||
if (full) {
|
||||
f = svg;
|
||||
} else {
|
||||
while (svg.firstChild) {
|
||||
f.appendChild(svg.firstChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
div.innerHTML = E;
|
||||
return new Fragment(f);
|
||||
|
|
Loading…
Reference in New Issue