Currently, when a constraint is added to a detached view, the constraint is not added to the engine and the call silently fails.
This is due to the fact that the engine is hosted by the window and a detached view doesn't have any window.
The constraint should be added somewhere in the owner view and then added to the engine when the view acquires a window and an engine (-viewDidMoveToWindow).
Another way to do that would be to create a local engine for the orphan view and add constraints to it.
When the view gets a window,
If the window doesn't have an engine (the engine is lazily created), the local engine becomes the window engine.
If the window already have an engine, the local engine variables are merged into the main engine. See if this is possible with the current js engine API.
This approach would also allow to layout the subtree of orphan views.
Currently, when a constraint is added to a detached view, the constraint is not added to the engine and the call silently fails.
This is due to the fact that the engine is hosted by the window and a detached view doesn't have any window.
The constraint should be added somewhere in the owner view and then added to the engine when the view acquires a window and an engine (-viewDidMoveToWindow).