Skip to content

Commit

Permalink
Add font-style descriptor in @font-face
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Feb 2, 2017
1 parent 5405fb0 commit 8767b0d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions components/style/font_face.rs
Expand Up @@ -9,6 +9,7 @@
#![deny(missing_docs)]

use computed_values::font_family::FamilyName;
#[cfg(feature = "gecko")] use computed_values::font_style;
use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser};
use parser::{ParserContext, log_css_error, Parse};
use std::fmt;
Expand Down Expand Up @@ -282,6 +283,22 @@ macro_rules! font_face_descriptors {
}

/// css-name rust_identifier: Type = initial_value,
#[cfg(feature = "gecko")]
font_face_descriptors! {
mandatory descriptors = [
/// The specified url.
"font-family" family: FamilyName = FamilyName(atom!("")),

/// The format hints specified with the `format()` function.
"src" sources: Vec<Source> = Vec::new(),
]
optional descriptors = [
/// The style of this font face
"font-style" style: font_style::T = font_style::T::normal,
]
}

#[cfg(feature = "servo")]
font_face_descriptors! {
mandatory descriptors = [
/// The specified url.
Expand Down
7 changes: 7 additions & 0 deletions components/style/properties/helpers.mako.rs
Expand Up @@ -380,6 +380,13 @@
-> Result<SpecifiedValue, ()> {
SpecifiedValue::parse(input)
}
impl Parse for SpecifiedValue {
#[inline]
fn parse(_context: &ParserContext, input: &mut Parser)
-> Result<SpecifiedValue, ()> {
SpecifiedValue::parse(input)
}
}
</%def>
% if vector:
<%call expr="vector_longhand(name, keyword=Keyword(name, values, **keyword_kwargs), **kwargs)">
Expand Down

0 comments on commit 8767b0d

Please sign in to comment.