diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2013-05-21 18:18:05 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2013-05-28 15:40:47 -0700 |
commit | 4f3ca373d441bcb1bad51ddf9c579ccbd955ac95 (patch) | |
tree | 23a132915f340e41e8efdf5d5f3b732551767da4 /src/components/script/dom/bindings/codegen/BindingUtils.cpp | |
parent | c7bce9823660106969e5d2c6b4e4c35f4003d360 (diff) | |
download | servo-4f3ca373d441bcb1bad51ddf9c579ccbd955ac95.tar.gz servo-4f3ca373d441bcb1bad51ddf9c579ccbd955ac95.zip |
Introduce a phantom type to prevent script from accessing the layout data directly.
Nodes are now parameterized over a "View" type. The particular View type
determines which methods can be called. Layout data accessors and mutators are
only accessible to nodes with a LayoutView. The only way to convert a
`Node<ScriptView>` to a `Node<LayoutView>` is through a transmutation, which is
done at the moment the layout task receives nodes. (This should be factored
better to contain the unsafety.)
We should also lock down DOM node mutation to the ScriptView to forbid data
races, but this patch doesn't do that.
This also reduces coupling between DOM and layout. Soon I would like to move
the DOM into its own crate, and this is a step on the way of doing that.
Diffstat (limited to 'src/components/script/dom/bindings/codegen/BindingUtils.cpp')
0 files changed, 0 insertions, 0 deletions