[selectors-api] NSResolver moving nodes between documents

What is the correct behavior if a lookupNamespaceURI call moves nodes 
between documents?  In particular, what is the correct behavior is the 
Element node the call is being made on is moved to a different document 
during the lookupNamespaceURI call (using adoptNode)?

The reason this matters is that the case-sensitivity of selectors 
depends on the host language.  At the moment, in Gecko, this is 
determined by the Document object.  In particular, the obvious object to 
use for purposes of querySelector(All) is the ownerDocument of the 
Element the method is called on (if the call is made on a Document, 
there is no problem here at all).  But if the ownerDocument can change 
during a lookupNamespaceURI call, then the parsed selector's 
case-sensitivity may no longer match the host language of the Element's 
ownerDocument.

The spec should clearly specify what a UA is expected to do here.  My 
personal preference is that if the ownerDocument has changed the UA 
should throw an exception, since there is no way to return a "correct" 
result at that point.

-Boris

Received on Wednesday, 12 March 2008 19:24:13 UTC