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

[ember 3.1.0-beta.1] viewBox attribute on SVG component has incorrect capitalization #16477

Closed
mlwilkerson opened this issue Apr 10, 2018 · 6 comments · Fixed by glimmerjs/glimmer-vm#801

Comments

@mlwilkerson
Copy link

Summary

When rendering a component with tagName of svg and a bound viewBox attribute, the resulting DOM element has attribute viewbox (without the capital B).

Impact: the SVG will have the wrong size. (Observed in Chrome).

Here is a reproduction of the issue.
(I couldn't figure out how to JSBin or Ember-Twiddle it).

This problem does not exist in ember 3.0.0.

Similar past issue: #10303

@st-h
Copy link
Contributor

st-h commented Apr 11, 2018

looks like this also applies to the 3.1.0 release

possibly #16311 is related

@rwjblue
Copy link
Member

rwjblue commented Apr 11, 2018

Yes, I agree I believe #16311 is related.

@st-h
Copy link
Contributor

st-h commented Apr 19, 2018

Copied over from #16311 as it seems this apply to this issue only

st-h:
I tried to create a test first, however my efforts to write something that matches the current implementations only showed that the current test setup happily accepts any diffs in case sensitive bindings (both in glimmer.vm and ember.js). Probably the test helpers should be refined... However, there are too many internals involved and I don't know the codebase well enough to make a substantial decision here.
So, I continued to find out what is actually going wrong and I believe to have found the offending commit / code. This essentially changed using the lower case name of the attribute when setting it within the install method
Yet again, being very new to the ember/glimmer internals, I don't feel comfortable deciding what is the best way to fix this. I am happy to help getting this done with a little support though.

rwjblue:
Hmm. That change definitely does odd. Do Ember's own tests pass if you remove that .toLowerCase()? I'm unsure how this could be the cause of <button onClick=(action 'foo')></button)> not working because it seems like it would only be related to component's attribute bindings right?

st-h:
@rwjblue maybe I should have posted that to the svg related issue, as I am not totally sure if both issues really do have the same cause. However, I was specifically looking why an attributeBinding like viewBox would end up as viewbox.
If I do make requested change there is one test which fails, which specifically tests for case insensitivity. Honestly this seems a little odd to me, since I am not used to js being case insensitive.

@rwjblue
Copy link
Member

rwjblue commented Apr 20, 2018

Thank you for all that sleuthing @st-h, it is very helpful!

ef4 added a commit to glimmerjs/glimmer-vm that referenced this issue Apr 21, 2018
This (along with some changes to Ember that I will also PR) solves emberjs/ember.js#16311 and emberjs/ember.js#16477

This is not ready to go yet because I'm also going to refactor so we don't compute the normalized property name twice.
ef4 added a commit to glimmerjs/glimmer-vm that referenced this issue Apr 21, 2018
This (along with some changes to Ember that I will also PR) solves emberjs/ember.js#16311 and emberjs/ember.js#16477
@st-h
Copy link
Contributor

st-h commented Apr 21, 2018

@rwjblue happy that this was helpful. I tried to fix that issue yesterday, but came along way too many questions regarding which direction things should actually go and what has been intended and what not. Tried to get some help on slack, but I guess everybody was busy. Happy to see that this is fixed now.

rwjblue pushed a commit to glimmerjs/glimmer-vm that referenced this issue Apr 21, 2018
This (along with some changes to Ember that I will also PR) solves emberjs/ember.js#16311 and emberjs/ember.js#16477

(cherry picked from commit 014ed47)
@rwjblue
Copy link
Member

rwjblue commented Apr 21, 2018

FYI - The fix for this has been pulled into release (for 3.1.x release) and beta (for 3.2.0-beta.x release). The latest builds (in 10-15 minutes) to the release, beta, and canary channels should include the fix (you can get the latest tarball URL via ember-source-channel-url).

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

Successfully merging a pull request may close this issue.

3 participants