compareDocumentPosition is a terrible API but I guess there is nothing preventing implementors to optimize the case where one node is the document.
erik On Mon, Aug 29, 2011 at 17:25, Ryosuke Niwa <[email protected]> wrote: > On Mon, Aug 29, 2011 at 5:21 PM, Bjoern Hoehrmann <[email protected]> wrote: >> >> This is addressed by Node.compareDocumentPosition. Have you missed this >> or is there some problem making that perform properly? > > Node.compareDocumentPosition is O(n) when both node are in the same > document. > - Ryosuke >
