chemerisuk/better-dom

browser / qsa issues

Opened this issue · 2 comments

I notice that you are supporting a lot of browsers:

  • Chrome
  • Safari 6.0+
  • Firefox 16+
  • Internet Explorer 8+ (see notes)
  • Opera 12.10+

and Android 2.3

But what I can't figure out is how your find / findAll method are going to work on some of this browsers. Look at this link: http://caniuse.com/#feat=queryselector

QSA are not supported in Android 2.3, but your find method are only using QSA as far as I see.

The same for some of the other browsers better-dom are supporting.

What is the work-a-round for this things?

There are also a whole bunch of QSA bugs related to older browsers, not taken care of. But I assume that is swallowed inside your try / catch

But there are a few other places you are using QuerySelectorAll without wrapping it in a try / catch, so I guess that will throw error in older browsers?

And how is your extension function going to work without QSA for older browsers that you are supporting??

Example:

  util$index$$default.each.call(DOCUMENT.querySelectorAll(selector), ext);
        // MUST be after querySelectorAll because of legacy IEs quirks
           DOM.importStyles(selector, global$extend$$cssText);

How is this code going to be supported in Android 2.3 and other browsers that don't have QSA?

There are also issues with matchesSelector the same way. Look here:
http://caniuse.com/#feat=matchesselector

As a workaround here, you are using qsa, but what you do for the browsers that don't support QSA?? Then matchesSelector will break, or I'm wrong here??

@justmeandtaken you are wrong. Android 2.3 supports querySelector and matches both, and your caniuse links clearly explain that. Moreover I have a real test device with android 2.3 that use from time to time to check test suite for a new version. Also, I developed a mobile app using better-dom that is used by various android 2.3 devices and haven't noticed any errors related to that. Therefore I'm very confident about the browser support.

Ok. I got it. Then John Resigg, Sizzle selector engine and other sources are wrong, and you are right. They sated that IE8 are a nightmare, you are not checking things here. Older browsers as well. As you write here is only about Android 2.3. Read blogs from John Resign, take a look at the Document() function inside Sizzle source, or look at the source in Slick() for Mootools. They all prove what I wrote above. But you stick with your Andrid 2.3 and things will be just fine.

Just for reference, I add this links:

https://github.com/dperini/nwmatcher/blob/master/src/nwmatcher.js#L346
https://github.com/dperini/nwmatcher/blob/master/src/nwmatcher.js#L369
https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L653
https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L641