Fix the rem unit.

(I think it’s never worked in over a year since it was implemented…)
This commit is contained in:
Simon Sapin 2016-03-08 22:17:33 +01:00
parent 78b16bcc1d
commit 54790d0ae5
3 changed files with 4 additions and 1 deletions

View file

@ -6847,7 +6847,7 @@ pub fn cascade(viewport_size: Size2D<Au>,
}
if is_root_element {
context.root_font_size = context.font_size;
style.root_font_size = context.font_size;
}
if seen.get_font_style() || seen.get_font_weight() || seen.get_font_stretch() ||

View file

@ -1,10 +1,12 @@
<!DOCTYPE html>
<html style="font-size: 7px">
<title>font-size (issues #1435, #3417)</title>
<link rel=match href=font_size_ref.html>
<style>p { margin: .5em }</style>
<body style="font-size: 20px">
<p style="font-size: 24pt">24pt is 32px.
<p style="font-size: 2em">2em is 40px.
<p style="font-size: 2rem">2rem is 14px.
<p style="font-size: 200%">200% is 40px.
<p style="font-size: smaller">smaller is 17px.
<p style="font-size: larger">larger is 24px.

View file

@ -4,6 +4,7 @@
<body>
<p style="font-size: 32px">24pt is 32px.
<p style="font-size: 40px">2em is 40px.
<p style="font-size: 14px">2rem is 14px.
<p style="font-size: 40px">200% is 40px.
<p style="font-size: 17px">smaller is 17px.
<p style="font-size: 24px">larger is 24px.