Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement `word-break: keep-all` (#9673) #13414

Merged
merged 4 commits into from Sep 30, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

combine normal and keep-all into a single strategy

  • Loading branch information
flacerdk committed Sep 27, 2016
commit fb66abba74df33d05eaf7a2a5e8ad8f2c88aff41
@@ -1637,12 +1637,12 @@ impl Fragment {
}

match self.style().get_inheritedtext().word_break {
word_break::T::normal => {
// Break at normal word boundaries, allowing for soft wrap opportunities.
let soft_wrap_breaking_strategy =
word_break::T::normal | word_break::T::keep_all => {
// Break at normal word boundaries. keep-all forbids 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(
soft_wrap_breaking_strategy,
natural_word_breaking_strategy,
max_inline_size,
flags)
}
@@ -1655,15 +1655,6 @@ impl Fragment {
character_breaking_strategy,
max_inline_size,
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)
}
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.