mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
stylo: Add keyword info to computed value of font-size
This commit is contained in:
parent
5a6b90b14f
commit
c2fcc9ce1a
13 changed files with 141 additions and 52 deletions
|
@ -97,10 +97,10 @@ impl Flow for MulticolFlow {
|
|||
{
|
||||
let column_style = self.block_flow.fragment.style.get_column();
|
||||
|
||||
let column_gap = Au::from(match column_style.column_gap {
|
||||
Either::First(len) => len,
|
||||
Either::Second(_normal) => self.block_flow.fragment.style.get_font().font_size,
|
||||
});
|
||||
let column_gap = match column_style.column_gap {
|
||||
Either::First(len) => len.into(),
|
||||
Either::Second(_normal) => self.block_flow.fragment.style.get_font().font_size.size(),
|
||||
};
|
||||
|
||||
let mut column_count;
|
||||
if let Either::First(column_width) = column_style.column_width {
|
||||
|
|
|
@ -447,7 +447,7 @@ pub fn font_metrics_for_style(font_context: &mut FontContext, font_style: ::Serv
|
|||
|
||||
/// Returns the line block-size needed by the given computed style and font size.
|
||||
pub fn line_height_from_style(style: &ComputedValues, metrics: &FontMetrics) -> Au {
|
||||
let font_size = Au::from(style.get_font().font_size);
|
||||
let font_size = style.get_font().font_size.size();
|
||||
match style.get_inheritedtext().line_height {
|
||||
LineHeight::Normal => Au::from(metrics.line_gap),
|
||||
LineHeight::Number(l) => font_size.scale_by(l.0),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue