OK, I got this in the IE8 debugger. The problem is that Sizzle walks up to the document and then in ATTR tries to call elem.getAttribute("lang") but there is no getAttribute method on document. I guess we could check for elem.getAttribute being present?