Repository: servo/servo
File: components/layout/taffy/mod.rs (Rust)

Code before:
        context: &SharedStyleContext,
        node: &ServoThreadSafeLayoutNode,
        new_style: &Arc<ComputedValues>,
    ) {
        self.style = new_style.clone();
        match &mut self.taffy_level_box {
            TaffyItemBoxInner::InFlowBox(independent_formatting_context) => {
                independent_formatting_context.repair_style(context, node, new_style)
            },
            TaffyItemBoxInner::OutOfFlowAbsolutelyPositionedBox(positioned_box) => positioned_box
                .borrow_mut()
                .context
                .repair_style(context, node, new_style),
        }
    }

    fn is_in_flow_replaced(&self) -> bool {
        match &self.taffy_level_box {
            TaffyItemBoxInner::InFlowBox(fc) => fc.is_replaced(),
            TaffyItemBoxInner::OutOfFlowAbsolutelyPositionedBox(_) => false,
        }
    }

    pub(crate) fn attached_to_tree(&self, box_: WeakLayoutBox) {
        match &self.taffy_level_box {
            TaffyItemBoxInner::InFlowBox(fc) => fc.attached_to_tree(box_),
            TaffyItemBoxInner::OutOfFlowAbsolutelyPositionedBox(positioned_box) => {
                positioned_box.borrow_mut().context.attached_to_tree(box_)
            },
        }
    }
}

/// Details from Taffy grid layout that will be stored
#[derive(Clone, Debug, MallocSizeOf)]
pub(crate) struct SpecificTaffyGridInfo {
    pub rows: SpecificTaffyGridTrackInfo,
    pub columns: SpecificTaffyGridTrackInfo,
}

impl SpecificTaffyGridInfo {
    fn from_detailed_grid_layout(grid_info: taffy::DetailedGridInfo) -> Self {
        Self {
            rows: SpecificTaffyGridTrackInfo {
                sizes: grid_info
                    .rows
                    .sizes
                    .iter()
                    .map(|size| Au::from_f32_px(*size))
                    .collect(),
            },

Review comment (suggestion):
```suggestion
            TaffyItemBoxInner::InFlowBox(formatting_context) => formatting_context.attached_to_tree(box_),
```

Code after:
        context: &SharedStyleContext,
        node: &ServoThreadSafeLayoutNode,
        new_style: &Arc<ComputedValues>,
    ) {
        self.style = new_style.clone();
        match &mut self.taffy_level_box {
            TaffyItemBoxInner::InFlowBox(independent_formatting_context) => {
                independent_formatting_context.repair_style(context, node, new_style)
            },
            TaffyItemBoxInner::OutOfFlowAbsolutelyPositionedBox(positioned_box) => positioned_box
                .borrow_mut()
                .context
                .repair_style(context, node, new_style),
        }
    }

    fn is_in_flow_replaced(&self) -> bool {
        match &self.taffy_level_box {
            TaffyItemBoxInner::InFlowBox(fc) => fc.is_replaced(),
            TaffyItemBoxInner::OutOfFlowAbsolutelyPositionedBox(_) => false,
        }
    }

    pub(crate) fn attached_to_tree(&self, layout_box: WeakLayoutBox) {
        match &self.taffy_level_box {
            TaffyItemBoxInner::InFlowBox(formatting_context) => {
                formatting_context.attached_to_tree(layout_box)
            },
            TaffyItemBoxInner::OutOfFlowAbsolutelyPositionedBox(positioned_box) => positioned_box
                .borrow_mut()
                .context
                .attached_to_tree(layout_box),
        }
    }
}

/// Details from Taffy grid layout that will be stored
#[derive(Clone, Debug, MallocSizeOf)]
pub(crate) struct SpecificTaffyGridInfo {
    pub rows: SpecificTaffyGridTrackInfo,
    pub columns: SpecificTaffyGridTrackInfo,
}

impl SpecificTaffyGridInfo {
    fn from_detailed_grid_layout(grid_info: taffy::DetailedGridInfo) -> Self {
        Self {
            rows: SpecificTaffyGridTrackInfo {
                sizes: grid_info
                    .rows
                    .sizes
                    .iter()