Rename with_imm_base to with_base.

This commit is contained in:
Patrick Walton 2013-06-03 16:06:38 -07:00
parent cddf67a0e6
commit fb2ce2c00c
3 changed files with 12 additions and 12 deletions

View file

@ -181,7 +181,7 @@ impl RenderBoxBase {
pub impl RenderBox {
/// Borrows this render box immutably in order to work with its common data.
#[inline(always)]
fn with_imm_base<R>(&self, callback: &fn(&RenderBoxBase) -> R) -> R {
fn with_base<R>(&self, callback: &fn(&RenderBoxBase) -> R) -> R {
match *self {
GenericRenderBoxClass(generic_box) => callback(generic_box),
ImageRenderBoxClass(image_box) => {
@ -215,7 +215,7 @@ pub impl RenderBox {
/// A convenience function to return the position of this box.
fn position(&self) -> Rect<Au> {
do self.with_imm_base |base| {
do self.with_base |base| {
base.position
}
}
@ -455,7 +455,7 @@ pub impl RenderBox {
}
fn get_noncontent_width(&self) -> Au {
do self.with_imm_base |base| {
do self.with_base |base| {
base.model.border.left + base.model.padding.left +
base.model.border.right + base.model.padding.right
}
@ -470,7 +470,7 @@ pub impl RenderBox {
/// The box formed by the content edge as defined in CSS 2.1 § 8.1. Coordinates are relative to
/// the owning flow.
fn content_box(&self) -> Rect<Au> {
do self.with_imm_base |base| {
do self.with_base |base| {
let origin = Point2D(base.position.origin.x +
base.model.border.left +
base.model.padding.left,
@ -498,12 +498,12 @@ pub impl RenderBox {
/// A convenience function to access the computed style of the DOM node that this render box
/// represents.
fn style(&self) -> CompleteStyle {
self.with_imm_base(|base| base.node.style())
self.with_base(|base| base.node.style())
}
/// A convenience function to access the DOM node that this render box represents.
fn node(&self) -> AbstractNode<LayoutView> {
self.with_imm_base(|base| base.node)
self.with_base(|base| base.node)
}
/// Returns the nearest ancestor-or-self `Element` to the DOM node that this render box
@ -511,7 +511,7 @@ pub impl RenderBox {
///
/// If there is no ancestor-or-self `Element` node, fails.
fn nearest_ancestor_element(&self) -> AbstractNode<LayoutView> {
do self.with_imm_base |base| {
do self.with_base |base| {
let mut node = base.node;
while !node.is_element() {
match node.parent_node() {

View file

@ -141,8 +141,8 @@ impl ElementMapping {
// XXX: the following loop form causes segfaults; assigning to locals doesn't.
// while new_j < new_boxes.len() && old_boxes[old_i].d().node != new_boxes[new_j].d().node {
while new_j < new_boxes.len() {
let should_leave = do old_boxes[old_i].with_imm_base |old_box_base| {
do new_boxes[new_j].with_imm_base |new_box_base| {
let should_leave = do old_boxes[old_i].with_base |old_box_base| {
do new_boxes[new_j].with_base |new_box_base| {
old_box_base.node != new_box_base.node
}
};
@ -284,7 +284,7 @@ impl TextRunScanner {
let run = @fontgroup.create_textrun(transformed_text, underline);
debug!("TextRunScanner: pushing single text box in range: %?", self.clump);
let new_box = do old_box.with_imm_base |old_box_base| {
let new_box = do old_box.with_base |old_box_base| {
let range = Range::new(0, run.char_len());
@mut adapt_textbox_with_range(*old_box_base, run, range)
};
@ -345,7 +345,7 @@ impl TextRunScanner {
loop
}
do in_boxes[i].with_imm_base |base| {
do in_boxes[i].with_base |base| {
let new_box = @mut adapt_textbox_with_range(*base, run.get(), range);
out_boxes.push(TextRenderBoxClass(new_box));
}

View file

@ -151,7 +151,7 @@ impl RenderBox {
list: &Cell<DisplayList<E>>,
abs_bounds: &Rect<Au>) {
// Fast path.
let border = do self.with_imm_base |base| {
let border = do self.with_base |base| {
base.model.border
};
if border.is_zero() {