Skip to content

Commit

Permalink
Rename functions, fields and adjust comments to use fragment instea…
Browse files Browse the repository at this point in the history
…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 3ffce02
Show file tree
Hide file tree
Showing 15 changed files with 847 additions and 849 deletions.
234 changes: 117 additions & 117 deletions src/components/main/layout/block.rs

Large diffs are not rendered by default.

368 changes: 183 additions & 185 deletions src/components/main/layout/box_.rs

Large diffs are not rendered by default.

275 changes: 138 additions & 137 deletions src/components/main/layout/construct.rs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/components/main/layout/extra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/layout/floats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}",
Expand Down
20 changes: 10 additions & 10 deletions src/components/main/layout/flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.

Expand Down Expand Up @@ -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")
Expand All @@ -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 {
Expand Down Expand Up @@ -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.
///
Expand Down

0 comments on commit 3ffce02

Please sign in to comment.