There is some weirdness using mozMatchesSelector in a GM-script in Firefox 4:
unsafeWindow.document.createElement('div'), 'div') // false, should be true
I created a userscript that contains more test cases: http://userscripts.org/scripts/review/98151
Go to https://www.mozilla.org/* and look into the console. It will most likely contain [ true, false, false, false]. Using Firefox 3.6 with the same setup gives [true, true, false, false]. I have also been checking 4b11, 4b10 and they also yield the wrong result.
[ true, false, false, false]
[true, true, false, false]
I know that is likely to a change in Fx 4 but I don't know enough about GMs internal architecture( XPCNativeWrapper) to dig deeper. This code might look like an edge-case but it is the pattern used by recent jQuery to match elements against selectors. So this will prevent people from being able to use jQuery in user scripts.
Maybe one of you has an idea what is wrong here.
Firefox 20.0 - [true, true, true, true]
[true, true, true, true]