Re: [whatwg] Node inDocument

2011-09-02 Thread Jonas Sicking
On Thursday, September 1, 2011, Ryosuke Niwa rn...@webkit.org wrote: On Thu, Sep 1, 2011 at 6:56 PM, James Robinson jam...@google.com wrote: What is the expected behavior for nodes in iframes? IOW, with this sort of DOM: body iframe id=a iframe id=b div id=node Let me first

Re: [whatwg] Node inDocument

2011-09-02 Thread Ryosuke Niwa
On Fri, Sep 2, 2011 at 8:31 AM, Jonas Sicking jo...@sicking.cc wrote: On Thursday, September 1, 2011, Ryosuke Niwa rn...@webkit.org wrote: On Thu, Sep 1, 2011 at 6:56 PM, James Robinson jam...@google.com wrote: What is the expected behavior for nodes in iframes? IOW, with this sort of

Re: [whatwg] Node inDocument

2011-09-02 Thread Jonas Sicking
On Fri, Sep 2, 2011 at 10:00 AM, Ryosuke Niwa rn...@webkit.org wrote: On Fri, Sep 2, 2011 at 8:31 AM, Jonas Sicking jo...@sicking.cc wrote: On Thursday, September 1, 2011, Ryosuke Niwa rn...@webkit.org wrote: On Thu, Sep 1, 2011 at 6:56 PM, James Robinson jam...@google.com wrote: What

Re: [whatwg] Node inDocument

2011-09-01 Thread Anne van Kesteren
On Thu, 01 Sep 2011 00:18:26 +0200, Erik Arvidsson a...@chromium.org wrote: 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

Re: [whatwg] Node inDocument

2011-09-01 Thread James Robinson
On Thu, Sep 1, 2011 at 1:39 AM, Anne van Kesteren ann...@opera.com wrote: On Thu, 01 Sep 2011 00:18:26 +0200, Erik Arvidsson a...@chromium.org wrote: After thinking more about this we believe that moving contains to Node is a better alternative. The problem with Node inDocument is that it

Re: [whatwg] Node inDocument

2011-08-31 Thread Erik Arvidsson
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

Re: [whatwg] Node inDocument

2011-08-30 Thread James Graham
On 08/30/2011 10:44 AM, Anne van Kesteren wrote: On Tue, 30 Aug 2011 10:38:19 +0200, Jonas Sicking jo...@sicking.cc wrote: In general I think it's better to have functions that deal with child lists on Node rather than on Element/Document/DocumentFragment. I think it might still make sense to

Re: [whatwg] Node inDocument

2011-08-30 Thread Robin Berjon
On Aug 30, 2011, at 11:40 , James Graham wrote: On 08/30/2011 10:44 AM, Anne van Kesteren wrote: On Tue, 30 Aug 2011 10:38:19 +0200, Jonas Sicking jo...@sicking.cc wrote: In general I think it's better to have functions that deal with child lists on Node rather than on

Re: [whatwg] Node inDocument

2011-08-30 Thread Anne van Kesteren
On Tue, 30 Aug 2011 11:58:21 +0200, Robin Berjon ro...@berjon.com 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().

[whatwg] Node inDocument

2011-08-29 Thread Erik Arvidsson
As we were looking at mutation events we realized that we would like to expose whether a Node is in the document or not. Both WebKit and Gecko have an O(1) way of determine this. Today, to do this in script this is O(depth) which is clearly sub optimal. We are therefore suggesting adding the