mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fix whitespace_pre with incremental reflow turned on.
This implements fragment merging, in order to incrementally reflow linebroken text. This makes the `whitespace_pre.html` reftest pass with incremental reflow turned on with `-i`.
This commit is contained in:
parent
6a11ee89de
commit
481adcd654
6 changed files with 209 additions and 30 deletions
|
@ -199,7 +199,10 @@ impl TextRunScanner {
|
|||
// Next, concatenate all of the transformed strings together, saving the new
|
||||
// character indices.
|
||||
let mut run_str = String::new();
|
||||
let mut new_ranges: Vec<Range<CharIndex>> = vec![];
|
||||
|
||||
let mut new_ranges: Vec<Range<CharIndex>> =
|
||||
Vec::with_capacity(transformed_strs.len());
|
||||
|
||||
let mut char_total = CharIndex(0);
|
||||
for i in range(0, transformed_strs.len() as int) {
|
||||
let added_chars = CharIndex(transformed_strs[i as uint].as_slice().char_len() as int);
|
||||
|
@ -323,4 +326,3 @@ pub fn line_height_from_style(style: &ComputedValues, metrics: &FontMetrics) ->
|
|||
line_height::Length(l) => l
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue