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

[whatwg] Node inDocument

From: Jonas Sicking <jonas@sicking.cc>
Date: Fri, 2 Sep 2011 10:57:07 -0700
Message-ID: <CA+c2ei9N866_52XR8c0ma0xTnG8p18Wk7RsaorSQnsqFVz605g@mail.gmail.com>
On Fri, Sep 2, 2011 at 10:00 AM, Ryosuke Niwa <rniwa at webkit.org> wrote:
>
> On Fri, Sep 2, 2011 at 8:31 AM, Jonas Sicking <jonas at sicking.cc> wrote:
>>
>> On Thursday, September 1, 2011, Ryosuke Niwa <rniwa at webkit.org> wrote:
>> > 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.
>>
>> My understanding is that they would all be false. "node" isn't a
>> descendent of "b" if "node" is in "b"'s contentDocument.
>
> But shouldn't b's contentDocument contains node? ?I mean b.contains(node)
> should return false but?b.contentDocument.contains(node) should return true,
> no?

Doh! My bad, i had missed the ".contentDocument" in there.

/ Jonas
Received on Friday, 2 September 2011 10:57:07 UTC

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