-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Binding type attribute on a button element fails in PhantomJS #11112
Comments
We changed from using jQuery to set |
Ok, thanks for clarification. var el = document.createElement('button');
el.setAttribute('type','submit');
console.log(el.getAttribute('type')); // output is: submit
var el2 = document.createElement('button');
el2.type = 'submit';
console.log(el2.getAttribute('type')); // output is: null I am not so sure how the exact DOM specification is, can this be regarded a bug in Phantom? If so, I can file a bug report for PhantomJS, but any chance to have a workaround in ember in the meantime? |
We are not using var el = document.createElement('button');
el['type'] = 'submit'; Which apparently throws an error in PhantomJS. |
Yes, I did understand that. That's what I tested with So back to my other question: can we clearly blame PhantomJS here for being not standards compliant, or aren't we supposed to use |
HA! Indeed you did, sorry about that!
Yes, I think we can.
It is possible for us to work around (we did a similar thing in #10690 for @mixonic - Thoughts? |
@rwjblue it would fix this and the other issue if we just whitelisted If so, I'm all for it. |
@mixonic I'll confirm, but yes I think that is correct. |
Experiencing something similar in Emberx-select. The form attr is no long binding to the select: Failing build: https://travis-ci.org/thefrontside/emberx-select/jobs/62926462 Any suggestions? |
|
@stefanpenner confirmed! However
|
This is because the type of You can fix the tests in your repo by not using Further reading (credit to @mixonic for all of the correct details, any mistakes are mine 😄 ): |
good point |
more thoughts: tildeio/htmlbars#353 (comment) |
…erjs/ember.js#11112. Another one is still failing
Another one:
It's getting funny! :) @rwjblue Thanks for that |
i think some IE have this issue as-well. |
@bcardarella You can tell travis to use phantom 2: https://github.com/truenorth/ember-cli-materialize/blob/master/.travis.yml#L20 Credit to @truenorth |
Just chiming in to confirm this is non-compliance of the spec in phantomjs et al. Whack a mole fixes 👍 Assuming I'm not drunk, here's a PR to fix tildeio/htmlbars#355 |
…bute because of browser compliance issues, fixes emberjs/ember.js#11112
…bute because of browser compliance issues, fixes emberjs/ember.js#11112
…bute because of browser compliance issues, fixes emberjs/ember.js#11112
…bute because of browser compliance issues, fixes emberjs/ember.js#11112
…bute because of browser compliance issues, fixes emberjs/ember.js#11112
Some unit tests testing for correct HTML attributes, bound via
attributeBindings
on a<button>
component, started to fail suddenly using Ember 1.11 in https://github.com/kaliber5/ember-bootstrap.I created a separate repository to isolate that possible bug: https://github.com/simonihmig/ember-bind-attributes-test
There you will find a button component, with its
type
set tosubmit
viaattributeBindings
, tested with a unit test. And a simple<button {{bind-attr type=buttonType}}>
HTML element (using old style attribute bindings for 1.10 compatibility), tested with an acceptance test.Running
ember try:testall
will run both tests, using ember-try with 1.10, 1.11, beta and canary, in PhantomJS as well as Chrome.The results are:
attributeBindings
) has notype
attribute in PhantomJS, for Ember 1.11, beta and canary, so tests fail. The test for Ember 1.10 succeeds though! Something probably must have changed here, maybe related to http://emberjs.com/blog/2015/03/27/ember-1-11-0-released.html#toc_bound-attribute-syntax{{bind-attr}}
) fails in PhantomJS, for all Ember versions!!? Strange...I also added tests for some other button properties, like
role="button"
, but these seem to be ok. So there seems to be some spacial case here for thetype
attribute in PhantomJS. One could blame PhantomJS solely here, but that would not explain why the button component tests starts failing only beginning with Ember 1.11.Although normal Browsers does not seem to be affected, it would still be very nice to have this fixed, for CI tests where PhantomJS plays its role...
The text was updated successfully, but these errors were encountered: