mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
Prefer Servo-specific ToCss for all types
This commit is contained in:
parent
5dbc8d02c9
commit
6061985898
44 changed files with 149 additions and 161 deletions
|
@ -2,13 +2,14 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use cssparser::{DeclarationListParser, parse_important, ToCss};
|
||||
use cssparser::{DeclarationListParser, parse_important};
|
||||
use cssparser::{Parser, AtRuleParser, DeclarationParser, Delimiter};
|
||||
use error_reporting::ParseErrorReporter;
|
||||
use parser::{ParserContext, ParserContextExtraData, log_css_error};
|
||||
use std::ascii::AsciiExt;
|
||||
use std::boxed::Box as StdBox;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use stylesheets::Origin;
|
||||
use super::*;
|
||||
use url::Url;
|
||||
|
|
|
@ -54,9 +54,9 @@
|
|||
<%def name="vector_longhand(name, gecko_only=False, allow_empty=False, **kwargs)">
|
||||
<%call expr="longhand(name, **kwargs)">
|
||||
% if product == "gecko" or not gecko_only:
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::HasViewportPercentage;
|
||||
use style_traits::ToCss;
|
||||
|
||||
impl HasViewportPercentage for SpecifiedValue {
|
||||
fn has_viewport_percentage(&self) -> bool {
|
||||
|
@ -324,6 +324,7 @@
|
|||
<%def name="inner_body()">
|
||||
pub use self::computed_value::T as SpecifiedValue;
|
||||
pub mod computed_value {
|
||||
use style_traits::ToCss;
|
||||
define_css_keyword_enum! { T:
|
||||
% for value in data.longhands_by_name[name].keyword.values_for(product):
|
||||
"${value}" => ${to_rust_ident(value)},
|
||||
|
@ -370,8 +371,8 @@
|
|||
use values::NoViewportPercentage;
|
||||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
pub mod computed_value {
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -438,10 +439,11 @@
|
|||
% if shorthand:
|
||||
pub mod ${shorthand.ident} {
|
||||
#[allow(unused_imports)]
|
||||
use cssparser::{Parser, ToCss};
|
||||
use cssparser::Parser;
|
||||
use parser::ParserContext;
|
||||
use properties::{longhands, PropertyDeclaration, DeclaredValue, Shorthand};
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
||||
pub struct Longhands {
|
||||
% for sub_property in shorthand.sub_properties:
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use app_units::Au;
|
||||
use cssparser::{Color as CSSParserColor, Parser, RGBA, ToCss};
|
||||
use cssparser::{Color as CSSParserColor, Parser, RGBA};
|
||||
use euclid::{Point2D, Size2D};
|
||||
use properties::PropertyDeclaration;
|
||||
use properties::longhands;
|
||||
|
@ -20,6 +20,7 @@ use properties::longhands::visibility::computed_value::T as Visibility;
|
|||
use properties::longhands::z_index::computed_value::T as ZIndex;
|
||||
use std::cmp;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use super::ComputedValues;
|
||||
use values::computed::{Angle, LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
|
||||
use values::computed::{BorderRadiusSize, LengthOrNone};
|
||||
|
|
|
@ -12,10 +12,9 @@ ${helpers.predefined_type("background-color", "CSSColor",
|
|||
|
||||
<%helpers:vector_longhand name="background-image" animatable="False"
|
||||
has_uncacheable_values="${product == 'gecko'}">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::specified::Image;
|
||||
use values::LocalToCss;
|
||||
use values::NoViewportPercentage;
|
||||
|
||||
pub mod computed_value {
|
||||
|
@ -88,9 +87,8 @@ ${helpers.predefined_type("background-color", "CSSColor",
|
|||
</%helpers:vector_longhand>
|
||||
|
||||
<%helpers:vector_longhand name="background-position" animatable="True">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::position::Position;
|
||||
|
||||
|
@ -149,9 +147,10 @@ ${helpers.single_keyword("background-origin",
|
|||
animatable=False)}
|
||||
|
||||
<%helpers:vector_longhand name="background-size" animatable="True">
|
||||
use cssparser::{ToCss, Token};
|
||||
use cssparser::Token;
|
||||
use std::ascii::AsciiExt;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
pub mod computed_value {
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
% for side in ["top", "right", "bottom", "left"]:
|
||||
<%helpers:longhand name="border-${side}-width" animatable="True">
|
||||
use app_units::Au;
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::BorderWidth;
|
||||
|
||||
|
@ -67,9 +67,8 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box",
|
|||
|
||||
// https://drafts.csswg.org/css-backgrounds-3/#border-image-source
|
||||
<%helpers:longhand name="border-image-source" products="gecko" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
use values::specified::Image;
|
||||
|
||||
|
@ -139,10 +138,9 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box",
|
|||
|
||||
// https://drafts.csswg.org/css-backgrounds-3/#border-image-outset
|
||||
<%helpers:longhand name="border-image-outset" products="gecko" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::LocalToCss;
|
||||
use values::specified::LengthOrNumber;
|
||||
|
||||
impl HasViewportPercentage for SpecifiedValue {
|
||||
|
@ -253,9 +251,8 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box",
|
|||
|
||||
// https://drafts.csswg.org/css-backgrounds-3/#border-image-repeat
|
||||
<%helpers:longhand name="border-image-repeat" products="gecko" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
|
||||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
@ -327,9 +324,8 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box",
|
|||
|
||||
// https://drafts.csswg.org/css-backgrounds-3/#border-image-width
|
||||
<%helpers:longhand name="border-image-width" products="gecko" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::{LengthOrPercentage, Number};
|
||||
|
||||
|
@ -523,9 +519,8 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box",
|
|||
|
||||
// https://drafts.csswg.org/css-backgrounds-3/#border-image-slice
|
||||
<%helpers:longhand name="border-image-slice" products="gecko" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
use values::specified::{Number, Percentage};
|
||||
|
||||
|
|
|
@ -27,11 +27,12 @@
|
|||
%>
|
||||
pub use self::computed_value::T as SpecifiedValue;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
||||
pub mod computed_value {
|
||||
use style_traits::ToCss;
|
||||
#[allow(non_camel_case_types)]
|
||||
#[derive(Clone, Eq, PartialEq, Copy, Hash, RustcEncodable, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
||||
|
@ -41,7 +42,7 @@
|
|||
% endfor
|
||||
}
|
||||
|
||||
impl ::cssparser::ToCss for T {
|
||||
impl ToCss for T {
|
||||
fn to_css<W>(&self, dest: &mut W) -> ::std::fmt::Result
|
||||
where W: ::std::fmt::Write {
|
||||
match *self {
|
||||
|
@ -148,8 +149,9 @@ ${helpers.single_keyword("clear", "none left right both",
|
|||
|
||||
<%helpers:longhand name="vertical-align"
|
||||
animatable="True">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
<% vertical_align = data.longhands_by_name["vertical-align"] %>
|
||||
<% vertical_align.keyword = Keyword("vertical-align",
|
||||
|
@ -157,7 +159,6 @@ ${helpers.single_keyword("clear", "none left right both",
|
|||
extra_gecko_values="middle-with-baseline") %>
|
||||
<% vertical_align_keywords = vertical_align.keyword.values_for(product) %>
|
||||
|
||||
use values::HasViewportPercentage;
|
||||
impl HasViewportPercentage for SpecifiedValue {
|
||||
fn has_viewport_percentage(&self) -> bool {
|
||||
match *self {
|
||||
|
@ -204,7 +205,7 @@ ${helpers.single_keyword("clear", "none left right both",
|
|||
pub mod computed_value {
|
||||
use app_units::Au;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::{CSSFloat, computed};
|
||||
#[allow(non_camel_case_types)]
|
||||
#[derive(PartialEq, Copy, Clone, Debug)]
|
||||
|
@ -215,7 +216,7 @@ ${helpers.single_keyword("clear", "none left right both",
|
|||
% endfor
|
||||
LengthOrPercentage(computed::LengthOrPercentage),
|
||||
}
|
||||
impl ::cssparser::ToCss for T {
|
||||
impl ToCss for T {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
match *self {
|
||||
% for keyword in vertical_align_keywords:
|
||||
|
@ -282,13 +283,13 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
animatable="False">
|
||||
use super::overflow_x;
|
||||
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::NoViewportPercentage;
|
||||
|
||||
pub use self::computed_value::T as SpecifiedValue;
|
||||
|
||||
use values::NoViewportPercentage;
|
||||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
||||
impl ToCss for SpecifiedValue {
|
||||
|
@ -327,8 +328,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
||||
pub mod computed_value {
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::computed::{Context, ToComputedValue};
|
||||
|
||||
pub use values::computed::Time as SingleComputedValue;
|
||||
|
@ -426,9 +427,9 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
TransitionTimingFunction::Steps(1, StartEnd::End);
|
||||
|
||||
pub mod computed_value {
|
||||
use cssparser::ToCss;
|
||||
use euclid::point::Point2D;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
pub use self::TransitionTimingFunction as SingleComputedValue;
|
||||
|
@ -581,8 +582,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
pub use self::computed_value::T as SpecifiedValue;
|
||||
|
||||
pub mod computed_value {
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
// NB: Can't generate the type here because it needs all the longhands
|
||||
// generated beforehand.
|
||||
pub use properties::animated_properties::TransitionProperty;
|
||||
|
@ -646,9 +647,9 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
use values::NoViewportPercentage;
|
||||
|
||||
pub mod computed_value {
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use Atom;
|
||||
use style_traits::ToCss;
|
||||
|
||||
pub use Atom as SingleComputedValue;
|
||||
|
||||
|
@ -732,8 +733,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
|||
use values::NoViewportPercentage;
|
||||
|
||||
pub mod computed_value {
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
||||
pub use self::AnimationIterationCount as SingleComputedValue;
|
||||
|
||||
|
@ -842,9 +843,8 @@ ${helpers.keyword_list("animation-fill-mode",
|
|||
</%helpers:longhand>
|
||||
|
||||
<%helpers:longhand products="gecko" name="scroll-snap-points-y" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::LengthOrPercentage;
|
||||
|
||||
|
|
|
@ -8,9 +8,8 @@
|
|||
|
||||
// FIXME: This prop should be animatable.
|
||||
<%helpers:longhand name="column-width" experimental="True" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
impl HasViewportPercentage for SpecifiedValue {
|
||||
|
@ -91,8 +90,8 @@
|
|||
|
||||
// FIXME: This prop should be animatable.
|
||||
<%helpers:longhand name="column-count" experimental="True" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
|
||||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
@ -171,9 +170,8 @@
|
|||
|
||||
// FIXME: This prop should be animatable.
|
||||
<%helpers:longhand name="column-gap" experimental="True" products="servo" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
impl HasViewportPercentage for SpecifiedValue {
|
||||
|
|
|
@ -23,8 +23,9 @@
|
|||
pub mod computed_value {
|
||||
use super::super::list_style_type;
|
||||
|
||||
use cssparser::{self, ToCss};
|
||||
use cssparser;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -175,11 +176,12 @@
|
|||
|
||||
<%helpers:longhand name="counter-increment" products="servo" animatable="False">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use super::content;
|
||||
use values::NoViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
use cssparser::{ToCss, Token, serialize_identifier};
|
||||
use cssparser::{Token, serialize_identifier};
|
||||
use std::borrow::{Cow, ToOwned};
|
||||
|
||||
pub use self::computed_value::T as SpecifiedValue;
|
||||
|
|
|
@ -13,10 +13,10 @@ ${helpers.predefined_type("opacity",
|
|||
animatable=True)}
|
||||
|
||||
<%helpers:vector_longhand name="box-shadow" allow_empty="True" animatable="True">
|
||||
use cssparser::{self, ToCss};
|
||||
use cssparser;
|
||||
use std::fmt;
|
||||
use parser::Parse;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
|
@ -189,9 +189,8 @@ ${helpers.predefined_type("opacity",
|
|||
|
||||
// FIXME: This prop should be animatable
|
||||
<%helpers:longhand name="clip" products="servo" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
// NB: `top` and `left` are 0 if `auto` per CSS 2.1 11.1.2.
|
||||
|
@ -405,11 +404,9 @@ ${helpers.predefined_type("opacity",
|
|||
// FIXME: This prop should be animatable
|
||||
<%helpers:longhand name="filter" animatable="False">
|
||||
//pub use self::computed_value::T as SpecifiedValue;
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use values::CSSFloat;
|
||||
use values::HasViewportPercentage;
|
||||
use style_traits::ToCss;
|
||||
use values::{CSSFloat, HasViewportPercentage};
|
||||
use values::specified::{Angle, Length};
|
||||
|
||||
impl HasViewportPercentage for SpecifiedValue {
|
||||
|
@ -675,11 +672,9 @@ ${helpers.predefined_type("opacity",
|
|||
|
||||
<%helpers:longhand name="transform" products="servo" animatable="True">
|
||||
use app_units::Au;
|
||||
use values::CSSFloat;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::{CSSFloat, HasViewportPercentage};
|
||||
|
||||
pub mod computed_value {
|
||||
use values::CSSFloat;
|
||||
|
@ -1293,13 +1288,11 @@ ${helpers.single_keyword("transform-style",
|
|||
|
||||
<%helpers:longhand name="transform-origin" products="servo" animatable="True">
|
||||
use app_units::Au;
|
||||
use values::LocalToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::{Length, LengthOrPercentage, Percentage};
|
||||
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
|
||||
pub mod computed_value {
|
||||
use properties::animated_properties::Interpolate;
|
||||
use values::computed::{Length, LengthOrPercentage};
|
||||
|
@ -1408,12 +1401,11 @@ ${helpers.predefined_type("perspective",
|
|||
|
||||
// FIXME: This prop should be animatable
|
||||
<%helpers:longhand name="perspective-origin" products="servo" animatable="False">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::specified::{LengthOrPercentage, Percentage};
|
||||
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
|
||||
pub mod computed_value {
|
||||
use values::computed::LengthOrPercentage;
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
||||
pub mod computed_value {
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use Atom;
|
||||
use style_traits::ToCss;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Hash)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
||||
|
@ -137,8 +137,8 @@ ${helpers.single_keyword("font-variant",
|
|||
animatable=False)}
|
||||
|
||||
<%helpers:longhand name="font-weight" need_clone="True" animatable="True">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
|
||||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
@ -271,10 +271,9 @@ ${helpers.single_keyword("font-variant",
|
|||
|
||||
<%helpers:longhand name="font-size" need_clone="True" animatable="True">
|
||||
use app_units::Au;
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::FONT_MEDIUM_PX;
|
||||
use values::HasViewportPercentage;
|
||||
use style_traits::ToCss;
|
||||
use values::{FONT_MEDIUM_PX, HasViewportPercentage};
|
||||
use values::specified::{LengthOrPercentage, Length, Percentage};
|
||||
|
||||
impl ToCss for SpecifiedValue {
|
||||
|
@ -351,11 +350,10 @@ ${helpers.single_keyword("font-variant",
|
|||
</%helpers:longhand>
|
||||
|
||||
<%helpers:longhand products="gecko" name="font-synthesis" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
@ -438,8 +436,8 @@ ${helpers.single_keyword("font-variant-position",
|
|||
animatable=False)}
|
||||
|
||||
<%helpers:longhand name="font-feature-settings" products="none" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
pub use self::computed_value::T as SpecifiedValue;
|
||||
|
@ -448,9 +446,9 @@ ${helpers.single_keyword("font-variant-position",
|
|||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
||||
pub mod computed_value {
|
||||
use cssparser::ToCss;
|
||||
use cssparser::Parser;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -555,8 +553,8 @@ ${helpers.single_keyword("font-variant-position",
|
|||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
||||
pub mod computed_value {
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
||||
impl ToCss for T {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
|
|
|
@ -56,8 +56,8 @@ ${helpers.single_keyword("image-rendering",
|
|||
derived_from="display"
|
||||
products="servo"
|
||||
animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::NoViewportPercentage;
|
||||
|
||||
|
|
|
@ -18,11 +18,9 @@ ${helpers.single_keyword("caption-side", "top bottom",
|
|||
|
||||
<%helpers:longhand name="border-spacing" animatable="False">
|
||||
use app_units::Au;
|
||||
use values::LocalToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
pub mod computed_value {
|
||||
use app_units::Au;
|
||||
|
|
|
@ -7,11 +7,9 @@
|
|||
<% data.new_style_struct("InheritedText", inherited=True, gecko_name="Text") %>
|
||||
|
||||
<%helpers:longhand name="line-height" animatable="True">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use values::CSSFloat;
|
||||
use values::HasViewportPercentage;
|
||||
use style_traits::ToCss;
|
||||
use values::{CSSFloat, HasViewportPercentage};
|
||||
|
||||
impl HasViewportPercentage for SpecifiedValue {
|
||||
fn has_viewport_percentage(&self) -> bool {
|
||||
|
@ -153,6 +151,7 @@
|
|||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
pub mod computed_value {
|
||||
use style_traits::ToCss;
|
||||
macro_rules! define_text_align {
|
||||
( $( $name: ident ( $string: expr ) => $discriminant: expr, )+ ) => {
|
||||
define_css_keyword_enum! { T:
|
||||
|
@ -209,9 +208,8 @@
|
|||
|
||||
// FIXME: This prop should be animatable.
|
||||
<%helpers:longhand name="letter-spacing" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
impl HasViewportPercentage for SpecifiedValue {
|
||||
|
@ -290,9 +288,8 @@
|
|||
</%helpers:longhand>
|
||||
|
||||
<%helpers:longhand name="word-spacing" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
impl HasViewportPercentage for SpecifiedValue {
|
||||
|
@ -405,10 +402,10 @@ ${helpers.single_keyword("text-align-last",
|
|||
derived_from="display text-decoration"
|
||||
need_clone="True" products="servo"
|
||||
animatable="False">
|
||||
use cssparser::{RGBA, ToCss};
|
||||
use cssparser::RGBA;
|
||||
use std::fmt;
|
||||
|
||||
use values:: NoViewportPercentage;
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
|
@ -529,9 +526,9 @@ ${helpers.single_keyword("text-align-last",
|
|||
</%helpers:single_keyword_computed>
|
||||
|
||||
<%helpers:longhand name="text-shadow" animatable="True">
|
||||
use cssparser::{self, ToCss};
|
||||
use cssparser;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
impl HasViewportPercentage for SpecifiedValue {
|
||||
|
@ -739,10 +736,9 @@ ${helpers.single_keyword("text-align-last",
|
|||
|
||||
<%helpers:longhand name="text-emphasis-style" products="gecko" need_clone="True" animatable="False">
|
||||
use computed_values::writing_mode::T as writing_mode;
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
use values::LocalToCss;
|
||||
use values::NoViewportPercentage;
|
||||
|
||||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
|
|
@ -31,12 +31,12 @@ ${helpers.predefined_type("list-style-image", "UrlOrNone", "computed_value::T::N
|
|||
animatable="False")}
|
||||
|
||||
<%helpers:longhand name="quotes" animatable="False">
|
||||
use cssparser::Token;
|
||||
use std::borrow::Cow;
|
||||
use std::fmt;
|
||||
use values::NoViewportPercentage;
|
||||
use style_traits::ToCss;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
use cssparser::{ToCss, Token};
|
||||
use values::NoViewportPercentage;
|
||||
|
||||
pub use self::computed_value::T as SpecifiedValue;
|
||||
|
||||
|
|
|
@ -29,9 +29,8 @@ ${helpers.predefined_type("outline-color", "CSSColor", "::cssparser::Color::Curr
|
|||
|
||||
<%helpers:longhand name="outline-width" animatable="True">
|
||||
use app_units::Au;
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::HasViewportPercentage;
|
||||
|
||||
impl ToCss for SpecifiedValue {
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
||||
pub mod computed_value {
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::cursor::Cursor;
|
||||
use style_traits::ToCss;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Copy, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
pub type SpecifiedValue = computed_value::T;
|
||||
pub mod computed_value {
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
||||
#[derive(PartialEq, Clone, Eq, Copy, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
|
|
@ -51,9 +51,8 @@ ${helpers.single_keyword("mask-type", "luminance alpha",
|
|||
products="gecko", animatable=False)}
|
||||
|
||||
<%helpers:longhand name="clip-path" animatable="False" products="gecko">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::LocalToCss;
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
use values::specified::basic_shape::{ShapeSource, GeometryBox};
|
||||
|
||||
|
@ -148,18 +147,17 @@ ${helpers.single_keyword("mask-composite",
|
|||
|
||||
<%helpers:vector_longhand name="mask-image" products="gecko" animatable="False"
|
||||
has_uncacheable_values="${product == 'gecko'}">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use url::Url;
|
||||
use values::specified::{Image, UrlExtraData};
|
||||
use values::LocalToCss;
|
||||
use values::NoViewportPercentage;
|
||||
|
||||
pub mod computed_value {
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use url::Url;
|
||||
use values::{computed, LocalToCss};
|
||||
use values::computed;
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum T {
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
${helpers.single_keyword("text-overflow", "clip ellipsis", animatable=False)}
|
||||
% else:
|
||||
<%helpers:longhand name="text-overflow" animatable="False">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
@ -104,10 +104,10 @@ ${helpers.single_keyword("unicode-bidi",
|
|||
custom_cascade="${product == 'servo'}"
|
||||
animatable="False"
|
||||
disable_when_testing="True">
|
||||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
|
|
@ -19,7 +19,7 @@ use std::sync::Arc;
|
|||
use Atom;
|
||||
use app_units::Au;
|
||||
#[cfg(feature = "servo")] use cssparser::{Color as CSSParserColor, RGBA};
|
||||
use cssparser::{Parser, ToCss, TokenSerializationType};
|
||||
use cssparser::{Parser, TokenSerializationType};
|
||||
use error_reporting::ParseErrorReporter;
|
||||
use url::Url;
|
||||
#[cfg(feature = "servo")] use euclid::side_offsets::SideOffsets2D;
|
||||
|
@ -28,10 +28,9 @@ use computed_values;
|
|||
#[cfg(feature = "servo")] use logical_geometry::{LogicalMargin, PhysicalSide};
|
||||
use logical_geometry::WritingMode;
|
||||
use parser::{ParserContext, ParserContextExtraData};
|
||||
use style_traits::ToCss;
|
||||
use stylesheets::Origin;
|
||||
#[cfg(feature = "servo")] use values::LocalToCss;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed;
|
||||
use values::{HasViewportPercentage, computed};
|
||||
use cascade_info::CascadeInfo;
|
||||
use rule_tree::StrongRuleNode;
|
||||
#[cfg(feature = "servo")] use values::specified::BorderStyle;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use cssparser::ToCss;
|
||||
use properties::{AppendableValue, DeclaredValue, PropertyDeclaration, Shorthand};
|
||||
use style_traits::ToCss;
|
||||
use values::specified::{BorderStyle, CSSColor};
|
||||
use std::fmt;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue