1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:28:11 +00:00

LibWeb: Simplify code that compute initial child positions in BFC

This commit is contained in:
Andreas Kling 2022-01-24 01:39:49 +01:00
parent d58f60c953
commit 9a48368280

View file

@ -455,12 +455,8 @@ void BlockFormattingContext::place_block_level_replaced_element_in_normal_flow(B
compute_vertical_box_model_metrics(child_box, containing_block);
float x = box_model.margin.left
+ box_model.border.left
+ box_model.padding.left
+ box_model.offset.left;
float y = box_model.margin_box().top + containing_block.box_model().offset.top;
float x = box_model.margin_box().left + box_model.offset.left;
float y = box_model.margin_box().top + box_model.offset.top;
child_box.set_offset(x, y);
}
@ -472,13 +468,11 @@ void BlockFormattingContext::place_block_level_non_replaced_element_in_normal_fl
compute_vertical_box_model_metrics(child_box, containing_block);
float x = box_model.margin.left
+ box_model.border.left
+ box_model.padding.left
+ box_model.offset.left;
float x = 0;
if (containing_block.computed_values().text_align() == CSS::TextAlign::LibwebCenter) {
x = (containing_block.width() / 2) - child_box.width() / 2;
} else {
x = box_model.margin_box().left + box_model.offset.left;
}
float y = box_model.margin_box().top