diff options
-rw-r--r-- | src/components/style/properties.rs.mako | 7 | ||||
-rw-r--r-- | src/test/ref/basic.list | 2 | ||||
-rw-r--r-- | src/test/ref/font_size_em.html | 13 | ||||
-rw-r--r-- | src/test/ref/font_size_em_ref.html | 12 | ||||
-rw-r--r-- | src/test/ref/font_size_percentage.html | 13 |
5 files changed, 46 insertions, 1 deletions
diff --git a/src/components/style/properties.rs.mako b/src/components/style/properties.rs.mako index e8b10bc4669..95c33427fa7 100644 --- a/src/components/style/properties.rs.mako +++ b/src/components/style/properties.rs.mako @@ -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 diff --git a/src/test/ref/basic.list b/src/test/ref/basic.list index 787823656c2..732f6b1e14a 100644 --- a/src/test/ref/basic.list +++ b/src/test/ref/basic.list @@ -19,3 +19,5 @@ == 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 +== font_size_percentage.html font_size_em_ref.html diff --git a/src/test/ref/font_size_em.html b/src/test/ref/font_size_em.html new file mode 100644 index 00000000000..5f1983d12c0 --- /dev/null +++ b/src/test/ref/font_size_em.html @@ -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> diff --git a/src/test/ref/font_size_em_ref.html b/src/test/ref/font_size_em_ref.html new file mode 100644 index 00000000000..3697fdb0e6d --- /dev/null +++ b/src/test/ref/font_size_em_ref.html @@ -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> diff --git a/src/test/ref/font_size_percentage.html b/src/test/ref/font_size_percentage.html new file mode 100644 index 00000000000..d344ea782e9 --- /dev/null +++ b/src/test/ref/font_size_percentage.html @@ -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> |