mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
auto merge of #1436 : SimonSapin/servo/font-size-em, r=kmcallister
Font-based units in the font-size property refer to the font-size of the parent, not itself.
This commit is contained in:
commit
acdc0e1afa
5 changed files with 46 additions and 1 deletions
|
@ -1140,7 +1140,12 @@ pub fn cascade(applicable_declarations: &[Arc<~[PropertyDeclaration]>],
|
||||||
% for style_struct, longhands in LONGHANDS_PER_STYLE_STRUCT:
|
% for style_struct, longhands in LONGHANDS_PER_STYLE_STRUCT:
|
||||||
${style_struct}: style_structs::${style_struct} {
|
${style_struct}: style_structs::${style_struct} {
|
||||||
% for longhand in longhands:
|
% 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
|
||||||
},
|
},
|
||||||
% endfor
|
% endfor
|
||||||
|
|
|
@ -19,3 +19,5 @@
|
||||||
== acid1_a.html acid1_b.html
|
== acid1_a.html acid1_b.html
|
||||||
== text_decoration_propagation_a.html text_decoration_propagation_b.html
|
== text_decoration_propagation_a.html text_decoration_propagation_b.html
|
||||||
== inline_text_align_a.html inline_text_align_b.html
|
== inline_text_align_a.html inline_text_align_b.html
|
||||||
|
== font_size_em.html font_size_em_ref.html
|
||||||
|
== font_size_percentage.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>
|
13
src/test/ref/font_size_percentage.html
Normal file
13
src/test/ref/font_size_percentage.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>font-size: 200% (Bug #1435)</title>
|
||||||
|
<style type="text/css">
|
||||||
|
body { font-size: 20px }
|
||||||
|
p { font-size: 200%; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>This text should be 40px high.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue