mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Remove calculate_clearance_and_adjoin_margin (#30033)
It was useful when it had 3 callers, but #29977 removed 2 of them.
This commit is contained in:
parent
628aeec95a
commit
e0e970af31
2 changed files with 5 additions and 17 deletions
|
@ -981,22 +981,6 @@ impl SequentialLayoutState {
|
|||
Some(clear_position - position_with_zero_clearance)
|
||||
}
|
||||
|
||||
/// Helper function that computes the clearance and adds `block_start_margin` accordingly.
|
||||
/// If there is no clearance, `block_start_margin` can just be adjoined to `current_margin`.
|
||||
/// But clearance prevents them from collapsing, so `collapse_margins()` is called.
|
||||
pub(crate) fn calculate_clearance_and_adjoin_margin(
|
||||
&mut self,
|
||||
style: &Arc<ComputedValues>,
|
||||
block_start_margin: &CollapsedMargin,
|
||||
) -> Option<Length> {
|
||||
let clearance = self.calculate_clearance(ClearSide::from_style(style), &block_start_margin);
|
||||
if clearance.is_some() {
|
||||
self.collapse_margins();
|
||||
}
|
||||
self.adjoin_assign(&block_start_margin);
|
||||
clearance
|
||||
}
|
||||
|
||||
/// Adds a new adjoining margin.
|
||||
pub(crate) fn adjoin_assign(&mut self, margin: &CollapsedMargin) {
|
||||
self.current_margin.adjoin_assign(margin)
|
||||
|
|
|
@ -654,7 +654,11 @@ fn layout_in_flow_non_replaced_block_level_same_formatting_context(
|
|||
|
||||
// Introduce clearance if necessary.
|
||||
clearance = sequential_layout_state
|
||||
.calculate_clearance_and_adjoin_margin(style, &block_start_margin);
|
||||
.calculate_clearance(ClearSide::from_style(style), &block_start_margin);
|
||||
if clearance.is_some() {
|
||||
sequential_layout_state.collapse_margins();
|
||||
}
|
||||
sequential_layout_state.adjoin_assign(&block_start_margin);
|
||||
if !start_margin_can_collapse_with_children {
|
||||
sequential_layout_state.collapse_margins();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue