Jqlite ClassList - gingerbread


#1

I have had problems with older versions of Android, specifically with gingerbread. Checking the “logcat” I found that the property ClassList was undefined. I changed all the lines of code that referenced ClassList and it worked.


#2

I had a similar issue. I just used one of the classlist polyfills at the Modernizr site.


#3

I added the minimal classList polyfill to poly.js.

Also, the jqLite.addClass and .removeClass use classList in the backend now. The goal is to reduce DOM manipulations, and with the devices we support we shouldn’t have the same support issues something like jQuery itself would have when trying to use classList.

For example, jQuery supports everything, so to get classList to work everywhere would take a large amount of code, which is why they don’t do it and its not guaranteed to speed things up.

In our case I feel the pros out-weigh the cons since a small amount of code is required for the polyfill (like 600 bytes), and we’re able to reduce unnecessary DOM manipulations, which is a big deal for improving performance.


#4

Perfect.

All is correct.

Thanks