mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
layout: Stop going to the DOM for vertical align font sizing.
This commit is contained in:
parent
5b685bc1bd
commit
b39861bf34
1 changed files with 5 additions and 7 deletions
|
@ -785,18 +785,16 @@ impl Flow for InlineFlow {
|
||||||
// parent's content area.
|
// parent's content area.
|
||||||
|
|
||||||
// We should calculate the distance from baseline to the top of parent's content
|
// We should calculate the distance from baseline to the top of parent's content
|
||||||
// area. But for now we assume it's the parent's font size.
|
// area. But for now we assume it's the font size.
|
||||||
let mut parent_text_top;
|
//
|
||||||
|
// The spec does not state which font to use. Previous versions of the code used
|
||||||
|
// the parent's font; this code uses the current font.
|
||||||
|
let parent_text_top = cur_box.style().Font.font_size;
|
||||||
|
|
||||||
// We should calculate the distance from baseline to the bottom of the parent's
|
// We should calculate the distance from baseline to the bottom of the parent's
|
||||||
// content area. But for now we assume it's zero.
|
// content area. But for now we assume it's zero.
|
||||||
let parent_text_bottom = Au::new(0);
|
let parent_text_bottom = Au::new(0);
|
||||||
|
|
||||||
let parent = cur_box.node.parent_node().unwrap();
|
|
||||||
let parent_style = parent.style();
|
|
||||||
let font_size = parent_style.get().Font.font_size;
|
|
||||||
parent_text_top = font_size;
|
|
||||||
|
|
||||||
// Calculate a relative offset from the baseline.
|
// Calculate a relative offset from the baseline.
|
||||||
//
|
//
|
||||||
// The no-update flag decides whether `biggest_top` and `biggest_bottom` are
|
// The no-update flag decides whether `biggest_top` and `biggest_bottom` are
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue