mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +00:00
LibWeb: Use cached UsedValues pointer for floating boxes in more places
This commit is contained in:
parent
81deaad7ad
commit
0705efda13
Notes:
github-actions[bot]
2025-02-11 23:40:31 +00:00
Author: https://github.com/awesomekling
Commit: 0705efda13
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3543
1 changed files with 2 additions and 4 deletions
|
@ -131,15 +131,13 @@ void BlockFormattingContext::parent_context_did_dimension_child_root_box()
|
|||
|
||||
// Left-side floats: offset_from_edge is from left edge (0) to left content edge of floating_box.
|
||||
for (auto& floating_box : m_left_floats.all_boxes) {
|
||||
auto& box_state = m_state.get_mutable(floating_box->box);
|
||||
box_state.set_content_x(floating_box->offset_from_edge);
|
||||
floating_box->used_values.set_content_x(floating_box->offset_from_edge);
|
||||
}
|
||||
|
||||
// Right-side floats: offset_from_edge is from right edge (float_containing_block_width) to the left content edge of floating_box.
|
||||
for (auto& floating_box : m_right_floats.all_boxes) {
|
||||
auto float_containing_block_width = containing_block_width_for(floating_box->box);
|
||||
auto& box_state = m_state.get_mutable(floating_box->box);
|
||||
box_state.set_content_x(float_containing_block_width - floating_box->offset_from_edge);
|
||||
floating_box->used_values.set_content_x(float_containing_block_width - floating_box->offset_from_edge);
|
||||
}
|
||||
|
||||
if (m_layout_mode == LayoutMode::Normal) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue