LibWeb: Add word spacing to tab size correctly

We should be adding the computed value for word spacing not letter
spacing twice.
This commit is contained in:
Kostya Farber 2024-10-27 13:13:48 +00:00 committed by Andreas Kling
commit 2f41be733f
Notes: github-actions[bot] 2024-10-28 21:56:26 +00:00
3 changed files with 59 additions and 1 deletions

View file

@ -266,7 +266,7 @@ Optional<InlineLevelIterator::Item> InlineLevelIterator::next_without_lookahead(
auto computed_word_spacing = text_node.computed_values().word_spacing();
auto letter_spacing = computed_letter_spacing.resolved(resolution_context).to_px(text_node);
auto word_spacing = computed_letter_spacing.resolved(resolution_context).to_px(text_node);
auto word_spacing = computed_word_spacing.resolved(resolution_context).to_px(text_node);
return CSSPixels::nearest_value_for(tab_number * (chunk.font->glyph_width(' ') + word_spacing.to_float() + letter_spacing.to_float()));
});