mozilla/servo — pull request #2101 by jdm (2014-04-13 15:46:16+00:00)
Title: Implement a safe, mostly-sound rooting rooting strategy.

As described in #1764, this strategy uses the following properties:
* DOM members are `JS` types. These cannot be used with being explicitly rooted, but they are required for compiler-derived trace hooks.
* Methods that take DOM type arguments receive `&[mut] JSRef`. These are rooted value references that are cloneable but cannot escape.
* Methods that return DOM values use `Unrooted`. These are values that may or may not be rooted elsewhere, but callers must root them in order to interact with them in any way. One unsoundness hole exists - `Unrooted` values must be rooted ASAP, or there exists the danger that JSAPI calls could be made that could cause the underlying JS value to be GCed.
* All methods are implemented on `JSRef`, enforcing the requirement that all DOM values are rooted for the duration of a method call (with a few exceptions for layout-related code, which cannot root values and therefore interacts with `JS` and `&T` values)