mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
layout: Implement overflow-wrap
/word-wrap
per CSS-TEXT § 6.2.
This property is used by approximately 55% of page loads. To implement the line breaking behavior, the "breaking strategy" has been cleaned up and abstracted. This should allow us to easily support other similar properties in the future, such as `text-overflow` and `word-break`.
This commit is contained in:
parent
1be7d7cced
commit
6943ddb93e
8 changed files with 356 additions and 139 deletions
|
@ -855,8 +855,8 @@ impl ScaledFontExtensionMethods for ScaledFont {
|
|||
let mut azglyphs = vec!();
|
||||
azglyphs.reserve(range.length().to_uint());
|
||||
|
||||
for (glyphs, _offset, slice_range) in run.iter_slices_for_range(range) {
|
||||
for (_i, glyph) in glyphs.iter_glyphs_for_char_range(&slice_range) {
|
||||
for slice in run.natural_word_slices_in_range(range) {
|
||||
for (_i, glyph) in slice.glyphs.iter_glyphs_for_char_range(&slice.range) {
|
||||
let glyph_advance = glyph.advance();
|
||||
let glyph_offset = glyph.offset().unwrap_or(Zero::zero());
|
||||
let azglyph = struct__AzGlyph {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue