Ticket #4351 (closed bug: worksforme)
INVALID_NODE_TYPE_ERR Uncaught exception / Selector engine
|Reported by:||357.gaby||Owned by:||john|
The problem pops up on line 714 of the selector component ( http://dev.jquery.com/browser/trunk/jquery/src/selector.js). As far as I can tell it only happens in Google Chrome. The reason for this is that only chrome enters that branch of the functions definition (For explorer it goes to in document.documentElement?, and for Firefox/Safari 4 it goes to [document.documentElement.compareDocumentPosition]).
This is the W3 spec for this method and relevant exception: http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113/ranges.html#Level2-Range-method-selectNode
I guess the error will probably disappear as soon as Chrome switches to the new WebKit engine (because that implements document.documentElement.compareDocumentPosition).
Unfortunately I don't have a popper test case. I'm working with some rather dynamic html content and as far as I have read and been able to test, the exception shouldn't happen. Unfortunately I haven't had much time to properly test this.
Nonetheless, no matter what html I give it, the error (Uncaught exception) really shouldn't happen.
I'm not very familiar with the operations the selector does so I can't really propose anything more than a try catch to fix this; as far as I can tell that will probably not affect the engine all that much (All the nodes will have an equal position, but the sortOrder function seems to be kind of optional (Before it's used there's a check for it's existence)).
Sorry for the general sloppiness of this ticket. It's 2:30 am :)