Implement size attribute for <font> element

This commit is contained in:
Corey Farwell 2015-09-19 15:04:11 -04:00
parent 520c907742
commit 74e4c4fdc7
12 changed files with 201 additions and 181 deletions

View file

@ -71,7 +71,7 @@ use std::sync::Arc;
use string_cache::{Atom, Namespace, QualName};
use style::legacy::{UnsignedIntegerAttribute, from_declaration};
use style::properties::DeclaredValue;
use style::properties::longhands::{self, background_image, border_spacing, font_family};
use style::properties::longhands::{self, background_image, border_spacing, font_family, font_size};
use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, parse_style_attribute};
use style::values::CSSFloat;
use style::values::specified::{self, CSSColor, CSSRGBA};
@ -302,6 +302,19 @@ impl RawLayoutElementHelpers for Element {
font_family)])))));
}
let font_size = if let Some(this) = HTMLFontElementCast::to_ref(self) {
this.get_size()
} else {
None
};
if let Some(font_size) = font_size {
hints.push(from_declaration(
PropertyDeclaration::FontSize(
DeclaredValue::Value(
font_size::SpecifiedValue(font_size)))))
}
let cellspacing = if let Some(this) = HTMLTableElementCast::to_ref(self) {
this.get_cellspacing()
} else {