mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Do not use CVAS for specified::Attr
This commit is contained in:
parent
0254fd0635
commit
5e8ee277fc
3 changed files with 9 additions and 10 deletions
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -332,13 +332,15 @@ 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!(Namespace);
|
||||||
trivial_to_computed_value!(String);
|
trivial_to_computed_value!(String);
|
||||||
|
|
||||||
/// A `<number>` value.
|
/// A `<number>` value.
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -681,8 +680,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 +776,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