mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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.
|
||||
|
||||
// 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.
|
||||
let mut parent_text_top;
|
||||
// area. But for now we assume it's the font size.
|
||||
//
|
||||
// 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
|
||||
// content area. But for now we assume it's zero.
|
||||
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.
|
||||
//
|
||||
// The no-update flag decides whether `biggest_top` and `biggest_bottom` are
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue