mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 16:58:58 +00:00
LibWeb: Explicitly update LineBuilder's last line at end of IFC run
Currently we're relying on LineBuilder's destructor to handle updating the last line, if required. In order to fix an issue with our absolute positioning code, we need to be able to update the last line earlier than that. Remove the destructor and replace it with an explicit call to LineBuilder::update_last_line(). No functional changes.
This commit is contained in:
parent
90bc805cb0
commit
349fdd9f47
Notes:
github-actions[bot]
2025-08-28 11:46:53 +00:00
Author: https://github.com/gmta
Commit: 349fdd9f47
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6006
3 changed files with 7 additions and 8 deletions
|
@ -447,6 +447,8 @@ void InlineFormattingContext::generate_line_boxes()
|
|||
auto& box_state = m_state.get_mutable(*box);
|
||||
box_state.set_static_position_rect(calculate_static_position_rect(*box));
|
||||
}
|
||||
|
||||
line_builder.update_last_line();
|
||||
}
|
||||
|
||||
bool InlineFormattingContext::any_floats_intrude_at_block_offset(CSSPixels block_offset) const
|
||||
|
|
|
@ -21,12 +21,6 @@ LineBuilder::LineBuilder(InlineFormattingContext& context, LayoutState& layout_s
|
|||
begin_new_line(false);
|
||||
}
|
||||
|
||||
LineBuilder::~LineBuilder()
|
||||
{
|
||||
if (m_last_line_needs_update)
|
||||
update_last_line();
|
||||
}
|
||||
|
||||
void LineBuilder::break_line(ForcedBreak forced_break, Optional<CSSPixels> next_item_width)
|
||||
{
|
||||
// FIXME: Respect inline direction.
|
||||
|
@ -35,7 +29,9 @@ void LineBuilder::break_line(ForcedBreak forced_break, Optional<CSSPixels> next_
|
|||
last_line_box.m_has_break = true;
|
||||
last_line_box.m_has_forced_break = forced_break == ForcedBreak::Yes;
|
||||
|
||||
m_last_line_needs_update = true;
|
||||
update_last_line();
|
||||
|
||||
size_t break_count = 0;
|
||||
bool floats_intrude_at_current_y = false;
|
||||
do {
|
||||
|
@ -192,9 +188,11 @@ bool LineBuilder::should_break(CSSPixels next_item_width)
|
|||
|
||||
void LineBuilder::update_last_line()
|
||||
{
|
||||
if (!m_last_line_needs_update)
|
||||
return;
|
||||
m_last_line_needs_update = false;
|
||||
auto& line_boxes = m_containing_block_used_values.line_boxes;
|
||||
|
||||
auto& line_boxes = m_containing_block_used_values.line_boxes;
|
||||
if (line_boxes.is_empty())
|
||||
return;
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ class LineBuilder {
|
|||
|
||||
public:
|
||||
LineBuilder(InlineFormattingContext&, LayoutState&, LayoutState::UsedValues& containing_block_used_values, CSS::Direction, CSS::WritingMode);
|
||||
~LineBuilder();
|
||||
|
||||
enum class ForcedBreak {
|
||||
No,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue