aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/node.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-01-27 14:41:06 -0800
committerPatrick Walton <pcwalton@mimiga.net>2014-01-27 14:41:52 -0800
commit9c3af574e59cc48b955c5b4204e0972a0b5e2158 (patch)
tree27f1b52b9f16004623b34e8ae9926f9416c1ba46 /src/components/script/dom/node.rs
parentfa02b82b8878175d889130dd81a2d8e0caa916ca (diff)
downloadservo-9c3af574e59cc48b955c5b4204e0972a0b5e2158.tar.gz
servo-9c3af574e59cc48b955c5b4204e0972a0b5e2158.zip
layout: Perform cascading in parallel.
Speeds up the cascade by 3x.
Diffstat (limited to 'src/components/script/dom/node.rs')
-rw-r--r--src/components/script/dom/node.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs
index 0ec2f989408..a930d57eef1 100644
--- a/src/components/script/dom/node.rs
+++ b/src/components/script/dom/node.rs
@@ -154,13 +154,10 @@ impl LayoutDataRef {
/// Borrows the layout data immutably, *asserting that there are no mutators*. Bad things will
/// happen if you try to mutate the layout data while this is held. This is the only thread-
/// safe layout data accessor.
- ///
- /// FIXME(pcwalton): Enforce this invariant via the type system. Will require traversal
- /// functions to be trusted, but c'est la vie.
- // #[inline]
- // pub unsafe fn borrow_unchecked<'a>(&'a self) -> &'a () {
- // self.data.borrow_unchecked()
- // }
+ #[inline]
+ pub unsafe fn borrow_unchecked(&self) -> *Option<LayoutData> {
+ cast::transmute(&self.data_cell)
+ }
/// Borrows the layout data immutably. This function is *not* thread-safe.
#[inline]