diff options
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index bd522dccf0a..337f7799138 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -62,7 +62,7 @@ use devtools_traits::AttrInfo; use smallvec::VecLike; use style::legacy::{UnsignedIntegerAttribute, from_declaration}; use style::properties::DeclaredValue; -use style::properties::longhands::{self, background_image, border_spacing}; +use style::properties::longhands::{self, background_image, border_spacing, font_family}; use style::properties::{PropertyDeclarationBlock, PropertyDeclaration, parse_style_attribute}; use style::values::CSSFloat; use style::values::specified::{self, CSSColor, CSSRGBA}; @@ -302,6 +302,22 @@ impl RawLayoutElementHelpers for Element { })))); } + let font_family = if self.is_htmlfontelement() { + let this: &HTMLFontElement = mem::transmute(self); + this.get_face() + } else { + None + }; + + if let Some(font_family) = font_family { + hints.push(from_declaration( + PropertyDeclaration::FontFamily( + DeclaredValue::Value( + font_family::computed_value::T(vec![ + font_family::computed_value::FontFamily::FamilyName( + font_family)]))))); + } + let cellspacing = if self.is_htmltableelement() { let this: &HTMLTableElement = mem::transmute(self); this.get_cellspacing() |