mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Lint layout_2013 with clippy (#31221)
* Lint layout_2013 with clippy CARGO_BUILD_RUSTC=rustc cargo clippy --fix -p layout_2013 --broken-code * ./mach fmt * Cosmetic adjustments
This commit is contained in:
parent
16cabcf736
commit
f7ead9bcb6
28 changed files with 490 additions and 483 deletions
|
@ -26,7 +26,7 @@ use crate::traversal::{
|
|||
};
|
||||
|
||||
pub fn resolve_generated_content(root: &mut dyn Flow, layout_context: &LayoutContext) {
|
||||
ResolveGeneratedContent::new(&layout_context).traverse(root, 0);
|
||||
ResolveGeneratedContent::new(layout_context).traverse(root, 0);
|
||||
}
|
||||
|
||||
/// Run the main layout passes sequentially.
|
||||
|
@ -59,18 +59,12 @@ pub fn reflow(root: &mut dyn Flow, layout_context: &LayoutContext, relayout_mode
|
|||
}
|
||||
|
||||
if opts::get().debug.bubble_inline_sizes_separately {
|
||||
let bubble_inline_sizes = BubbleISizes {
|
||||
layout_context: &layout_context,
|
||||
};
|
||||
let bubble_inline_sizes = BubbleISizes { layout_context };
|
||||
bubble_inline_sizes.traverse(root);
|
||||
}
|
||||
|
||||
let assign_inline_sizes = AssignISizes {
|
||||
layout_context: &layout_context,
|
||||
};
|
||||
let assign_block_sizes = AssignBSizes {
|
||||
layout_context: &layout_context,
|
||||
};
|
||||
let assign_inline_sizes = AssignISizes { layout_context };
|
||||
let assign_block_sizes = AssignBSizes { layout_context };
|
||||
|
||||
doit(root, assign_inline_sizes, assign_block_sizes, relayout_mode);
|
||||
}
|
||||
|
@ -104,7 +98,7 @@ pub fn build_display_list_for_subtree<'a>(
|
|||
},
|
||||
)));
|
||||
|
||||
let mut build_display_list = BuildDisplayList { state: state };
|
||||
let mut build_display_list = BuildDisplayList { state };
|
||||
build_display_list.traverse(flow_root);
|
||||
build_display_list.state
|
||||
}
|
||||
|
@ -133,11 +127,10 @@ pub fn iterate_through_flow_tree_fragment_border_boxes(
|
|||
.stacking_relative_border_box(CoordinateSystem::Own);
|
||||
if let Some(matrix) = kid.as_block().fragment.transform_matrix(&relative_position) {
|
||||
let transform_matrix = matrix.transform_point2d(LayoutPoint::zero()).unwrap();
|
||||
stacking_context_position = stacking_context_position +
|
||||
Vector2D::new(
|
||||
Au::from_f32_px(transform_matrix.x),
|
||||
Au::from_f32_px(transform_matrix.y),
|
||||
)
|
||||
stacking_context_position += Vector2D::new(
|
||||
Au::from_f32_px(transform_matrix.x),
|
||||
Au::from_f32_px(transform_matrix.y),
|
||||
)
|
||||
}
|
||||
}
|
||||
doit(kid, level + 1, iterator, &stacking_context_position);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue