1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:48:14 +00:00

LibWeb: Rename "offset" in box model metrics to "inset"

The CSS Positioned Layout spec refers to the top/left/bottom/right
properties as "inset" properties, so let's use the same terminology.
This commit is contained in:
Andreas Kling 2022-03-26 13:26:42 +01:00
parent 54c3053bc3
commit fe908e7db2
5 changed files with 26 additions and 26 deletions

View file

@ -439,7 +439,7 @@ void BlockFormattingContext::place_block_level_element_in_normal_flow_vertically
compute_vertical_box_model_metrics(child_box, containing_block);
float y = box_state.border_box_top()
+ box_state.offset_top;
+ box_state.inset_top;
Vector<float> collapsible_margins;
@ -529,7 +529,7 @@ void BlockFormattingContext::place_block_level_element_in_normal_flow_horizontal
if (containing_block.computed_values().text_align() == CSS::TextAlign::LibwebCenter) {
x += (available_width_within_containing_block / 2) - box_state.content_width / 2;
} else {
x += box_state.margin_box_left() + box_state.offset_left;
x += box_state.margin_box_left() + box_state.inset_left;
}
box_state.offset = Gfx::FloatPoint { x, box_state.offset.y() };
@ -592,7 +592,7 @@ void BlockFormattingContext::layout_floating_box(Box const& box, BlockContainer
// First we place the box normally (to get the right y coordinate.)
// If we have a LineBuilder, we're in the middle of inline layout, otherwise this is block layout.
if (line_builder) {
float y_offset = box_state.margin_box_top() + box_state.offset_top;
float y_offset = box_state.margin_box_top() + box_state.inset_top;
line_builder->break_if_needed(layout_mode, box_state.border_box_width(), false);
box_state.offset.set_y(line_builder->current_y() + y_offset);
line_builder->adjust_last_line_after_inserting_floating_box({}, box.computed_values().float_(), box_state.border_box_width());