mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +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
|
@ -4,7 +4,7 @@
|
|||
|
||||
//! Computed values.
|
||||
|
||||
use Atom;
|
||||
use {Atom, Namespace};
|
||||
use context::QuirksMode;
|
||||
use euclid::Size2D;
|
||||
use font_metrics::FontMetricsProvider;
|
||||
|
@ -19,6 +19,7 @@ use std::fmt;
|
|||
#[cfg(feature = "servo")]
|
||||
use std::sync::Arc;
|
||||
use style_traits::ToCss;
|
||||
use style_traits::cursor::Cursor;
|
||||
use super::{CSSFloat, CSSInteger};
|
||||
use super::generics::{GreaterThanOrEqualToOne, NonNegative};
|
||||
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!(u16);
|
||||
trivial_to_computed_value!(bool);
|
||||
trivial_to_computed_value!(i32);
|
||||
trivial_to_computed_value!(f32);
|
||||
trivial_to_computed_value!(Atom);
|
||||
trivial_to_computed_value!(BorderStyle);
|
||||
trivial_to_computed_value!(Cursor);
|
||||
trivial_to_computed_value!(Namespace);
|
||||
trivial_to_computed_value!(String);
|
||||
|
||||
/// A `<number>` value.
|
||||
pub type Number = CSSFloat;
|
||||
|
|
|
@ -71,7 +71,7 @@ impl SymbolsType {
|
|||
///
|
||||
/// Since wherever <counter-style> is used, 'none' is a valid value as
|
||||
/// 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 {
|
||||
/// `none`
|
||||
None,
|
||||
|
|
|
@ -21,7 +21,6 @@ use super::computed::{Context, ToComputedValue};
|
|||
use super::generics::{GreaterThanOrEqualToOne, NonNegative};
|
||||
use super::generics::grid::{GridLine as GenericGridLine, TrackBreadth as GenericTrackBreadth};
|
||||
use super::generics::grid::{TrackSize as GenericTrackSize, TrackList as GenericTrackList};
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
use values::specified::calc::CalcNode;
|
||||
|
||||
pub use properties::animated_properties::TransitionProperty;
|
||||
|
@ -84,8 +83,6 @@ pub mod url {
|
|||
use cssparser::Parser;
|
||||
use parser::{Parse, ParserContext};
|
||||
use style_traits::ParseError;
|
||||
#[cfg(feature = "gecko")]
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
#[cfg(feature = "servo")]
|
||||
pub use ::servo::url::*;
|
||||
|
@ -100,10 +97,6 @@ impl Parse for SpecifiedUrl {
|
|||
}
|
||||
|
||||
impl Eq for SpecifiedUrl {}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
impl ComputedValueAsSpecified for SpecifiedUrl {}
|
||||
|
||||
}
|
||||
|
||||
/// Parse an `<integer>` value, handling `calc()` correctly.
|
||||
|
@ -681,8 +674,8 @@ pub type NamespaceId = ();
|
|||
/// An attr(...) rule
|
||||
///
|
||||
/// `[namespace? `|`]? ident`
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue)]
|
||||
pub struct Attr {
|
||||
/// Optional namespace
|
||||
pub namespace: Option<(Namespace, NamespaceId)>,
|
||||
|
@ -777,5 +770,3 @@ impl ToCss for Attr {
|
|||
dest.write_str(")")
|
||||
}
|
||||
}
|
||||
|
||||
impl ComputedValueAsSpecified for Attr {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue