W3C home > Mailing lists > Public > public-webapi@w3.org > April 2008

Re: [selectors-api] NSResolver moving nodes between documents

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Mon, 14 Apr 2008 22:22:23 +0200
To: "Hallvord R. M. Steen" <hallvord@opera.com>
Cc: "Web APIs WG (public)" <public-webapi@w3.org>
Message-ID: <9md704ljq698g33rk5bn9fmtpukb6de2e6@hive.bjoern.hoehrmann.de>

* Hallvord R. M. Steen wrote:
>What I've understood: it's proposed that if the custom lookupNamespaceURI  
>function moves nodes between documents, the implementation trying to use  
>the NSResolver (may|must) throw an error. I don't see why we can't specify  
>that unless we specify "when and how many times the resolver is invoked".

That could be done, but it would have little benefit at a high cost
(more specification text to read for everyone, more tests to write,
implementations cannot choose some better behavior, ... versus more
consistent implementation behavior in a rather hypothetical case of
incorrect code).

>"If the custom lookupNamespaceURI function moves nodes between documents,  
>the implementation trying to use the NSResolver MUST throw an error."

If there should be a rule for mutations of the document from inside the
namespace resolver, it should cover all the mutations, not pick some un-
usual case. Further note that implementations would still differ, e.g.,
consider the selector

  a|b > c|d > :not(*|*)

Some implementations might resolve a,c, others c,a, and yet others none
of the prefixes because they immediately saw it does not match anything.
So I would find it preferable, if this needs to be addressed, that the
prefix resolution is made predictable, so that all mutations from inside
the resolver become predictable, or that the DOM is locked while the
query is evaluated, or that all mutations result in an error, not just
node movements between documents, but I don't think this needs to be de-
fined at all.
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Monday, 14 April 2008 20:23:08 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:26 UTC