aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/wrapper.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2015-06-21 13:06:20 +0200
committerMs2ger <ms2ger@gmail.com>2015-06-22 10:47:21 +0200
commiteb2c508df0ca8a286db9d30d5fb2ba8e47b41fa2 (patch)
tree0dd27854dd7c3e761a75b0d22c2914153f891f7f /components/layout/wrapper.rs
parenta217ffb00a844c4396f5abb1d3ead2f2bb520a6c (diff)
downloadservo-eb2c508df0ca8a286db9d30d5fb2ba8e47b41fa2.tar.gz
servo-eb2c508df0ca8a286db9d30d5fb2ba8e47b41fa2.zip
Implement the LayoutData getters on LayoutJS<Node> rather than Node itself.
Diffstat (limited to 'components/layout/wrapper.rs')
-rw-r--r--components/layout/wrapper.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs
index b45162772d3..6db0552d2df 100644
--- a/components/layout/wrapper.rs
+++ b/components/layout/wrapper.rs
@@ -889,11 +889,11 @@ impl<'ln> ThreadSafeLayoutNode<'ln> {
layout_data_wrapper_ref.data.after_style.is_some()
}
- /// Borrows the layout data without checking. Fails on a conflicting borrow.
+ /// Borrows the layout data without checking.
#[inline(always)]
fn borrow_layout_data_unchecked<'a>(&'a self) -> *const Option<LayoutDataWrapper> {
unsafe {
- mem::transmute(self.get().layout_data_unchecked())
+ self.node.borrow_layout_data_unchecked()
}
}
@@ -902,9 +902,7 @@ impl<'ln> ThreadSafeLayoutNode<'ln> {
/// TODO(pcwalton): Make this private. It will let us avoid borrow flag checks in some cases.
#[inline(always)]
pub fn borrow_layout_data<'a>(&'a self) -> Ref<'a,Option<LayoutDataWrapper>> {
- unsafe {
- mem::transmute(self.get().layout_data())
- }
+ self.node.borrow_layout_data()
}
/// Borrows the layout data mutably. Fails on a conflicting borrow.
@@ -912,9 +910,7 @@ impl<'ln> ThreadSafeLayoutNode<'ln> {
/// TODO(pcwalton): Make this private. It will let us avoid borrow flag checks in some cases.
#[inline(always)]
pub fn mutate_layout_data<'a>(&'a self) -> RefMut<'a,Option<LayoutDataWrapper>> {
- unsafe {
- mem::transmute(self.get().layout_data_mut())
- }
+ self.node.mutate_layout_data()
}
/// Traverses the tree in postorder.