style: Use SmallVec in the computed value representation of most stuff.

This commit is contained in:
Emilio Cobos Álvarez 2017-04-30 12:26:37 +02:00
parent caa66a880a
commit 0c5681140a
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
9 changed files with 68 additions and 57 deletions

View file

@ -753,10 +753,11 @@ ${helpers.single_keyword("text-align-last",
pub mod computed_value {
use app_units::Au;
use cssparser::Color;
use smallvec::SmallVec;
#[derive(Clone, PartialEq, Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct T(pub Vec<TextShadow>);
pub struct T(pub SmallVec<[TextShadow; 1]>);
#[derive(Clone, PartialEq, Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
@ -833,7 +834,8 @@ ${helpers.single_keyword("text-align-last",
#[inline]
pub fn get_initial_value() -> computed_value::T {
computed_value::T(Vec::new())
use smallvec::SmallVec;
computed_value::T(SmallVec::new())
}
pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue,()> {