-
-
Notifications
You must be signed in to change notification settings - Fork 233
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/10 multiple argument remove and add not working due to SVG test #54
Comments
@eligrey Same here. This entire year has been very busy at work, but I think I can work on this next week. I'll create a pull request when ready. |
Already done: #53 |
Morning @stevenvachon. Thank you for pointing out issue #44. I had not realized that issue is related. I looked into the IE10 / 11 problem this past weekend and have a good idea of the cause. Issue #33's discussion does not appear to completely understand the root cause of the problem. I also reviewed your code this morning while on the subway, and I like a number of changes you made, but do not see you addressing the IE10 / 11 issue. Could you explain? Your modification to the if statement for the first block has a small mistake which will cause major issues. You modified the if to say: The problem is that you are creating the Your code is actually testing if there is classList support in HTMLElement which is the same as what the first part of the if is doing. As a result of your new if statement IE 10 and 11 do not run the first block of code, and get to the else instead. While this will add multiple argument support to @eligrey do you want to merge in @stevenvachon changes (minus the if statement) anyway? I should still have time later this week to address the IE10/11 issue. I know what the issue is but want to think through the solution a little more first before submitting a pull request. |
@stevenvachon Oops sorry about that. I meant #53 not 33. I took a quick look at the tests in your branch and see they have the same flaw which is why the current code is passing the unit tests. Try running this in IE11 in the console: Then try: Without specifying the namespace the element being created is an For the unit test I highly recommend putting SVG artwork on the HTML page and test using that instead of generating SVG elements. via Javascript This more "real life" test will be more of an accurate test in my opinion. BTW, the |
I don't see much reason to keep the partial implementation check & upgrade quarantined in the Pull opened: #57 |
Isn't this issue a duplicate of: #44 |
For anybody interested: Let me know if there is anything I can do to help, but it looks like @beck has this handled. If you want me to expand the test cases or anything let me know. (... Otherwise, I'm going to go review the meaning of "shim" vs "polyfill" cause I feel like an idiot since I know I'm using them wrong.) |
@eligrey @stevenvachon @beck will work - https://jsfiddle.net/englishextra/hru3Lt77/ Had to use th latter commit, wondering why the current release doesnt get merged with beck's pr #57 |
@beck is the worst though (for reasons unrelated to this conversation). |
@stevenvachon Yes. eligrey. Thanks for your response. Thanks. |
Fix merged. Published at: https://github.com/yola/classlist-polyfill |
Near the top of the code you check for:
!("classList"
in document.createElementNS("http://www.w3.org/2000/svg","g"))IE11 and 10 will fail that test and therefore should run the code for the polyfill. But, IE11 and 10 do provide native support but lacks SVG support and lacks multiple classname arguments for add() and remove(). (Reference: http://caniuse.com/#search=classlist)
The code within the else of that same if statement contains a polyfill to add multiple argument support to add() and remove(). There is a comment in that block of code that says "Polyfill for IE 10/11 and Firefox <26." But IE11 does not get to that point.
Are you still maintaining this library? If you are no longer maintaining, please let me know if there is a reason you stopped other than limited time to so do. If you believe addressing this potential bug is needed but you don't have time, let me know and I'd be happy to dig in deeper.
BTW, I took a quick look at the unit tests and it appears we may be should add testing of multiple arguments for add() and remove() as well.
The text was updated successfully, but these errors were encountered: