Make sure that [name=foo] and #id selectors don't use the native methods on XML documents (since id and name attributes may not be defined by a DTD and will return nothing instead. Fixes jQuery bug #3945.

Now handle the case where Safari's querySelectorAll fails on uppercase characters in quirks mode. Added a test to check for it and re-worked some of the existing tests to better handle document order issues. Fixes jQuery bug #3840.

After discussing it with a number of users I've decided to revert the change to [name!=value]. It is now equal to :not([attr!=value]). Attempting to switch it to [attr]:not([attr!=value]) produced some really non-obvious results and confused users. Fixes jQuery bug #3884.