LibWeb: Layout text chunks based on their Unicode direction

Append text chunks to either the start or end of the text fragment,
depending on the text direction. The direction is determined by what
script its code points are from.
This commit is contained in:
BenJilks 2024-08-18 17:58:05 +01:00 committed by Andreas Kling
commit 11e7d72686
Notes: github-actions[bot] 2024-08-31 09:50:41 +00:00
18 changed files with 460 additions and 150 deletions

View file

@ -249,8 +249,10 @@ void InlineFormattingContext::generate_line_boxes(LayoutMode layout_mode)
auto& line_boxes = m_containing_block_used_values.line_boxes;
line_boxes.clear_with_capacity();
auto direction = m_context_box->computed_values().direction();
InlineLevelIterator iterator(*this, m_state, containing_block(), m_containing_block_used_values, layout_mode);
LineBuilder line_builder(*this, m_state, m_containing_block_used_values);
LineBuilder line_builder(*this, m_state, m_containing_block_used_values, direction);
// NOTE: When we ignore collapsible whitespace chunks at the start of a line,
// we have to remember how much start margin that chunk had in the inline