After thinking more about this we believe that moving contains to Node is a better alternative. The problem with Node inDocument is that it does not say which document it is in so code would need to also check ownerDocument to be robust in the presence of frames and multiple windows.
erik On Tue, Aug 30, 2011 at 03:02, Anne van Kesteren <[email protected]> wrote: > On Tue, 30 Aug 2011 11:58:21 +0200, Robin Berjon <[email protected]> wrote: >> >> But node.ownerDocument.contains(node) isn't. There's no doubt that >> node.inDocument is less error-prone though. > > Depends on the use case. The thread started with "the document" in which > case you want document.contains(). > > > -- > Anne van Kesteren > http://annevankesteren.nl/ >
