style: Move -x-lang outside of mako

This commit is contained in:
CYBAI 2017-11-21 23:46:34 +08:00
parent 3864f320e8
commit d671859426
5 changed files with 38 additions and 35 deletions

View file

@ -4,7 +4,6 @@
//! Specified values for font properties
#[cfg(feature = "gecko")]
use Atom;
use app_units::Au;
use byteorder::{BigEndian, ByteOrder};
@ -1821,6 +1820,34 @@ impl ToCss for XTextZoom {
}
}
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue)]
/// Internal property that reflects the lang attribute
pub struct XLang(pub Atom);
impl XLang {
#[inline]
/// Get default value for `-x-lang`
pub fn get_initial_value() -> XLang {
XLang(atom!(""))
}
}
impl Parse for XLang {
fn parse<'i, 't>(
_: &ParserContext,
input: &mut Parser<'i, 't>
) -> Result<XLang, ParseError<'i>> {
debug_assert!(false, "Should be set directly by presentation attributes only.");
Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
}
}
impl ToCss for XLang {
fn to_css<W>(&self, _: &mut W) -> fmt::Result where W: fmt::Write {
Ok(())
}
}
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
#[derive(Clone, Debug, PartialEq, ToCss)]
/// Specifies the minimum font size allowed due to changes in scriptlevel.