Skip to content
Permalink
Browse files

Rename functions, fields and adjust comments to use `fragment` instea…

…d of `box`

I tried to make sure to keep 'box' where it made sense, and alter comments so they still make sense.
  • Loading branch information
brendanzab committed May 28, 2014
1 parent c5fced4 commit 3ffce02b88a59e5967a31a29d4666bde176e874c

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -18,7 +18,7 @@ pub trait LayoutAuxMethods {
impl<'ln> LayoutAuxMethods for LayoutNode<'ln> {
/// Resets layout data and styles for the node.
///
/// FIXME(pcwalton): Do this as part of box building instead of in a traversal.
/// FIXME(pcwalton): Do this as part of fragment building instead of in a traversal.
fn initialize_layout_data(&self, chan: LayoutChan) {
let mut layout_data_ref = self.mutate_layout_data();
match *layout_data_ref {
@@ -35,7 +35,7 @@ impl<'ln> LayoutAuxMethods for LayoutNode<'ln> {

/// Resets layout data and styles for a Node tree.
///
/// FIXME(pcwalton): Do this as part of box building instead of in a traversal.
/// FIXME(pcwalton): Do this as part of fragment building instead of in a traversal.
fn initialize_style_for_subtree(&self, chan: LayoutChan) {
for n in self.traverse_preorder() {
n.initialize_layout_data(chan.clone());
@@ -320,7 +320,7 @@ impl Floats {
max_height.map(|h| h + self.offset.y)
}

/// Given placement information, finds the closest place a box can be positioned without
/// Given placement information, finds the closest place a fragment can be positioned without
/// colliding with any floats.
pub fn place_between_floats(&self, info: &PlacementInfo) -> Rect<Au> {
debug!("place_between_floats: Placing object with width {} and height {}",
@@ -8,8 +8,8 @@
/// inline and block layout.
///
/// Flows are interior nodes in the layout tree and correspond closely to *flow contexts* in the
/// CSS specification. Flows are responsible for positioning their child flow contexts and boxes.
/// Flows have purpose-specific fields, such as auxiliary line box structs, out-of-flow child
/// CSS specification. Flows are responsible for positioning their child flow contexts and fragments.
/// Flows have purpose-specific fields, such as auxiliary line fragment structs, out-of-flow child
/// lists, and so on.
///
/// Currently, the important types of flows are:
@@ -21,7 +21,7 @@
/// the viewport.
///
/// * `InlineFlow`: A flow that establishes an inline context. It has a flat list of child
/// boxes/flows that are subject to inline layout and line breaking and structs to represent
/// fragments/flows that are subject to inline layout and line breaking and structs to represent
/// line breaks and mapping to CSS boxes, for the purpose of handling `getClientRects()` and
/// similar methods.

@@ -844,12 +844,12 @@ impl<'a> ImmutableFlowUtils for &'a Flow {
fn generate_missing_child_flow(self, node: &ThreadSafeLayoutNode) -> Box<Flow:Share> {
match self.class() {
TableFlowClass | TableRowGroupFlowClass => {
let box_ = Fragment::new_anonymous_table_box(node, TableRowFragment);
box TableRowFlow::from_node_and_box(node, box_) as Box<Flow:Share>
let fragment = Fragment::new_anonymous_table_fragment(node, TableRowFragment);
box TableRowFlow::from_node_and_fragment(node, fragment) as Box<Flow:Share>
},
TableRowFlowClass => {
let box_ = Fragment::new_anonymous_table_box(node, TableCellFragment);
box TableCellFlow::from_node_and_box(node, box_) as Box<Flow:Share>
let fragment = Fragment::new_anonymous_table_fragment(node, TableCellFragment);
box TableCellFlow::from_node_and_fragment(node, fragment) as Box<Flow:Share>
},
_ => {
fail!("no need to generate a missing child")
@@ -869,8 +869,8 @@ impl<'a> ImmutableFlowUtils for &'a Flow {

/// Return true if this flow is a Block Container.
///
/// Except for table boxes and replaced elements, block-level boxes (`BlockFlow`) are
/// also block container boxes.
/// Except for table fragments and replaced elements, block-level fragments (`BlockFlow`) are
/// also block container fragments.
/// Non-replaced inline blocks and non-replaced table cells are also block
/// containers.
fn is_block_container(self) -> bool {
@@ -1065,7 +1065,7 @@ impl MutableOwnedFlowUtils for Box<Flow:Share> {
let _ = base.parallel.children_and_absolute_descendant_count.fetch_add(1, Relaxed);
}

/// Finishes a flow. Once a flow is finished, no more child flows or boxes may be added to it.
/// Finishes a flow. Once a flow is finished, no more child flows or fragments may be added to it.
/// This will normally run the bubble-widths (minimum and preferred -- i.e. intrinsic -- width)
/// calculation, unless the global `bubble_widths_separately` flag is on.
///

0 comments on commit 3ffce02

Please sign in to comment.
You can’t perform that action at this time.