mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Auto merge of #18447 - servo:kill-cvas, r=emilio
Remove most uses of ComputedValueAsSpecified <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18447) <!-- Reviewable:end -->
This commit is contained in:
commit
5cc2b4f705
13 changed files with 30 additions and 58 deletions
|
@ -342,7 +342,7 @@ impl ToCss for System {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://drafts.csswg.org/css-counter-styles/#typedef-symbol
|
/// https://drafts.csswg.org/css-counter-styles/#typedef-symbol
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue)]
|
||||||
pub enum Symbol {
|
pub enum Symbol {
|
||||||
/// <string>
|
/// <string>
|
||||||
String(String),
|
String(String),
|
||||||
|
@ -489,7 +489,7 @@ impl Parse for Fallback {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://drafts.csswg.org/css-counter-styles/#descdef-counter-style-symbols
|
/// https://drafts.csswg.org/css-counter-styles/#descdef-counter-style-symbols
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue)]
|
||||||
pub struct Symbols(pub Vec<Symbol>);
|
pub struct Symbols(pub Vec<Symbol>);
|
||||||
|
|
||||||
impl Parse for Symbols {
|
impl Parse for Symbols {
|
||||||
|
|
|
@ -30,6 +30,7 @@ pub struct SpecifiedUrl {
|
||||||
/// a property with this specified url value.
|
/// a property with this specified url value.
|
||||||
pub image_value: Option<RefPtr<ImageValue>>,
|
pub image_value: Option<RefPtr<ImageValue>>,
|
||||||
}
|
}
|
||||||
|
trivial_to_computed_value!(SpecifiedUrl);
|
||||||
|
|
||||||
impl SpecifiedUrl {
|
impl SpecifiedUrl {
|
||||||
/// Try to parse a URL from a string value that is a valid CSS token for a
|
/// Try to parse a URL from a string value that is a valid CSS token for a
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
//! Various macro helpers.
|
//! Various macro helpers.
|
||||||
|
|
||||||
macro_rules! trivial_to_computed_value {
|
macro_rules! trivial_to_computed_value {
|
||||||
($name: ident) => {
|
($name:ty) => {
|
||||||
impl $crate::values::computed::ToComputedValue for $name {
|
impl $crate::values::computed::ToComputedValue for $name {
|
||||||
type ComputedValue = $name;
|
type ComputedValue = $name;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
<%helpers:longhand name="content" boxed="True" animation_value_type="discrete"
|
<%helpers:longhand name="content" boxed="True" animation_value_type="discrete"
|
||||||
spec="https://drafts.csswg.org/css-content/#propdef-content">
|
spec="https://drafts.csswg.org/css-content/#propdef-content">
|
||||||
use values::computed::ComputedValueAsSpecified;
|
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
use values::generics::CounterStyleOrNone;
|
use values::generics::CounterStyleOrNone;
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
|
@ -22,8 +21,6 @@
|
||||||
pub use self::computed_value::T as SpecifiedValue;
|
pub use self::computed_value::T as SpecifiedValue;
|
||||||
pub use self::computed_value::ContentItem;
|
pub use self::computed_value::ContentItem;
|
||||||
|
|
||||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
|
||||||
|
|
||||||
pub mod computed_value {
|
pub mod computed_value {
|
||||||
use cssparser;
|
use cssparser;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
@ -39,8 +36,8 @@
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
use values::specified::Attr;
|
use values::specified::Attr;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
|
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue)]
|
||||||
pub enum ContentItem {
|
pub enum ContentItem {
|
||||||
/// Literal string content.
|
/// Literal string content.
|
||||||
String(String),
|
String(String),
|
||||||
|
@ -100,8 +97,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
|
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue)]
|
||||||
pub enum T {
|
pub enum T {
|
||||||
Normal,
|
Normal,
|
||||||
None,
|
None,
|
||||||
|
|
|
@ -256,17 +256,14 @@ ${helpers.single_keyword("image-rendering",
|
||||||
spec="Nonstandard (internal layout use only)">
|
spec="Nonstandard (internal layout use only)">
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use style_traits::ToCss;
|
use style_traits::ToCss;
|
||||||
use values::computed::ComputedValueAsSpecified;
|
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "servo", derive(Deserialize, HeapSizeOf, Serialize))]
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToComputedValue)]
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
|
||||||
pub struct SpecifiedValue(pub bool);
|
pub struct SpecifiedValue(pub bool);
|
||||||
|
|
||||||
pub mod computed_value {
|
pub mod computed_value {
|
||||||
pub type T = super::SpecifiedValue;
|
pub type T = super::SpecifiedValue;
|
||||||
}
|
}
|
||||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
|
||||||
|
|
||||||
pub fn get_initial_value() -> computed_value::T {
|
pub fn get_initial_value() -> computed_value::T {
|
||||||
SpecifiedValue(false)
|
SpecifiedValue(false)
|
||||||
|
|
|
@ -136,8 +136,6 @@ ${helpers.predefined_type("marker-end", "UrlOrNone", "Either::Second(None_)",
|
||||||
animation_value_type="discrete"
|
animation_value_type="discrete"
|
||||||
products="gecko"
|
products="gecko"
|
||||||
spec="https://www.w3.org/TR/SVG2/painting.html#PaintOrder">
|
spec="https://www.w3.org/TR/SVG2/painting.html#PaintOrder">
|
||||||
|
|
||||||
use values::computed::ComputedValueAsSpecified;
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use style_traits::ToCss;
|
use style_traits::ToCss;
|
||||||
|
|
||||||
|
@ -164,8 +162,8 @@ ${helpers.predefined_type("marker-end", "UrlOrNone", "Either::Second(None_)",
|
||||||
///
|
///
|
||||||
/// Higher priority values, i.e. the values specified first,
|
/// Higher priority values, i.e. the values specified first,
|
||||||
/// will be painted first (and may be covered by paintings of lower priority)
|
/// will be painted first (and may be covered by paintings of lower priority)
|
||||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
|
#[derive(Clone, Copy, Debug, PartialEq, ToComputedValue)]
|
||||||
pub struct SpecifiedValue(pub u8);
|
pub struct SpecifiedValue(pub u8);
|
||||||
|
|
||||||
pub mod computed_value {
|
pub mod computed_value {
|
||||||
|
@ -258,10 +256,8 @@ ${helpers.predefined_type("marker-end", "UrlOrNone", "Either::Second(None_)",
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl ComputedValueAsSpecified for SpecifiedValue { }
|
|
||||||
</%helpers:longhand>
|
</%helpers:longhand>
|
||||||
|
|
||||||
<%helpers:vector_longhand name="-moz-context-properties"
|
<%helpers:vector_longhand name="-moz-context-properties"
|
||||||
animation_value_type="none"
|
animation_value_type="none"
|
||||||
products="gecko"
|
products="gecko"
|
||||||
|
|
|
@ -33,7 +33,6 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
|
||||||
<%helpers:longhand name="list-style-type" animation_value_type="discrete" boxed="True"
|
<%helpers:longhand name="list-style-type" animation_value_type="discrete" boxed="True"
|
||||||
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type">
|
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type">
|
||||||
use values::CustomIdent;
|
use values::CustomIdent;
|
||||||
use values::computed::ComputedValueAsSpecified;
|
|
||||||
use values::generics::CounterStyleOrNone;
|
use values::generics::CounterStyleOrNone;
|
||||||
|
|
||||||
pub use self::computed_value::T as SpecifiedValue;
|
pub use self::computed_value::T as SpecifiedValue;
|
||||||
|
@ -42,15 +41,13 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
|
||||||
use values::generics::CounterStyleOrNone;
|
use values::generics::CounterStyleOrNone;
|
||||||
|
|
||||||
/// <counter-style> | <string> | none
|
/// <counter-style> | <string> | none
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, ToCss)]
|
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue, ToCss)]
|
||||||
pub enum T {
|
pub enum T {
|
||||||
CounterStyle(CounterStyleOrNone),
|
CounterStyle(CounterStyleOrNone),
|
||||||
String(String),
|
String(String),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
|
||||||
|
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
impl SpecifiedValue {
|
impl SpecifiedValue {
|
||||||
/// Convert from gecko keyword to list-style-type.
|
/// Convert from gecko keyword to list-style-type.
|
||||||
|
@ -144,18 +141,15 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
|
||||||
use cssparser::serialize_string;
|
use cssparser::serialize_string;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use style_traits::ToCss;
|
use style_traits::ToCss;
|
||||||
use values::computed::ComputedValueAsSpecified;
|
|
||||||
|
|
||||||
pub use self::computed_value::T as SpecifiedValue;
|
pub use self::computed_value::T as SpecifiedValue;
|
||||||
|
|
||||||
pub mod computed_value {
|
pub mod computed_value {
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub struct T(pub Vec<(String,String)>);
|
#[derive(Clone, Debug, PartialEq, ToComputedValue)]
|
||||||
|
pub struct T(pub Vec<(String, String)>);
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
|
||||||
|
|
||||||
impl ToCss for SpecifiedValue {
|
impl ToCss for SpecifiedValue {
|
||||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||||
if self.0.is_empty() {
|
if self.0.is_empty() {
|
||||||
|
|
|
@ -9,12 +9,9 @@
|
||||||
<%helpers:longhand name="cursor" boxed="${product == 'gecko'}" animation_value_type="discrete"
|
<%helpers:longhand name="cursor" boxed="${product == 'gecko'}" animation_value_type="discrete"
|
||||||
spec="https://drafts.csswg.org/css-ui/#cursor">
|
spec="https://drafts.csswg.org/css-ui/#cursor">
|
||||||
pub use self::computed_value::T as SpecifiedValue;
|
pub use self::computed_value::T as SpecifiedValue;
|
||||||
use values::computed::ComputedValueAsSpecified;
|
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
use values::specified::url::SpecifiedUrl;
|
use values::specified::url::SpecifiedUrl;
|
||||||
|
|
||||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
|
||||||
|
|
||||||
pub mod computed_value {
|
pub mod computed_value {
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
@ -25,7 +22,7 @@
|
||||||
use values::specified::url::SpecifiedUrl;
|
use values::specified::url::SpecifiedUrl;
|
||||||
|
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, ToCss)]
|
#[derive(Clone, Copy, Debug, PartialEq, ToComputedValue, ToCss)]
|
||||||
pub enum Keyword {
|
pub enum Keyword {
|
||||||
Auto,
|
Auto,
|
||||||
Cursor(Cursor),
|
Cursor(Cursor),
|
||||||
|
@ -35,14 +32,14 @@
|
||||||
pub type T = Keyword;
|
pub type T = Keyword;
|
||||||
|
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, ToComputedValue)]
|
||||||
pub struct Image {
|
pub struct Image {
|
||||||
pub url: SpecifiedUrl,
|
pub url: SpecifiedUrl,
|
||||||
pub hotspot: Option<(f32, f32)>,
|
pub hotspot: Option<(f32, f32)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, ToComputedValue)]
|
||||||
pub struct T {
|
pub struct T {
|
||||||
pub images: Vec<Image>,
|
pub images: Vec<Image>,
|
||||||
pub keyword: Keyword,
|
pub keyword: Keyword,
|
||||||
|
|
|
@ -146,12 +146,10 @@ ${helpers.single_keyword("unicode-bidi",
|
||||||
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-line">
|
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-line">
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use style_traits::ToCss;
|
use style_traits::ToCss;
|
||||||
use values::computed::ComputedValueAsSpecified;
|
|
||||||
|
|
||||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
|
||||||
|
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
|
#[derive(ToComputedValue)]
|
||||||
pub flags SpecifiedValue: u8 {
|
pub flags SpecifiedValue: u8 {
|
||||||
const NONE = 0,
|
const NONE = 0,
|
||||||
const UNDERLINE = 0x01,
|
const UNDERLINE = 0x01,
|
||||||
|
|
|
@ -49,12 +49,10 @@ ${helpers.single_keyword("-moz-window-shadow", "none default menu tooltip sheet"
|
||||||
spec="None (Nonstandard Firefox-only property)">
|
spec="None (Nonstandard Firefox-only property)">
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use style_traits::ToCss;
|
use style_traits::ToCss;
|
||||||
use values::computed::ComputedValueAsSpecified;
|
|
||||||
|
|
||||||
|
|
||||||
pub mod computed_value {
|
pub mod computed_value {
|
||||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
|
#[derive(Clone, Copy, Debug, PartialEq, ToComputedValue)]
|
||||||
pub struct T(pub bool);
|
pub struct T(pub bool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,8 +74,6 @@ ${helpers.single_keyword("-moz-window-shadow", "none default menu tooltip sheet"
|
||||||
computed_value::T(false)
|
computed_value::T(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
|
||||||
|
|
||||||
pub fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>)
|
pub fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||||
-> Result<SpecifiedValue, ParseError<'i>> {
|
-> Result<SpecifiedValue, ParseError<'i>> {
|
||||||
match input.expect_integer()? {
|
match input.expect_integer()? {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
//! Computed values.
|
//! Computed values.
|
||||||
|
|
||||||
use Atom;
|
use {Atom, Namespace};
|
||||||
use context::QuirksMode;
|
use context::QuirksMode;
|
||||||
use euclid::Size2D;
|
use euclid::Size2D;
|
||||||
use font_metrics::FontMetricsProvider;
|
use font_metrics::FontMetricsProvider;
|
||||||
|
@ -19,6 +19,7 @@ use std::fmt;
|
||||||
#[cfg(feature = "servo")]
|
#[cfg(feature = "servo")]
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use style_traits::ToCss;
|
use style_traits::ToCss;
|
||||||
|
use style_traits::cursor::Cursor;
|
||||||
use super::{CSSFloat, CSSInteger};
|
use super::{CSSFloat, CSSInteger};
|
||||||
use super::generics::{GreaterThanOrEqualToOne, NonNegative};
|
use super::generics::{GreaterThanOrEqualToOne, NonNegative};
|
||||||
use super::generics::grid::{GridLine as GenericGridLine, TrackBreadth as GenericTrackBreadth};
|
use super::generics::grid::{GridLine as GenericGridLine, TrackBreadth as GenericTrackBreadth};
|
||||||
|
@ -332,13 +333,17 @@ impl<T> ToComputedValue for T
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trivial_to_computed_value!(Atom);
|
trivial_to_computed_value!(());
|
||||||
|
trivial_to_computed_value!(bool);
|
||||||
|
trivial_to_computed_value!(f32);
|
||||||
|
trivial_to_computed_value!(i32);
|
||||||
trivial_to_computed_value!(u8);
|
trivial_to_computed_value!(u8);
|
||||||
trivial_to_computed_value!(u16);
|
trivial_to_computed_value!(u16);
|
||||||
trivial_to_computed_value!(bool);
|
trivial_to_computed_value!(Atom);
|
||||||
trivial_to_computed_value!(i32);
|
|
||||||
trivial_to_computed_value!(f32);
|
|
||||||
trivial_to_computed_value!(BorderStyle);
|
trivial_to_computed_value!(BorderStyle);
|
||||||
|
trivial_to_computed_value!(Cursor);
|
||||||
|
trivial_to_computed_value!(Namespace);
|
||||||
|
trivial_to_computed_value!(String);
|
||||||
|
|
||||||
/// A `<number>` value.
|
/// A `<number>` value.
|
||||||
pub type Number = CSSFloat;
|
pub type Number = CSSFloat;
|
||||||
|
|
|
@ -71,7 +71,7 @@ impl SymbolsType {
|
||||||
///
|
///
|
||||||
/// Since wherever <counter-style> is used, 'none' is a valid value as
|
/// Since wherever <counter-style> is used, 'none' is a valid value as
|
||||||
/// well, we combine them into one type to make code simpler.
|
/// well, we combine them into one type to make code simpler.
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, ToCss)]
|
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue, ToCss)]
|
||||||
pub enum CounterStyleOrNone {
|
pub enum CounterStyleOrNone {
|
||||||
/// `none`
|
/// `none`
|
||||||
None,
|
None,
|
||||||
|
|
|
@ -21,7 +21,6 @@ use super::computed::{Context, ToComputedValue};
|
||||||
use super::generics::{GreaterThanOrEqualToOne, NonNegative};
|
use super::generics::{GreaterThanOrEqualToOne, NonNegative};
|
||||||
use super::generics::grid::{GridLine as GenericGridLine, TrackBreadth as GenericTrackBreadth};
|
use super::generics::grid::{GridLine as GenericGridLine, TrackBreadth as GenericTrackBreadth};
|
||||||
use super::generics::grid::{TrackSize as GenericTrackSize, TrackList as GenericTrackList};
|
use super::generics::grid::{TrackSize as GenericTrackSize, TrackList as GenericTrackList};
|
||||||
use values::computed::ComputedValueAsSpecified;
|
|
||||||
use values::specified::calc::CalcNode;
|
use values::specified::calc::CalcNode;
|
||||||
|
|
||||||
pub use properties::animated_properties::TransitionProperty;
|
pub use properties::animated_properties::TransitionProperty;
|
||||||
|
@ -84,8 +83,6 @@ pub mod url {
|
||||||
use cssparser::Parser;
|
use cssparser::Parser;
|
||||||
use parser::{Parse, ParserContext};
|
use parser::{Parse, ParserContext};
|
||||||
use style_traits::ParseError;
|
use style_traits::ParseError;
|
||||||
#[cfg(feature = "gecko")]
|
|
||||||
use values::computed::ComputedValueAsSpecified;
|
|
||||||
|
|
||||||
#[cfg(feature = "servo")]
|
#[cfg(feature = "servo")]
|
||||||
pub use ::servo::url::*;
|
pub use ::servo::url::*;
|
||||||
|
@ -100,10 +97,6 @@ impl Parse for SpecifiedUrl {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Eq for SpecifiedUrl {}
|
impl Eq for SpecifiedUrl {}
|
||||||
|
|
||||||
#[cfg(feature = "gecko")]
|
|
||||||
impl ComputedValueAsSpecified for SpecifiedUrl {}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse an `<integer>` value, handling `calc()` correctly.
|
/// Parse an `<integer>` value, handling `calc()` correctly.
|
||||||
|
@ -681,8 +674,8 @@ pub type NamespaceId = ();
|
||||||
/// An attr(...) rule
|
/// An attr(...) rule
|
||||||
///
|
///
|
||||||
/// `[namespace? `|`]? ident`
|
/// `[namespace? `|`]? ident`
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
|
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue)]
|
||||||
pub struct Attr {
|
pub struct Attr {
|
||||||
/// Optional namespace
|
/// Optional namespace
|
||||||
pub namespace: Option<(Namespace, NamespaceId)>,
|
pub namespace: Option<(Namespace, NamespaceId)>,
|
||||||
|
@ -777,5 +770,3 @@ impl ToCss for Attr {
|
||||||
dest.write_str(")")
|
dest.write_str(")")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ComputedValueAsSpecified for Attr {}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue