mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
combine normal and keep-all into a single strategy
This commit is contained in:
parent
44c26e014a
commit
fb66abba74
1 changed files with 4 additions and 13 deletions
|
@ -1637,12 +1637,12 @@ impl Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
match self.style().get_inheritedtext().word_break {
|
match self.style().get_inheritedtext().word_break {
|
||||||
word_break::T::normal => {
|
word_break::T::normal | word_break::T::keep_all => {
|
||||||
// Break at normal word boundaries, allowing for soft wrap opportunities.
|
// Break at normal word boundaries. keep-all forbids soft wrap opportunities.
|
||||||
let soft_wrap_breaking_strategy =
|
let natural_word_breaking_strategy =
|
||||||
text_fragment_info.run.natural_word_slices_in_range(&text_fragment_info.range);
|
text_fragment_info.run.natural_word_slices_in_range(&text_fragment_info.range);
|
||||||
self.calculate_split_position_using_breaking_strategy(
|
self.calculate_split_position_using_breaking_strategy(
|
||||||
soft_wrap_breaking_strategy,
|
natural_word_breaking_strategy,
|
||||||
max_inline_size,
|
max_inline_size,
|
||||||
flags)
|
flags)
|
||||||
}
|
}
|
||||||
|
@ -1655,15 +1655,6 @@ impl Fragment {
|
||||||
character_breaking_strategy,
|
character_breaking_strategy,
|
||||||
max_inline_size,
|
max_inline_size,
|
||||||
flags)
|
flags)
|
||||||
},
|
|
||||||
word_break::T::keep_all => {
|
|
||||||
// Break at word boundaries, and forbid soft wrap opportunities.
|
|
||||||
let natural_word_breaking_strategy =
|
|
||||||
text_fragment_info.run.natural_word_slices_in_range(&text_fragment_info.range);
|
|
||||||
self.calculate_split_position_using_breaking_strategy(
|
|
||||||
natural_word_breaking_strategy,
|
|
||||||
max_inline_size,
|
|
||||||
flags)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue