Add LayoutJS<Node>::from_trusted_node_address()

This commit is contained in:
Tetsuharu OHZEKI 2015-01-25 02:57:38 +09:00
parent 8889041c19
commit 9f57fa17d0
3 changed files with 14 additions and 4 deletions

View file

@ -32,7 +32,7 @@ use gfx::paint_task::{PaintChan, PaintLayer};
use gfx::paint_task::Msg as PaintMsg;
use layout_traits::{LayoutControlMsg, LayoutTaskFactory};
use log;
use script::dom::bindings::js::{JS, LayoutJS};
use script::dom::bindings::js::LayoutJS;
use script::dom::node::{LayoutDataRef, Node, NodeTypeId};
use script::dom::element::ElementTypeId;
use script::dom::htmlelement::HTMLElementTypeId;
@ -720,7 +720,7 @@ impl LayoutTask {
// FIXME(rust#16366): The following line had to be moved because of a
// rustc bug. It should be in the next unsafe block.
let mut node: LayoutJS<Node> = unsafe {
JS::from_trusted_node_address(data.document_root).to_layout()
LayoutJS::from_trusted_node_address(data.document_root)
};
let node: &mut LayoutNode = unsafe {
mem::transmute(&mut node)