mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-13 19:49:49 +00:00
LibWeb: Support percentages in word-spacing
Fixes crash in the created test as well as https://wpt.live/css/css-text /word-spacing/reference/word-spacing-percent-001-ref.html. The WPT test hasn't been imported as it passing is currently a false-positive due to the fact that we don't yet respect `word-spacing` in most cases.
This commit is contained in:
parent
62cf33b98e
commit
a70a397501
Notes:
github-actions[bot]
2025-08-05 10:45:07 +00:00
Author: https://github.com/Calme1709
Commit: a70a397501
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5715
Reviewed-by: https://github.com/tcl3 ✅
5 changed files with 25 additions and 15 deletions
|
@ -528,7 +528,8 @@ Optional<InlineLevelIterator::Item> InlineLevelIterator::next_without_lookahead(
|
|||
|
||||
CSS::CalculationResolutionContext calculation_context { .length_resolution_context = CSS::Length::ResolutionContext::for_layout_node(text_node) };
|
||||
auto letter_spacing = text_node.computed_values().letter_spacing().resolved(calculation_context).map([&](auto& it) { return it.to_px(text_node); }).value_or(0);
|
||||
auto word_spacing = text_node.computed_values().word_spacing().resolved(calculation_context).map([&](auto& it) { return it.to_px(text_node); }).value_or(0);
|
||||
// FIXME: We should apply word spacing to all word-separator characters not just breaking tabs
|
||||
auto word_spacing = text_node.computed_values().word_spacing().resolved(text_node, CSS::Length::make_px(chunk.font->glyph_width(' ')).to_px(text_node)).absolute_length_to_px();
|
||||
|
||||
auto x = 0.0f;
|
||||
if (chunk.has_breaking_tab) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue