mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
layout: Implement -servo-minimum-line-height
This commit is contained in:
parent
98bf325e76
commit
392afdb014
1 changed files with 4 additions and 15 deletions
|
@ -656,11 +656,13 @@ impl Box {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn calculate_line_height(&self, font_size: Au) -> Au {
|
pub fn calculate_line_height(&self, font_size: Au) -> Au {
|
||||||
match self.line_height() {
|
let from_inline = match self.style().InheritedBox.get().line_height {
|
||||||
line_height::Normal => font_size.scale_by(1.14),
|
line_height::Normal => font_size.scale_by(1.14),
|
||||||
line_height::Number(l) => font_size.scale_by(l),
|
line_height::Number(l) => font_size.scale_by(l),
|
||||||
line_height::Length(l) => l
|
line_height::Length(l) => l
|
||||||
}
|
};
|
||||||
|
let minimum = self.style().InheritedBox.get()._servo_minimum_line_height;
|
||||||
|
Au::max(from_inline, minimum)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Populates the box model border parameters from the given computed style.
|
/// Populates the box model border parameters from the given computed style.
|
||||||
|
@ -888,10 +890,6 @@ impl Box {
|
||||||
self.style().InheritedText.get().text_align
|
self.style().InheritedText.get().text_align
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn line_height(&self) -> line_height::T {
|
|
||||||
self.style().InheritedBox.get().line_height
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn vertical_align(&self) -> vertical_align::T {
|
pub fn vertical_align(&self) -> vertical_align::T {
|
||||||
self.style().Box.get().vertical_align
|
self.style().Box.get().vertical_align
|
||||||
}
|
}
|
||||||
|
@ -944,15 +942,6 @@ impl Box {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if this element is replaced content. This is true for images, form elements,
|
|
||||||
/// and so on.
|
|
||||||
pub fn is_replaced(&self) -> bool {
|
|
||||||
match self.specific {
|
|
||||||
ImageBox(..) => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns true if this element can be split. This is true for text boxes.
|
/// Returns true if this element can be split. This is true for text boxes.
|
||||||
pub fn can_split(&self) -> bool {
|
pub fn can_split(&self) -> bool {
|
||||||
match self.specific {
|
match self.specific {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue