mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
style: Use SmallVec in the computed value representation of most stuff.
This commit is contained in:
parent
caa66a880a
commit
0c5681140a
9 changed files with 68 additions and 57 deletions
|
@ -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,()> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue