mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Move -x-lang outside of mako
This commit is contained in:
parent
3864f320e8
commit
d671859426
5 changed files with 38 additions and 35 deletions
|
@ -699,37 +699,13 @@ ${helpers.predefined_type("font-language-override",
|
|||
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
spec="https://drafts.csswg.org/css-fonts-3/#propdef-font-language-override")}
|
||||
|
||||
<%helpers:longhand name="-x-lang" products="gecko" animation_value_type="none"
|
||||
enabled_in=""
|
||||
spec="Internal (not web-exposed)">
|
||||
pub use self::computed_value::T as SpecifiedValue;
|
||||
|
||||
pub mod computed_value {
|
||||
use Atom;
|
||||
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>
|
||||
${helpers.predefined_type("-x-lang",
|
||||
"XLang",
|
||||
products="gecko",
|
||||
initial_value="computed::XLang::get_initial_value()",
|
||||
animation_value_type="none",
|
||||
enabled_in="",
|
||||
spec="Internal (not web-exposed)")}
|
||||
|
||||
// MathML properties
|
||||
<%helpers:longhand name="-moz-script-size-multiplier" products="gecko" animation_value_type="none"
|
||||
|
|
|
@ -16,7 +16,7 @@ use values::specified::font as specified;
|
|||
use values::specified::length::{FontBaseSize, NoCalcLength};
|
||||
|
||||
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
|
||||
/// valid: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
|
||||
|
|
|
@ -39,7 +39,7 @@ pub use self::border::{BorderRadius, BorderCornerRadius, BorderSpacing};
|
|||
pub use self::font::{FontSize, FontSizeAdjust, FontSynthesis, FontWeight, FontVariantAlternates};
|
||||
pub use self::font::{FontLanguageOverride, FontVariantSettings, FontVariantEastAsian};
|
||||
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::color::{Color, ColorPropertyValue, RGBAColor};
|
||||
pub use self::effects::{BoxShadow, Filter, SimpleShadow};
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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::{FontLanguageOverride, FontVariantSettings, FontVariantEastAsian};
|
||||
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::color::{Color, ColorPropertyValue, RGBAColor};
|
||||
pub use self::effects::{BoxShadow, Filter, SimpleShadow};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue