Implement Calc for LengthOrPercentage

This commit is contained in:
David Zbarsky 2015-08-11 17:20:23 -04:00
parent fa5ad1c6b4
commit 9556141e57
6 changed files with 165 additions and 13 deletions

View file

@ -988,7 +988,12 @@ impl InlineFlow {
let percent_offset = line_height.scale_by(p);
offset_from_baseline = offset_from_baseline - percent_offset
}
}
vertical_align::T::Calc(calc) => {
let line_height = fragment.calculate_line_height(layout_context);
let percent_offset = line_height.scale_by(calc.percentage());
offset_from_baseline = offset_from_baseline - percent_offset - calc.length()
}
}
}
(offset_from_baseline - ascent, largest_size_updated)
}