aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/wrapper.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/wrapper.rs')
-rw-r--r--components/layout/wrapper.rs27
1 files changed, 16 insertions, 11 deletions
diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs
index 101249b4747..a99dcebe187 100644
--- a/components/layout/wrapper.rs
+++ b/components/layout/wrapper.rs
@@ -248,7 +248,7 @@ impl<'ln> LayoutNode<'ln> {
self.dump_indent(0);
}
- fn dump_indent(self, indent: uint) {
+ fn dump_indent(self, indent: u32) {
let mut s = String::new();
for _ in range(0, indent) {
s.push_str(" ");
@@ -267,10 +267,10 @@ impl<'ln> LayoutNode<'ln> {
self.type_id(), self.has_changed(), self.is_dirty(), self.has_dirty_descendants())
}
- pub fn flow_debug_id(self) -> uint {
+ pub fn flow_debug_id(self) -> usize {
let layout_data_ref = self.borrow_layout_data();
match *layout_data_ref {
- None => 0u,
+ None => 0,
Some(ref layout_data) => layout_data.data.flow_construction_result.debug_id()
}
}
@@ -333,11 +333,16 @@ impl<'ln> LayoutNode<'ln> {
/// While doing a reflow, the node at the root has no parent, as far as we're
/// concerned. This method returns `None` at the reflow root.
pub fn layout_parent_node(self, shared: &SharedLayoutContext) -> Option<LayoutNode<'ln>> {
- let opaque_node: OpaqueNode = OpaqueNodeMethods::from_layout_node(&self);
- if opaque_node == shared.reflow_root {
- None
- } else {
- self.parent_node()
+ match shared.reflow_root {
+ None => panic!("layout_parent_node(): This layout has no access to the DOM!"),
+ Some(reflow_root) => {
+ let opaque_node: OpaqueNode = OpaqueNodeMethods::from_layout_node(&self);
+ if opaque_node == reflow_root {
+ None
+ } else {
+ self.parent_node()
+ }
+ }
}
}
@@ -806,7 +811,7 @@ impl<'ln> ThreadSafeLayoutNode<'ln> {
self.node.debug_id()
}
- pub fn flow_debug_id(self) -> uint {
+ pub fn flow_debug_id(self) -> usize {
self.node.flow_debug_id()
}
@@ -1135,11 +1140,11 @@ pub trait PostorderNodeMutTraversal {
/// Opaque type stored in type-unsafe work queues for parallel layout.
/// Must be transmutable to and from LayoutNode/ThreadSafeLayoutNode.
-pub type UnsafeLayoutNode = (uint, uint);
+pub type UnsafeLayoutNode = (usize, usize);
pub fn layout_node_to_unsafe_layout_node(node: &LayoutNode) -> UnsafeLayoutNode {
unsafe {
- let ptr: uint = mem::transmute_copy(node);
+ let ptr: usize = mem::transmute_copy(node);
(ptr, 0)
}
}