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

@ -699,37 +699,13 @@ ${helpers.predefined_type("font-language-override",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-fonts-3/#propdef-font-language-override")} spec="https://drafts.csswg.org/css-fonts-3/#propdef-font-language-override")}
<%helpers:longhand name="-x-lang" products="gecko" animation_value_type="none" ${helpers.predefined_type("-x-lang",
enabled_in="" "XLang",
spec="Internal (not web-exposed)"> products="gecko",
pub use self::computed_value::T as SpecifiedValue; initial_value="computed::XLang::get_initial_value()",
animation_value_type="none",
pub mod computed_value { enabled_in="",
use Atom; spec="Internal (not web-exposed)")}
use std::fmt;
use style_traits::ToCss;
impl ToCss for T {
fn to_css<W>(&self, _: &mut W) -> fmt::Result where W: fmt::Write {
Ok(())
}
}
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue)]
pub struct T(pub Atom);
}
#[inline]
pub fn get_initial_value() -> computed_value::T {
computed_value::T(atom!(""))
}
pub fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>)
-> Result<SpecifiedValue, ParseError<'i>> {
debug_assert!(false, "Should be set directly by presentation attributes only.");
Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
}
</%helpers:longhand>
// MathML properties // MathML properties
<%helpers:longhand name="-moz-script-size-multiplier" products="gecko" animation_value_type="none" <%helpers:longhand name="-moz-script-size-multiplier" products="gecko" animation_value_type="none"

View file

@ -16,7 +16,7 @@ use values::specified::font as specified;
use values::specified::length::{FontBaseSize, NoCalcLength}; use values::specified::length::{FontBaseSize, NoCalcLength};
pub use values::computed::Length as MozScriptMinSize; pub use values::computed::Length as MozScriptMinSize;
pub use values::specified::font::{XTextZoom, FontSynthesis, FontVariantSettings}; pub use values::specified::font::{XTextZoom, XLang, FontSynthesis, FontVariantSettings};
/// As of CSS Fonts Module Level 3, only the following values are /// As of CSS Fonts Module Level 3, only the following values are
/// valid: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 /// valid: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900

View file

@ -39,7 +39,7 @@ pub use self::border::{BorderRadius, BorderCornerRadius, BorderSpacing};
pub use self::font::{FontSize, FontSizeAdjust, FontSynthesis, FontWeight, FontVariantAlternates}; pub use self::font::{FontSize, FontSizeAdjust, FontSynthesis, FontWeight, FontVariantAlternates};
pub use self::font::{FontLanguageOverride, FontVariantSettings, FontVariantEastAsian}; pub use self::font::{FontLanguageOverride, FontVariantSettings, FontVariantEastAsian};
pub use self::font::{FontVariantLigatures, FontVariantNumeric, FontFeatureSettings}; pub use self::font::{FontVariantLigatures, FontVariantNumeric, FontFeatureSettings};
pub use self::font::{MozScriptLevel, MozScriptMinSize, XTextZoom}; pub use self::font::{MozScriptLevel, MozScriptMinSize, XTextZoom, XLang};
pub use self::box_::{AnimationIterationCount, AnimationName, ScrollSnapType, VerticalAlign}; pub use self::box_::{AnimationIterationCount, AnimationName, ScrollSnapType, VerticalAlign};
pub use self::color::{Color, ColorPropertyValue, RGBAColor}; pub use self::color::{Color, ColorPropertyValue, RGBAColor};
pub use self::effects::{BoxShadow, Filter, SimpleShadow}; pub use self::effects::{BoxShadow, Filter, SimpleShadow};

View file

@ -4,7 +4,6 @@
//! Specified values for font properties //! Specified values for font properties
#[cfg(feature = "gecko")]
use Atom; use Atom;
use app_units::Au; use app_units::Au;
use byteorder::{BigEndian, ByteOrder}; 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))] #[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
#[derive(Clone, Debug, PartialEq, ToCss)] #[derive(Clone, Debug, PartialEq, ToCss)]
/// Specifies the minimum font size allowed due to changes in scriptlevel. /// Specifies the minimum font size allowed due to changes in scriptlevel.

View file

@ -33,7 +33,7 @@ pub use self::border::{BorderImageSideWidth, BorderRadius, BorderSideWidth, Bord
pub use self::font::{FontSize, FontSizeAdjust, FontSynthesis, FontWeight, FontVariantAlternates}; pub use self::font::{FontSize, FontSizeAdjust, FontSynthesis, FontWeight, FontVariantAlternates};
pub use self::font::{FontLanguageOverride, FontVariantSettings, FontVariantEastAsian}; pub use self::font::{FontLanguageOverride, FontVariantSettings, FontVariantEastAsian};
pub use self::font::{FontVariantLigatures, FontVariantNumeric, FontFeatureSettings}; pub use self::font::{FontVariantLigatures, FontVariantNumeric, FontFeatureSettings};
pub use self::font::{MozScriptLevel, MozScriptMinSize, XTextZoom}; pub use self::font::{MozScriptLevel, MozScriptMinSize, XTextZoom, XLang};
pub use self::box_::{AnimationIterationCount, AnimationName, ScrollSnapType, VerticalAlign}; pub use self::box_::{AnimationIterationCount, AnimationName, ScrollSnapType, VerticalAlign};
pub use self::color::{Color, ColorPropertyValue, RGBAColor}; pub use self::color::{Color, ColorPropertyValue, RGBAColor};
pub use self::effects::{BoxShadow, Filter, SimpleShadow}; pub use self::effects::{BoxShadow, Filter, SimpleShadow};