Make text-align: justify incremental layout safe

This commit is contained in:
Ulf Nilsson 2016-05-08 18:38:09 +02:00
parent da85439093
commit 0f983cd11f
7 changed files with 97 additions and 92 deletions

View file

@ -393,7 +393,11 @@ impl WebRenderDisplayItemConverter for DisplayItem {
for slice in item.text_run.natural_word_slices_in_visual_order(&item.range) {
for glyph in slice.glyphs.iter_glyphs_for_byte_range(&slice.range) {
let glyph_advance = glyph.advance();
let glyph_advance = if glyph.char_is_space() {
glyph.advance() + item.text_run.extra_word_spacing
} else {
glyph.advance()
};
if !slice.glyphs.is_whitespace() {
let glyph_offset = glyph.offset().unwrap_or(Point2D::zero());
let glyph = webrender_traits::GlyphInstance {