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

IE11/Edge: Lit Markers within SVG causes errors. #250

Closed
2 of 6 tasks
deepsnitk opened this issue Oct 6, 2018 · 3 comments
Closed
2 of 6 tasks

IE11/Edge: Lit Markers within SVG causes errors. #250

deepsnitk opened this issue Oct 6, 2018 · 3 comments

Comments

@deepsnitk
Copy link

deepsnitk commented Oct 6, 2018

Description

When using the 'svg' tagged template of lit-element, if the content within it has a 'path' element for which the 'd' attribute is dynamically set, then the 'd' attribute will be missing in IE11/Edge16 with an error: SVG4601: SVG Path data has incorrect format and could not be completely parsed.
Since 'd' determines the path, there is nothing displayed.

Live Demo

https://astonishing-purpose.glitch.me/

Steps to Reproduce

Inside 'svg' tagged template literal add 2 elements:

  1. An SVG with only static values.
  2. Another SVG same as above but with the nested 'path' element having dynamic 'd' value.

Expected Results

Output should render 2 SVG elements.

Actual Results

Chrome: Both SVGs are visible as expected.
IE11/Edge16: Only one SVG is rendered onto the browser.

Browsers Affected

  • IE 11
  • Edge
  • Chrome
  • Firefox
  • Safari 11
  • Safari 10

Versions

  • lit-element: v0.6.1
  • webcomponents: v2.1.3
@deepsnitk
Copy link
Author

deepsnitk commented Oct 6, 2018

From my analysis, it looks like the following could be the culprit in IE11/Edge:
template.innerHTML = this.getHTML();
The 'd' attribute with random value like below is considered invalid:
<path class="slice extended" d={{lit-7566279216523466}} fill="{{lit-7566279216523466}}" />

@deepsnitk deepsnitk changed the title IE11/Edge: Dynamic value for 'd' in 'path' element within SVG fails IE11/Edge: Lit Markers within SVG causes errors. Oct 8, 2018
@deepsnitk
Copy link
Author

I think angular has a solution to this late binding attribute problem in SVG: angular/angular.js#2061

@justinfagnani
Copy link
Contributor

This is just a dupe of the upstream lit-html issue you filed: lit/lit#594. Let's just track there. Otherwise we could duplicate every lit-html issue here.

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

2 participants