Support 'font-style: oblique'.

This commit is contained in:
Deokjin Kim 2015-01-19 19:50:45 +09:00
parent 58c1b121a7
commit 80a6f0ae08
4 changed files with 44 additions and 1 deletions

View file

@ -139,7 +139,7 @@ impl FontContext {
// so they will never be released. Find out a good time to drop them. // so they will never be released. Find out a good time to drop them.
let desc = FontTemplateDescriptor::new(style.font_weight, let desc = FontTemplateDescriptor::new(style.font_weight,
style.font_style == font_style::T::italic); style.font_style == font_style::T::italic || style.font_style == font_style::T::oblique);
let mut fonts = SmallVec8::new(); let mut fonts = SmallVec8::new();
for family in style.font_family.iter() { for family in style.font_family.iter() {

View file

@ -26,6 +26,7 @@
# 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.html font_size_ref.html == font_size.html font_size_ref.html
== font_style.html font_style_ref.html
== img_size_a.html img_size_b.html == img_size_a.html img_size_b.html
== img_dynamic_remove.html img_dynamic_remove_ref.html == img_dynamic_remove.html img_dynamic_remove_ref.html
== upper_id_attr.html upper_id_attr_ref.html == upper_id_attr.html upper_id_attr_ref.html

21
tests/ref/font_style.html Normal file
View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<style>
p.normal {
font-style: normal;
}
p.italic {
font-style: italic;
}
</style>
</head>
<body>
<p class="normal">This is a paragraph, normal.</p>
<p class="italic">This is a paragraph, italic(oblique).</p>
</body>
</html>

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<style>
p.normal {
font-style: normal;
}
p.oblique {
font-style: oblique;
}
</style>
</head>
<body>
<p class="normal">This is a paragraph, normal.</p>
<p class="oblique">This is a paragraph, italic(oblique).</p>
</body>
</html>