mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Fix #1435: em units in font-size
Font-based units in the font-size property refer to the font-size of the parent, not itself.
This commit is contained in:
parent
824c7ac613
commit
2c179cdce3
4 changed files with 32 additions and 1 deletions
|
@ -1140,7 +1140,12 @@ pub fn cascade(applicable_declarations: &[Arc<~[PropertyDeclaration]>],
|
|||
% for style_struct, longhands in LONGHANDS_PER_STYLE_STRUCT:
|
||||
${style_struct}: style_structs::${style_struct} {
|
||||
% for longhand in longhands:
|
||||
${longhand.ident}: get_computed!(${style_struct}, ${longhand.ident}),
|
||||
${longhand.ident}:
|
||||
% if longhand.ident == 'font_size':
|
||||
context.font_size,
|
||||
% else:
|
||||
get_computed!(${style_struct}, ${longhand.ident}),
|
||||
% endif
|
||||
% endfor
|
||||
},
|
||||
% endfor
|
||||
|
|
|
@ -19,3 +19,4 @@
|
|||
== acid1_a.html acid1_b.html
|
||||
== text_decoration_propagation_a.html text_decoration_propagation_b.html
|
||||
== inline_text_align_a.html inline_text_align_b.html
|
||||
== font_size_em.html font_size_em_ref.html
|
||||
|
|
13
src/test/ref/font_size_em.html
Normal file
13
src/test/ref/font_size_em.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>font-size: 2em (Bug #1435)</title>
|
||||
<style type="text/css">
|
||||
body { font-size: 20px; }
|
||||
p { font-size: 2em; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>This text should be 40px high.</p>
|
||||
</body>
|
||||
</html>
|
12
src/test/ref/font_size_em_ref.html
Normal file
12
src/test/ref/font_size_em_ref.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>font-size: 2em (Bug #1435)</title>
|
||||
<style type="text/css">
|
||||
p { font-size: 40px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>This text should be 40px high.</p>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue