On 07/12/2013 03:34 PM, Kyle Huey wrote:
On Fri, Jul 12, 2013 at 12:29 PM, Josh Matthews <j...@joshmatthews.net>wrote:

On 07/12/2013 03:22 PM, Kyle Huey wrote:

On Fri, Jul 12, 2013 at 12:18 PM, Josh Matthews <j...@joshmatthews.net
wrote:

  On 07/12/2013 02:33 PM, Patrick Walton wrote:

  * What is the plan to handle cycles between the DOM and JS?



The JavaScript garbage collector handles all DOM objects, so the JS
garbage collector will trace all DOM-JS cycles and clean them up.


What does this mean precisely? Are we going to need to add trace hooks to
every DOM object, ensuring that we trace the JS wrappers of any other DOM
objects that are owned? Off the top of my head that sounds like it should
catch all possible cycles, but someone like Kyle Huey can probably
confirm.


What is going to handle DOM-DOM references (e.g. in the node tree)?

- Kyle


Every DOM object comes into existence with a JS wrapper, so the trace
hooks handle that, yes? For example, Elements have a trace hook that traces
the parent, first and last children, and next and previous siblings (
https://github.com/mozilla/**servo/blob/master/src/**
components/script/dom/**bindings/element.rs#L44<https://github.com/mozilla/servo/blob/master/src/components/script/dom/bindings/element.rs#L44>).

______________________________**_________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/**listinfo/dev-servo<https://lists.mozilla.org/listinfo/dev-servo>


That means you have to eagerly create JS wrappers for every node in the DOM
tree.  So you can't do lazy prototype setup, lazy wrapper creation, etc.
Those are big speed and size wins in Gecko ...

- Kyle


Yes, this is the bed we have made for ourselves in Servo at this point.
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to