mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement <font> 'face' attribute
This commit is contained in:
parent
768993f03f
commit
3ae76f4e76
8 changed files with 72 additions and 138 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue