servo: Merge #2592 - Fix the vertical alignment error for img tag (from june0cho:fix_vertical_align); r=SimonSapin

It fixes the wrong vertical alignment for img element. (related to #2422, #2554)
Worked with @ryanc

Source-Repo: https://github.com/servo/servo
Source-Revision: d293b469442ddc7de4257c14bcba685218019598
This commit is contained in:
Junyoung Cho 2014-06-05 18:58:30 -04:00
Родитель a27e32ba0a
Коммит 4ab42a2b22
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -985,7 +985,11 @@ impl InlineFlow {
vertical_align::middle => {
// TODO: x-height value should be used from font info.
let xheight = Au(0);
(-(xheight + fragment.content_height()).scale_by(0.5), false)
let fragment_height = fragment.content_height();
let offset_top = -(xheight + fragment_height).scale_by(0.5);
*height_above_baseline = offset_top.scale_by(-1.0);
*depth_below_baseline = fragment_height - *height_above_baseline;
(offset_top, false)
},
vertical_align::sub => {
// TODO: The proper position for subscripts should be used. Lower the baseline to