Skip to content

Commit

Permalink
Don't use xlink namespace for svg:use/@href.
Browse files Browse the repository at this point in the history
xlink:href on svg:use is deprecated, and browsers seem to have a problem
with that when the svg is included via ajax.

Fixes #14.
  • Loading branch information
thvitt committed Jan 28, 2018
1 parent 035da5c commit 8ecfcc6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions svg_rendering/page/js-gen/transcript-svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ if (window.FaustTranscript === undefined) {

FaustTranscript.CoveringImage.prototype.createView = function () {
this.spanningImage = this.svgDocument().createElementNS(SVG_NS, 'use');
this.spanningImage.setAttributeNS('http://www.w3.org/1999/xlink', 'href', this.imageUrl);
this.spanningImage.setAttribute('href', this.imageUrl);
this.spanningImage.setAttribute('class', this.type);
this.spanningImage.setAttribute('x', 0);
this.spanningImage.setAttribute('y', 0);
Expand Down Expand Up @@ -321,7 +321,7 @@ if (window.FaustTranscript === undefined) {

FaustTranscript.SpanningVC.prototype.createView = function () {
this.spanningRect = this.svgDocument().createElementNS(SVG_NS, 'use');
this.spanningRect.setAttributeNS('http://www.w3.org/1999/xlink', 'href', this.imageUrl);
this.spanningRect.setAttribute('href', this.imageUrl);
this.spanningRect.setAttribute('class', this.type);
this.spanningRect.setAttribute('x', 0);
this.spanningRect.setAttribute('y', 0);
Expand Down Expand Up @@ -399,7 +399,7 @@ if (window.FaustTranscript === undefined) {
g.setAttribute('class', this.type);
this.graphic.setAttribute('width', this.imageWidth);
this.graphic.setAttribute('height', this.imageHeight);
this.graphic.setAttributeNS('http://www.w3.org/1999/xlink', 'href', this.imageUrl);
this.graphic.setAttribute('href', this.imageUrl);
g.setAttribute('vector-effect', 'non-scaling-stroke');
var transform = "scale(" + this.displayWidth / this.imageWidth + "," + this.displayHeight / this.imageHeight + ")";
this.graphic.setAttribute('transform', transform);
Expand Down

0 comments on commit 8ecfcc6

Please sign in to comment.