W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2011

[whatwg] Node inDocument

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Thu, 1 Sep 2011 19:37:59 -0700
Message-ID: <CABNRm62P_r2SwLr_7WgS4Q=WUJ-CBv1zTTYCWndidWhKnvm=7Q@mail.gmail.com>
On Thu, Sep 1, 2011 at 6:56 PM, James Robinson <jamesr at 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 assume that you meant #a is in body, #b is somewhere in the
contentDocument of #a, and #node is in the contentDocument of #b.  Then

what is the return value for:
> b.contentDocument.contains(node);

a.contentDocument.contains(node);
> document.contains(node);
>

are, respectively, true, false, and false.

- Ryosuke
Received on Thursday, 1 September 2011 19:37:59 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:36 UTC