aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/flow.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/flow.rs')
-rw-r--r--components/layout/flow.rs24
1 files changed, 16 insertions, 8 deletions
diff --git a/components/layout/flow.rs b/components/layout/flow.rs
index 46b69e2deaa..74d3100f1f2 100644
--- a/components/layout/flow.rs
+++ b/components/layout/flow.rs
@@ -311,12 +311,9 @@ pub trait Flow: fmt::Debug + Sync {
/// Returns a layer ID for the given fragment.
#[allow(unsafe_code)]
- fn layer_id(&self, fragment_id: uint) -> LayerId {
- unsafe {
- let obj = mem::transmute::<&&Self, &raw::TraitObject>(&self);
- let pointer: uint = mem::transmute(obj.data);
- LayerId(pointer, fragment_id)
- }
+ fn layer_id(&self, fragment_id: u32) -> LayerId {
+ let obj = unsafe { mem::transmute::<&&Self, &raw::TraitObject>(&self) };
+ LayerId(obj.data as usize, fragment_id)
}
/// Attempts to perform incremental fixup of this flow by replacing its fragment's style with
@@ -438,6 +435,10 @@ pub trait MutableFlowUtils {
/// So, kids have their flow origin already set. In the case of absolute flow kids, they have
/// their hypothetical box position already set.
fn collect_static_block_offsets_from_children(self);
+
+ /// Calls `repair_style` and `bubble_inline_sizes`. You should use this method instead of
+ /// calling them individually, since there is no reason not to perform both operations.
+ fn repair_style_and_bubble_inline_sizes(self, style: &Arc<ComputedValues>);
}
pub trait MutableOwnedFlowUtils {
@@ -994,9 +995,9 @@ impl BaseFlow {
&self.weak_ref_count
}
- pub fn debug_id(&self) -> uint {
+ pub fn debug_id(&self) -> usize {
let p = self as *const _;
- p as uint
+ p as usize
}
/// Ensures that all display list items generated by this flow are within the flow's overflow
@@ -1312,6 +1313,13 @@ impl<'a> MutableFlowUtils for &'a mut (Flow + 'a) {
}
mut_base(self).abs_descendants.static_block_offsets = absolute_descendant_block_offsets
}
+
+ /// Calls `repair_style` and `bubble_inline_sizes`. You should use this method instead of
+ /// calling them individually, since there is no reason not to perform both operations.
+ fn repair_style_and_bubble_inline_sizes(self, style: &Arc<ComputedValues>) {
+ self.repair_style(style);
+ self.bubble_inline_sizes();
+ }
}
impl MutableOwnedFlowUtils for FlowRef {