diff options
author | Glenn Watson <gw@intuitionlibrary.com> | 2014-09-26 17:12:22 +1000 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2014-09-26 17:12:22 +1000 |
commit | cf79e64a5aae68604e2c194310b650aca481c92a (patch) | |
tree | 49906a2fb459f3ab7d42f36a472042523b971309 /components/layout/text.rs | |
parent | 20f5fdd000408867ac2d3a90ad9a8b55cfb8bc9e (diff) | |
download | servo-cf79e64a5aae68604e2c194310b650aca481c92a.tar.gz servo-cf79e64a5aae68604e2c194310b650aca481c92a.zip |
Improve acid2. Fix line height calculation. Text fragments get correct enclosing element style.
* Enabled acid2 on mac + linux. Updated the reference image. The only difference from the
real acid2 now is the paint order and a 1 pixel horizontal offset on the nose.
* Change line-height to be calculated correctly.
* Apply enclosing element style to text fragments.
Diffstat (limited to 'components/layout/text.rs')
-rw-r--r-- | components/layout/text.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/components/layout/text.rs b/components/layout/text.rs index c297eb4efd0..27bc60e39ab 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -317,12 +317,10 @@ pub fn computed_style_to_font_style(style: &ComputedValues) -> FontStyle { /// 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 = style.get_font().font_size; - let from_inline = match style.get_inheritedbox().line_height { + match style.get_inheritedbox().line_height { line_height::Normal => metrics.line_gap, line_height::Number(l) => font_size.scale_by(l), line_height::Length(l) => l - }; - let minimum = style.get_inheritedbox()._servo_minimum_line_height; - Au::max(from_inline, minimum) + } } |