Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<image> tag causes error in firefox #349

Closed
ghost opened this issue Mar 31, 2015 · 3 comments
Closed

<image> tag causes error in firefox #349

ghost opened this issue Mar 31, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 31, 2015

export to canvas works ok for me, thank you for the software.

but causes error when trying in firefox, no matter <image / > or <image></image> is used.
errors in can be different -so far i saw
'prefix not bound to namespace' (and it points to when i click the error message),
and 'no closing tag, expected ' or so (and it points just before closing tag then)

it seems that for some reason firefox starts to parse whole window dom tree when it encounters in target svg (and it fails for html5 doc, which is ok). when i remove , export works ok in firefox. in chromium it works finr.

generated svg originates from following template:

    <svg xmlns="http:// www.w3.org/2000/svg"
     class="field {{selectedName}}-field {{#if rotated}}viewport_90cw{{/if}}"
     viewBox="{{#if rotated}}{{y}} {{x}} {{h}} {{w}}{{else}}{{x}} {{y}} {{w}} {{h}}{{/if}}"
     data-id="{{id}}" id="{{name}}">

    <g class="field" transform="{{#if rotated}}rotate(90, 0, 0){{/if}}">
        {{#if fieldImage}}
            <image xlink:href="{{fieldImage.url}}" x="{{x}}" y="{{y}}"
                   width="{{w}}" height="{{h}}">
            </image>{{/if}}
    </g>
    <g class="players">{{> Players rotated=rotated players=_players }}</g>
</svg>

it produces xlink:href in relative form ('/img/image.jpg'), yet same result i saw when used absolute url

@DorianGrey
Copy link

We've also encountered this problem - and by taking a closer look at the svg, it seems that the explicit declaration of xlink is missing in the svg node:

xmlns:xlink="http://www.w3.org/1999/xlink"

Dunno why it is missing, but if it is added manually before forwarding the node, if works fine - at least for data URLs. Maybe you can check if this works in you case as well?

We've also faced this in various versions of IE and Safari; funny to see that it works without this attribute in Chrome/Chromium - it should not.

@gabelerner
Copy link
Member

the current master allows for 'href' or 'xlink:href'

@ravend7
Copy link

ravend7 commented Dec 18, 2015

Hi!
Why convert does not work?
work:
http://jsfiddle.net/L3hondLn/301/
don't work:
http://jsfiddle.net/L3hondLn/300/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants