webcomponents.js alters feature detection of querySelectorAll in Firefox

36 views
Skip to first unread message

Adrien Di Mascio

unread,
Mar 20, 2015, 2:36:01 PM3/20/15
to polym...@googlegroups.com
Hi all,

Thanks for webcomponents.js, I think it's a great step towards better web applications !

I've just noticed that webcomponents.js wraps document.querySelectorAll in Firefox (only tested in version 38.0a2). I don't know if that's intended but one consequence is that jQuery thinks firefox has no native support for document.querySelectorAll. The way jQuery tests that is:

var rnative = /^[^{]+\{\s*\[native \w/;
// then
rnative.test(document.querySelectorAll);

I found that trying to use $('body /deep/ div') which worked well on chrome and FF, but not in FF with webcomponents.js included.

I've made 2 js fiddles to expose the problem:

- without webcomponents.js: http://jsfiddle.net/vL8hwkhm/
- with webcomponents.js: http://jsfiddle.net/6z9ubjze/3/

Is this expected ?

Cheers,
Adrien.
Reply all
Reply to author
Forward
0 new messages