-
Notifications
You must be signed in to change notification settings - Fork 27.4k
WIP: perf(jqLite): use classList for add/removeClass #7829
Conversation
All elements/browsers that don't have classList will still use the old setTimeout method.
All elements/browsers that don't have classList will still use the old setAttribute method
@mzgol would know this better than me, but I'm fairly certain I recall jQuery opting to avoid classList because it hurt performance rather than helped it, in addition to requiring multiple code paths. I'm not sure this is actually a performance "fix", possibly a regression, although it's not likely that we can actually measure a significant difference given that class operations are not super common |
and yeah, (old) opera (~v12-ish) and possibly old IE browsers don't deal with the multiple args to classList apis correctly :( |
This is here because we won't merge them from #7759 for the next release. We might consider not merging them at all later on. |
@rodyhaddad you beat me while I was writing my comment :) |
@lgalfaso Yes, didn't want to lose track of it :-) |
anyways, I am not big on having piles of paths for this stuff, if it's going to be done, we should decide which path to take before binding jqLite (and this kind of sucks for maintenance, too) |
we are going to skip this one until IE has better support |
Sorry to be late for the party but yeah, apart from IE9 not supporting
IMO it'll make sense to switch to |
@mzgol Thanks for all the info! |
Continuation of #7759
Using
classList.apply
caused problems in IE 10/11.I believe we still want these changes for performance, but not yet.
So keeping them here for being considered later.