On Tue, Apr 19, 2016 at 5:54 AM, Melisa Bok <[email protected]> wrote:
> Thanks Kevin for your response. > > I replace the line: > > return caja.tame(div); > > with: > > return frame.domicile.tameNodeAsForeign(div); > > I'm still getting the same error: This operation requires a TameBackedNode > when I try to append the node in the guest code. > 1. Is it because we are getting a TameForeignNode and not a > TameBackedNode, right? > No, a foreign node is a kind of backed node. That should work. In the guest code, can you check what sort of object you're getting (toString and so on)? > 2. And what you mentioned before: "the guest is not allowed to look at or > modify that node or its children": can't I append an opaque node to a > current guest node? > (By the way, I misused the vocabulary earlier: an opaque thing is a similar but not the same thing to a foreign node.) Actually, you're right to check and I was wrong: it's not permitted to appendChild(someForeignNode). However, if you were actually hitting that restriction, the error you would see is "Node not editable.", not "requires a TameBackedNode". Using the possibilities available in the current API, the host code *must* put the new node into a containing node passed to the host by the guest, and the guest will then be unable to remove it. 3. And about to pass the DOM node from the guest to the host doesn't work > anymore? > Once the node is properly marked, it should always survive passing the guest/host membrane in either direction (though on the guest side it will be the Caja wrapper and not the browser DOM node, of course). If you're not seeing that, something else went wrong. -- --- You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
