Prefer length and percentage for word spacing

This commit is contained in:
Ravi Shankar 2016-08-09 11:16:53 +05:30
parent 7ed9134e5a
commit a04028eede
15 changed files with 135 additions and 10 deletions

View file

@ -26,6 +26,7 @@ libc = "0.2"
log = "0.3.5"
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
ordered-float = "0.2.2"
plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"}
range = {path = "../range"}

View file

@ -35,6 +35,7 @@ extern crate libc;
extern crate log;
extern crate msg;
extern crate net_traits;
extern crate ordered_float;
#[macro_use]
#[no_link]
extern crate plugins as servo_plugins;

View file

@ -17,6 +17,7 @@ use gfx::text::text_run::TextRun;
use gfx::text::util::{self, CompressionMode};
use inline::{FIRST_FRAGMENT_OF_ELEMENT, InlineFragments, LAST_FRAGMENT_OF_ELEMENT};
use linked_list::split_off_head;
use ordered_float::NotNaN;
use range::Range;
use std::borrow::ToOwned;
use std::collections::LinkedList;
@ -164,7 +165,9 @@ impl TextRunScanner {
};
text_transform = inherited_text_style.text_transform;
letter_spacing = inherited_text_style.letter_spacing.0;
word_spacing = inherited_text_style.word_spacing.0.unwrap_or(Au(0));
word_spacing = inherited_text_style.word_spacing.0
.map(|lop| lop.to_hash_key())
.unwrap_or((Au(0), NotNaN::new(0.0).unwrap()));
text_rendering = inherited_text_style.text_rendering;
}