mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Remove a lot of unused imports
This commit is contained in:
parent
90bae7f802
commit
00bfc6b172
23 changed files with 56 additions and 122 deletions
|
@ -13,8 +13,11 @@
|
|||
<%def name="predefined_type_inner(name, type, initial_value, parse_method)">
|
||||
#[allow(unused_imports)]
|
||||
use app_units::Au;
|
||||
#[allow(unused_imports)]
|
||||
use cssparser::{Color as CSSParserColor, RGBA};
|
||||
#[allow(unused_imports)]
|
||||
use values::specified::AllowQuirks;
|
||||
#[allow(unused_imports)]
|
||||
use smallvec::SmallVec;
|
||||
pub use values::specified::${type} as SpecifiedValue;
|
||||
pub mod computed_value {
|
||||
|
@ -78,15 +81,22 @@
|
|||
% if not gecko_only:
|
||||
use smallvec::SmallVec;
|
||||
use std::fmt;
|
||||
#[allow(unused_imports)]
|
||||
use values::HasViewportPercentage;
|
||||
use style_traits::ToCss;
|
||||
|
||||
pub mod single_value {
|
||||
#[allow(unused_imports)]
|
||||
use cssparser::Parser;
|
||||
#[allow(unused_imports)]
|
||||
use parser::{Parse, ParserContext};
|
||||
#[allow(unused_imports)]
|
||||
use properties::ShorthandId;
|
||||
#[allow(unused_imports)]
|
||||
use values::computed::{Context, ToComputedValue};
|
||||
#[allow(unused_imports)]
|
||||
use values::{computed, specified};
|
||||
#[allow(unused_imports)]
|
||||
use values::{Auto, Either, None_, Normal};
|
||||
${caller.body()}
|
||||
}
|
||||
|
@ -198,6 +208,7 @@
|
|||
}
|
||||
|
||||
pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
||||
#[allow(unused_imports)]
|
||||
use parser::parse_space_or_comma_separated;
|
||||
|
||||
<%
|
||||
|
@ -253,22 +264,35 @@
|
|||
%>
|
||||
/// ${property.spec}
|
||||
pub mod ${property.ident} {
|
||||
#![allow(unused_imports)]
|
||||
% if not property.derived_from:
|
||||
#[allow(unused_imports)]
|
||||
use cssparser::Parser;
|
||||
#[allow(unused_imports)]
|
||||
use parser::{Parse, ParserContext};
|
||||
#[allow(unused_imports)]
|
||||
use properties::{UnparsedValue, ShorthandId};
|
||||
% endif
|
||||
#[allow(unused_imports)]
|
||||
use values::{Auto, Either, None_, Normal};
|
||||
#[allow(unused_imports)]
|
||||
use cascade_info::CascadeInfo;
|
||||
#[allow(unused_imports)]
|
||||
use error_reporting::ParseErrorReporter;
|
||||
#[allow(unused_imports)]
|
||||
use properties::longhands;
|
||||
#[allow(unused_imports)]
|
||||
use properties::{DeclaredValue, LonghandId, LonghandIdSet};
|
||||
#[allow(unused_imports)]
|
||||
use properties::{CSSWideKeyword, ComputedValues, PropertyDeclaration};
|
||||
#[allow(unused_imports)]
|
||||
use properties::style_structs;
|
||||
#[allow(unused_imports)]
|
||||
use stylearc::Arc;
|
||||
#[allow(unused_imports)]
|
||||
use values::computed::{Context, ToComputedValue};
|
||||
#[allow(unused_imports)]
|
||||
use values::{computed, generics, specified};
|
||||
#[allow(unused_imports)]
|
||||
use Atom;
|
||||
${caller.body()}
|
||||
#[allow(unused_variables)]
|
||||
|
@ -454,7 +478,6 @@
|
|||
keyword = keyword=Keyword(name, values, **keyword_kwargs)
|
||||
%>
|
||||
<%call expr="longhand(name, keyword=Keyword(name, values, **keyword_kwargs), **kwargs)">
|
||||
use values::HasViewportPercentage;
|
||||
use properties::longhands::system_font::SystemFont;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
@ -576,7 +599,6 @@
|
|||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
% endif
|
||||
|
||||
use values::HasViewportPercentage;
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
</%call>
|
||||
</%def>
|
||||
|
@ -738,7 +760,6 @@
|
|||
% if shorthand:
|
||||
/// ${shorthand.spec}
|
||||
pub mod ${shorthand.ident} {
|
||||
#[allow(unused_imports)]
|
||||
use cssparser::Parser;
|
||||
use parser::ParserContext;
|
||||
use properties::{PropertyDeclaration, ParsedDeclaration};
|
||||
|
|
|
@ -34,7 +34,6 @@ ${helpers.predefined_type("background-image", "ImageLayer",
|
|||
spec="https://drafts.csswg.org/css-backgrounds/#the-background-repeat">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
define_css_keyword_enum!(RepeatKeyword:
|
||||
"repeat" => Repeat,
|
||||
|
@ -163,11 +162,8 @@ ${helpers.single_keyword("background-origin",
|
|||
|
||||
<%helpers:vector_longhand name="background-size" animation_value_type="ComputedValue" extra_prefixes="webkit"
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#the-background-size">
|
||||
use cssparser::Token;
|
||||
use std::ascii::AsciiExt;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
#[allow(missing_docs)]
|
||||
pub mod computed_value {
|
||||
|
|
|
@ -62,7 +62,6 @@ ${helpers.gecko_keyword_conversion(Keyword('border-style',
|
|||
products="gecko">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::CSSColor;
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
|
@ -205,7 +204,6 @@ ${helpers.predefined_type("border-image-source", "ImageLayer",
|
|||
spec="https://drafts.csswg.org/css-backgrounds/#border-image-outset">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::{LengthOrNumber, Number};
|
||||
|
||||
pub mod computed_value {
|
||||
|
@ -310,13 +308,11 @@ ${helpers.predefined_type("border-image-source", "ImageLayer",
|
|||
spec="https://drafts.csswg.org/css-backgrounds/#border-image-repeat">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
pub mod computed_value {
|
||||
pub use super::RepeatKeyword;
|
||||
use values::computed;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -388,7 +384,6 @@ ${helpers.predefined_type("border-image-source", "ImageLayer",
|
|||
spec="https://drafts.csswg.org/css-backgrounds/#border-image-width">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::{LengthOrPercentage, Number};
|
||||
|
||||
pub mod computed_value {
|
||||
|
@ -574,7 +569,6 @@ ${helpers.predefined_type("border-image-source", "ImageLayer",
|
|||
spec="https://drafts.csswg.org/css-backgrounds/#border-image-slice">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::NumberOrPercentage as ComputedNumberOrPercentage;
|
||||
use values::specified::{NumberOrPercentage, Percentage};
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
%>
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
pub mod computed_value {
|
||||
|
@ -170,7 +169,6 @@ ${helpers.single_keyword("position", "static absolute relative fixed",
|
|||
gecko_inexhaustive="True"
|
||||
gecko_ffi_name="mFloat"
|
||||
spec="https://drafts.csswg.org/css-box/#propdef-float">
|
||||
use values::HasViewportPercentage;
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
impl ToComputedValue for SpecifiedValue {
|
||||
type ComputedValue = computed_value::T;
|
||||
|
@ -209,7 +207,6 @@ ${helpers.single_keyword("position", "static absolute relative fixed",
|
|||
gecko_enum_prefix="StyleClear"
|
||||
gecko_ffi_name="mBreakType"
|
||||
spec="https://www.w3.org/TR/CSS2/visuren.html#flow-control">
|
||||
use values::HasViewportPercentage;
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
impl ToComputedValue for SpecifiedValue {
|
||||
type ComputedValue = computed_value::T;
|
||||
|
@ -263,7 +260,6 @@ ${helpers.single_keyword("position", "static absolute relative fixed",
|
|||
spec="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::AllowQuirks;
|
||||
|
||||
<% vertical_align = data.longhands_by_name["vertical-align"] %>
|
||||
|
@ -312,10 +308,9 @@ ${helpers.single_keyword("position", "static absolute relative fixed",
|
|||
|
||||
/// The computed value for `vertical-align`.
|
||||
pub mod computed_value {
|
||||
use app_units::Au;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::{CSSFloat, computed};
|
||||
use values::computed;
|
||||
|
||||
/// The keywords are the same, and the `LengthOrPercentage` is computed
|
||||
/// here.
|
||||
|
@ -417,7 +412,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
use values::specified::Time;
|
||||
|
||||
pub use values::specified::Time as SpecifiedValue;
|
||||
use values::HasViewportPercentage;
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
pub mod computed_value {
|
||||
|
@ -449,7 +443,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
use values::specified::Number;
|
||||
use euclid::point::{Point2D, TypedPoint2D};
|
||||
use std::fmt;
|
||||
use std::marker::PhantomData;
|
||||
use style_traits::ToCss;
|
||||
|
||||
// FIXME: This could use static variables and const functions when they are available.
|
||||
|
@ -490,7 +483,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
|
||||
pub mod computed_value {
|
||||
use euclid::point::Point2D;
|
||||
use parser::{Parse, ParserContext};
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use super::FunctionKeyword;
|
||||
|
@ -755,7 +747,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
}
|
||||
}
|
||||
|
||||
use values::HasViewportPercentage;
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
#[inline]
|
||||
|
@ -786,8 +777,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
pub use properties::animated_properties::TransitionProperty as SpecifiedValue;
|
||||
|
||||
pub mod computed_value {
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
// NB: Can't generate the type here because it needs all the longhands
|
||||
// generated beforehand.
|
||||
pub use super::SpecifiedValue as T;
|
||||
|
@ -801,7 +790,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
TransitionProperty::All
|
||||
}
|
||||
|
||||
use values::HasViewportPercentage;
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue { }
|
||||
|
@ -830,10 +818,9 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
spec="https://drafts.csswg.org/css-animations/#propdef-animation-name">
|
||||
use Atom;
|
||||
use std::fmt;
|
||||
use std::ops::Deref;
|
||||
use style_traits::ToCss;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::{HasViewportPercentage, KeyframesName};
|
||||
use values::KeyframesName;
|
||||
|
||||
pub mod computed_value {
|
||||
pub use super::SpecifiedValue as T;
|
||||
|
@ -928,7 +915,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
pub mod computed_value {
|
||||
pub use super::SpecifiedValue as T;
|
||||
|
@ -1036,7 +1022,6 @@ ${helpers.single_keyword("animation-fill-mode",
|
|||
spec="Nonstandard (https://www.w3.org/TR/2015/WD-css-snappoints-1-20150326/#scroll-snap-points)">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::LengthOrPercentage;
|
||||
|
||||
pub mod computed_value {
|
||||
|
@ -1157,9 +1142,8 @@ ${helpers.predefined_type("scroll-snap-coordinate",
|
|||
use values::specified::{LengthOrNumber, LengthOrPercentageOrNumber as LoPoNumber, Number};
|
||||
use style_traits::ToCss;
|
||||
use style_traits::values::Css;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
use std::fmt::{self, Display};
|
||||
use std::fmt;
|
||||
|
||||
pub mod computed_value {
|
||||
use app_units::Au;
|
||||
|
@ -2121,7 +2105,6 @@ ${helpers.single_keyword("transform-style",
|
|||
use app_units::Au;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::{NoCalcLength, LengthOrPercentage, Percentage};
|
||||
|
||||
pub mod computed_value {
|
||||
|
@ -2239,7 +2222,6 @@ ${helpers.single_keyword("transform-style",
|
|||
spec="https://drafts.csswg.org/css-contain/#contain-property">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
|
@ -2392,7 +2374,6 @@ ${helpers.single_keyword("-moz-orient",
|
|||
use cssparser::serialize_identifier;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
|
@ -2465,7 +2446,6 @@ ${helpers.predefined_type("shape-outside", "basic_shape::ShapeWithShapeBox",
|
|||
use gecko_bindings::structs;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
use cssparser::RGBA;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::specified::{AllowQuirks, Color, CSSColor, CSSRGBA};
|
||||
use values::specified::{AllowQuirks, Color, CSSColor};
|
||||
|
||||
impl ToComputedValue for SpecifiedValue {
|
||||
type ComputedValue = computed_value::T;
|
||||
|
@ -122,6 +122,7 @@
|
|||
|
||||
impl SystemColor {
|
||||
pub fn parse(input: &mut Parser) -> Result<Self, ()> {
|
||||
#[cfg(feature = "gecko")]
|
||||
use std::ascii::AsciiExt;
|
||||
static PARSE_ARRAY: &'static [(&'static str, SystemColor); ${len(system_colors)}] = &[
|
||||
% for color in system_colors:
|
||||
|
|
|
@ -9,12 +9,11 @@
|
|||
<%helpers:longhand name="content" boxed="True" animation_value_type="none"
|
||||
spec="https://drafts.csswg.org/css-content/#propdef-content">
|
||||
use cssparser::Token;
|
||||
use std::ascii::AsciiExt;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
#[cfg(feature = "gecko")]
|
||||
use values::generics::CounterStyleOrNone;
|
||||
#[cfg(feature = "gecko")]
|
||||
use values::specified::url::SpecifiedUrl;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
#[cfg(feature = "servo")]
|
||||
use super::list_style_type;
|
||||
|
@ -29,6 +28,7 @@
|
|||
use cssparser;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
#[cfg(feature = "gecko")]
|
||||
use values::specified::url::SpecifiedUrl;
|
||||
|
||||
#[cfg(feature = "servo")]
|
||||
|
@ -256,11 +256,9 @@
|
|||
spec="https://drafts.csswg.org/css-lists/#propdef-counter-increment">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use super::content;
|
||||
use values::{HasViewportPercentage, CustomIdent};
|
||||
use values::CustomIdent;
|
||||
|
||||
use cssparser::{Token, serialize_identifier};
|
||||
use std::borrow::{Cow, ToOwned};
|
||||
use cssparser::Token;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct SpecifiedValue(pub Vec<(CustomIdent, specified::Integer)>);
|
||||
|
@ -278,7 +276,6 @@
|
|||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result
|
||||
where W: fmt::Write,
|
||||
{
|
||||
use cssparser::serialize_identifier;
|
||||
if self.0.is_empty() {
|
||||
return dest.write_str("none")
|
||||
}
|
||||
|
@ -348,8 +345,6 @@
|
|||
}
|
||||
|
||||
pub fn parse_common(context: &ParserContext, default_value: i32, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
||||
use std::ascii::AsciiExt;
|
||||
|
||||
if input.try(|input| input.expect_ident_matching("none")).is_ok() {
|
||||
return Ok(SpecifiedValue(Vec::new()))
|
||||
}
|
||||
|
|
|
@ -18,10 +18,8 @@ ${helpers.predefined_type("opacity",
|
|||
animation_value_type="IntermediateBoxShadowList"
|
||||
extra_prefixes="webkit"
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#box-shadow">
|
||||
use cssparser;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
pub type SpecifiedValue = specified::Shadow;
|
||||
|
||||
|
@ -47,9 +45,6 @@ ${helpers.predefined_type("opacity",
|
|||
}
|
||||
|
||||
pub mod computed_value {
|
||||
use app_units::Au;
|
||||
use std::fmt;
|
||||
use values::computed;
|
||||
use values::computed::Shadow;
|
||||
|
||||
pub type T = Shadow;
|
||||
|
@ -91,11 +86,13 @@ ${helpers.predefined_type("clip",
|
|||
flags="CREATES_STACKING_CONTEXT FIXPOS_CB"
|
||||
spec="https://drafts.fxtf.org/filters/#propdef-filter">
|
||||
//pub use self::computed_value::T as SpecifiedValue;
|
||||
use cssparser;
|
||||
use std::fmt;
|
||||
use style_traits::{self, ToCss};
|
||||
use style_traits::ToCss;
|
||||
use values::{CSSFloat, HasViewportPercentage};
|
||||
use values::specified::{Angle, CSSColor, Length, Shadow};
|
||||
use values::specified::{Angle, Length};
|
||||
#[cfg(feature = "gecko")]
|
||||
use values::specified::Shadow;
|
||||
#[cfg(feature = "gecko")]
|
||||
use values::specified::url::SpecifiedUrl;
|
||||
|
||||
#[derive(Clone, Debug, HasViewportPercentage, PartialEq)]
|
||||
|
@ -133,8 +130,10 @@ ${helpers.predefined_type("clip",
|
|||
pub mod computed_value {
|
||||
use app_units::Au;
|
||||
use values::CSSFloat;
|
||||
use values::computed::{CSSColor, Shadow};
|
||||
#[cfg(feature = "gecko")]
|
||||
use values::computed::Shadow;
|
||||
use values::computed::Angle;
|
||||
#[cfg(feature = "gecko")]
|
||||
use values::specified::url::SpecifiedUrl;
|
||||
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
|
|
|
@ -68,14 +68,11 @@
|
|||
use self::computed_value::{FontFamily, FamilyName};
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
pub mod computed_value {
|
||||
use cssparser::{CssStringWriter, Parser, serialize_identifier};
|
||||
use properties::longhands::system_font::SystemFont;
|
||||
use std::fmt::{self, Write};
|
||||
use Atom;
|
||||
use style_traits::ToCss;
|
||||
|
@ -355,7 +352,6 @@ ${helpers.single_keyword_system("font-variant-caps",
|
|||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-weight">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use properties::longhands::system_font::SystemFont;
|
||||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
@ -449,7 +445,6 @@ ${helpers.single_keyword_system("font-variant-caps",
|
|||
}
|
||||
|
||||
pub mod computed_value {
|
||||
use std::fmt;
|
||||
#[derive(PartialEq, Eq, Copy, Clone, Hash, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
||||
#[repr(u16)]
|
||||
|
@ -557,7 +552,7 @@ ${helpers.single_keyword_system("font-variant-caps",
|
|||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::{FONT_MEDIUM_PX, HasViewportPercentage};
|
||||
use values::specified::{AllowQuirks, FontRelativeLength, LengthOrPercentage, Length};
|
||||
use values::specified::{AllowQuirks, FontRelativeLength, LengthOrPercentage};
|
||||
use values::specified::{NoCalcLength, Percentage};
|
||||
use values::specified::length::FontBaseSize;
|
||||
|
||||
|
@ -694,8 +689,7 @@ ${helpers.single_keyword_system("font-variant-caps",
|
|||
type ComputedValue = Au;
|
||||
#[inline]
|
||||
fn to_computed_value(&self, cx: &Context) -> computed_value::T {
|
||||
use gecko_bindings::bindings::Gecko_GetBaseSize;
|
||||
use gecko_bindings::structs::{self, nsIAtom};
|
||||
use gecko_bindings::structs::nsIAtom;
|
||||
use values::specified::length::au_to_int_px;
|
||||
// Data from nsRuleNode.cpp in Gecko
|
||||
// Mapping from base size and HTML size to pixels
|
||||
|
@ -977,7 +971,6 @@ ${helpers.single_keyword_system("font-variant-caps",
|
|||
use properties::longhands::system_font::SystemFont;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
|
@ -1119,7 +1112,6 @@ ${helpers.single_keyword_system("font-variant-caps",
|
|||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-synthesis">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
|
@ -1204,7 +1196,6 @@ ${helpers.single_keyword_system("font-kerning",
|
|||
use properties::longhands::system_font::SystemFont;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
|
@ -1340,7 +1331,6 @@ macro_rules! exclusive_value {
|
|||
use properties::longhands::system_font::SystemFont;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
|
@ -1481,7 +1471,6 @@ macro_rules! exclusive_value {
|
|||
use properties::longhands::system_font::SystemFont;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
|
@ -1632,7 +1621,6 @@ macro_rules! exclusive_value {
|
|||
use properties::longhands::system_font::SystemFont;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
|
@ -1785,8 +1773,6 @@ ${helpers.single_keyword_system("font-variant-position",
|
|||
use properties::longhands::system_font::SystemFont;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum SpecifiedValue {
|
||||
|
@ -1869,8 +1855,6 @@ ${helpers.single_keyword_system("font-variant-position",
|
|||
/// <string> [ on | off | <integer> ]
|
||||
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
|
||||
use std::io::Cursor;
|
||||
use std::str;
|
||||
use std::ops::Deref;
|
||||
use byteorder::{ReadBytesExt, BigEndian};
|
||||
|
||||
let tag = try!(input.expect_string());
|
||||
|
@ -1929,7 +1913,6 @@ ${helpers.single_keyword_system("font-variant-position",
|
|||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use byteorder::{BigEndian, ByteOrder};
|
||||
use values::HasViewportPercentage;
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
|
@ -2064,7 +2047,6 @@ ${helpers.single_keyword_system("font-variant-position",
|
|||
|
||||
<%helpers:longhand name="-x-lang" products="gecko" animation_value_type="none" internal="True"
|
||||
spec="Internal (not web-exposed)">
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
pub use self::computed_value::T as SpecifiedValue;
|
||||
|
||||
|
@ -2103,7 +2085,6 @@ ${helpers.single_keyword_system("font-variant-position",
|
|||
predefined_type="Number" gecko_ffi_name="mScriptSizeMultiplier"
|
||||
spec="Internal (not web-exposed)"
|
||||
internal="True" disable_when_testing="True">
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
pub use self::computed_value::T as SpecifiedValue;
|
||||
|
||||
|
@ -2130,7 +2111,6 @@ ${helpers.single_keyword_system("font-variant-position",
|
|||
internal="True" disable_when_testing="True" need_clone="True">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
|
@ -2230,8 +2210,6 @@ ${helpers.single_keyword("-moz-math-variant",
|
|||
use gecko_bindings::structs::NS_MATHML_DEFAULT_SCRIPT_MIN_SIZE_PT;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::specified::length::{AU_PER_PT, FontBaseSize, NoCalcLength};
|
||||
|
||||
#[derive(Clone, Debug, HasViewportPercentage, PartialEq)]
|
||||
|
|
|
@ -68,7 +68,6 @@ ${helpers.single_keyword("image-rendering",
|
|||
use style_traits::ToCss;
|
||||
use values::specified::Angle;
|
||||
|
||||
use values::HasViewportPercentage;
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
use std::f32::consts::PI;
|
||||
|
@ -207,7 +206,6 @@ ${helpers.single_keyword("image-rendering",
|
|||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
|
|
|
@ -144,7 +144,6 @@ ${helpers.predefined_type("marker-end", "UrlOrNone", "Either::Second(None_)",
|
|||
use values::computed::ComputedValueAsSpecified;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
pub const NORMAL: u8 = 0;
|
||||
pub const FILL: u8 = 1;
|
||||
|
|
|
@ -25,7 +25,6 @@ ${helpers.single_keyword("caption-side", "top bottom",
|
|||
use app_units::Au;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::{AllowQuirks, Length};
|
||||
|
||||
pub mod computed_value {
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
spec="https://drafts.csswg.org/css2/visudet.html#propdef-line-height">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
#[derive(Clone, Debug, HasViewportPercentage, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -66,7 +65,6 @@
|
|||
}
|
||||
pub mod computed_value {
|
||||
use app_units::Au;
|
||||
use std::fmt;
|
||||
use values::CSSFloat;
|
||||
#[derive(PartialEq, Copy, Clone, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -203,7 +201,6 @@ ${helpers.single_keyword("word-break",
|
|||
gecko_enum_prefix="StyleTextJustify"
|
||||
animation_value_type="none"
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-text-justify">
|
||||
use values::HasViewportPercentage;
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
impl ToComputedValue for SpecifiedValue {
|
||||
|
@ -247,8 +244,6 @@ ${helpers.single_keyword("text-align-last",
|
|||
// TODO make this a shorthand and implement text-align-last/text-align-all
|
||||
<%helpers:longhand name="text-align" animation_value_type="none" need_clone="True"
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-text-align">
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::HasViewportPercentage;
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
pub mod computed_value {
|
||||
use style_traits::ToCss;
|
||||
|
@ -391,6 +386,7 @@ ${helpers.single_keyword("text-align-last",
|
|||
}
|
||||
}
|
||||
% else:
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
pub use self::computed_value::T as SpecifiedValue;
|
||||
pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
||||
|
@ -403,7 +399,6 @@ ${helpers.single_keyword("text-align-last",
|
|||
spec="https://drafts.csswg.org/css-text/#propdef-letter-spacing">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::AllowQuirks;
|
||||
|
||||
#[derive(Clone, Debug, HasViewportPercentage, PartialEq)]
|
||||
|
@ -480,7 +475,6 @@ ${helpers.single_keyword("text-align-last",
|
|||
spec="https://drafts.csswg.org/css-text/#propdef-word-spacing">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::AllowQuirks;
|
||||
|
||||
#[derive(Clone, Debug, HasViewportPercentage, PartialEq)]
|
||||
|
@ -561,7 +555,6 @@ ${helpers.single_keyword("text-align-last",
|
|||
use cssparser::RGBA;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
|
@ -647,7 +640,6 @@ ${helpers.single_keyword("text-align-last",
|
|||
animation_value_type="none"
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-white-space">
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::HasViewportPercentage;
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
|
@ -693,7 +685,6 @@ ${helpers.single_keyword("text-align-last",
|
|||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::specified::Shadow;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
#[derive(Clone, Debug, HasViewportPercentage, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -849,7 +840,6 @@ ${helpers.single_keyword("text-align-last",
|
|||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
|
@ -1055,7 +1045,6 @@ ${helpers.single_keyword("text-align-last",
|
|||
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-position">
|
||||
use std::fmt;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::HasViewportPercentage;
|
||||
use style_traits::ToCss;
|
||||
|
||||
define_css_keyword_enum!(HorizontalWritingModeValue:
|
||||
|
|
|
@ -36,7 +36,6 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
|
|||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::CustomIdent;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::generics::CounterStyleOrNone;
|
||||
|
||||
|
@ -105,7 +104,6 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
|
|||
boxed="${product == 'gecko'}"
|
||||
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-image">
|
||||
use std::fmt;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::specified::UrlOrNone;
|
||||
pub use self::computed_value::T as SpecifiedValue;
|
||||
|
@ -158,7 +156,6 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
|
|||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
pub use self::computed_value::T as SpecifiedValue;
|
||||
|
||||
|
|
|
@ -17,11 +17,7 @@ ${helpers.predefined_type("outline-color", "CSSColor", "computed::CSSColor::Curr
|
|||
|
||||
<%helpers:longhand name="outline-style" need_clone="True" animation_value_type="none"
|
||||
spec="https://drafts.csswg.org/css-ui/#propdef-outline-style">
|
||||
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::specified::BorderStyle;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
pub type SpecifiedValue = Either<Auto, BorderStyle>;
|
||||
|
||||
|
@ -66,10 +62,8 @@ ${helpers.predefined_type("outline-color", "CSSColor", "computed::CSSColor::Curr
|
|||
|
||||
<%helpers:longhand name="outline-width" animation_value_type="ComputedValue"
|
||||
spec="https://drafts.csswg.org/css-ui/#propdef-outline-width">
|
||||
use app_units::Au;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
impl ToCss for SpecifiedValue {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
<%helpers:longhand name="cursor" boxed="${product == 'gecko'}" animation_value_type="none"
|
||||
spec="https://drafts.csswg.org/css-ui/#cursor">
|
||||
pub use self::computed_value::T as SpecifiedValue;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
#[cfg(feature = "gecko")]
|
||||
use values::specified::url::SpecifiedUrl;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
|
@ -20,6 +20,7 @@
|
|||
use std::fmt;
|
||||
use style_traits::cursor::Cursor;
|
||||
use style_traits::ToCss;
|
||||
#[cfg(feature = "gecko")]
|
||||
use values::specified::url::SpecifiedUrl;
|
||||
|
||||
#[derive(Clone, PartialEq, Copy, Debug)]
|
||||
|
|
|
@ -178,8 +178,10 @@ ${helpers.predefined_type("flex-basis",
|
|||
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::{AllowQuirks, ${MinMax}Length};
|
||||
% if not logical:
|
||||
use values::specified::AllowQuirks;
|
||||
% endif
|
||||
use values::specified::${MinMax}Length;
|
||||
|
||||
pub mod computed_value {
|
||||
pub type T = ::values::computed::${MinMax}Length;
|
||||
|
@ -219,7 +221,9 @@ ${helpers.predefined_type("flex-basis",
|
|||
type ComputedValue = computed_value::T;
|
||||
#[inline]
|
||||
fn to_computed_value(&self, context: &Context) -> computed_value::T {
|
||||
use values::computed::${MinMax}Length;
|
||||
% if not logical or "block" in size:
|
||||
use values::computed::${MinMax}Length;
|
||||
% endif
|
||||
let computed = self.0.to_computed_value(context);
|
||||
|
||||
// filter out keyword values in the block direction
|
||||
|
@ -332,7 +336,6 @@ ${helpers.predefined_type("object-position",
|
|||
animation_value_type="none">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
pub type SpecifiedValue = computed_value::T;
|
||||
|
@ -424,8 +427,6 @@ ${helpers.predefined_type("object-position",
|
|||
use std::ops::Range;
|
||||
use str::HTML_SPACE_CHARACTERS;
|
||||
use style_traits::ToCss;
|
||||
use style_traits::values::Css;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
pub mod computed_value {
|
||||
|
|
|
@ -77,7 +77,6 @@ ${helpers.single_keyword("mask-mode",
|
|||
pub use properties::longhands::background_repeat::single_value::SpecifiedValue;
|
||||
pub use properties::longhands::background_repeat::single_value::computed_value;
|
||||
pub use properties::longhands::background_repeat::single_value::RepeatKeyword;
|
||||
use properties::longhands::background_repeat::single_value;
|
||||
|
||||
#[inline]
|
||||
pub fn get_initial_value() -> computed_value::T {
|
||||
|
|
|
@ -14,7 +14,6 @@ ${helpers.single_keyword("table-layout", "auto fixed",
|
|||
spec="Internal-only (for `<col span>` pres attr)"
|
||||
animation_value_type="none"
|
||||
internal="True">
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
spec="https://drafts.csswg.org/css-ui/#propdef-text-overflow">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use cssparser;
|
||||
|
||||
|
@ -107,7 +106,6 @@ ${helpers.single_keyword("unicode-bidi",
|
|||
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-line">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
|
@ -237,7 +235,6 @@ ${helpers.predefined_type(
|
|||
spec="https://drafts.csswg.org/css-inline/#sizing-drop-initials">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::specified::{Number, Integer};
|
||||
|
||||
|
|
|
@ -35,10 +35,8 @@ ${helpers.single_keyword("-moz-window-dragging", "default drag no-drag", product
|
|||
products="gecko"
|
||||
animation_value_type="none"
|
||||
spec="None (Nonstandard Firefox-only property)">
|
||||
use cssparser::Token;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
use app_units::Au;
|
||||
use style::attr::{AttrValue, LengthOrPercentageOrAuto, parse_length};
|
||||
use style::values::computed::CalcLengthOrPercentage;
|
||||
use style_traits::values::specified::AllowedLengthType;
|
||||
|
||||
#[test]
|
||||
fn test_length_calc() {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
fn smoke_restyle_hints() {
|
||||
use cssparser::Parser;
|
||||
use selectors::parser::SelectorList;
|
||||
use style::restyle_hints::{DependencySet, RESTYLE_LATER_SIBLINGS};
|
||||
use style::restyle_hints::DependencySet;
|
||||
use style::selector_parser::SelectorParser;
|
||||
use style::stylesheets::{Origin, Namespaces};
|
||||
let namespaces = Namespaces::default();
|
||||
|
|
|
@ -212,7 +212,7 @@ fn test_insert() {
|
|||
#[test]
|
||||
fn test_get_universal_rules() {
|
||||
thread_state::initialize(thread_state::LAYOUT);
|
||||
let (map, shared_lock) = get_mock_map(&["*|*", "#foo > *|*", "*|* > *|*", ".klass", "#id"]);
|
||||
let (map, _shared_lock) = get_mock_map(&["*|*", "#foo > *|*", "*|* > *|*", ".klass", "#id"]);
|
||||
|
||||
let decls = map.get_universal_rules(CascadeLevel::UserNormal);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue