Skip to content

Commit

Permalink
Auto merge of #20073 - servo:keywordsize, r=emilio
Browse files Browse the repository at this point in the history
Remove some useless manual layout optimisation for KeywordSize

<!-- 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/20073)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo authored Feb 19, 2018
2 parents 6afdf7c + e976955 commit be902d5
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions components/style/values/generics/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,11 @@ where
}

/// CSS font keywords
#[derive(Animate, ComputeSquaredDistance, MallocSizeOf, ToAnimatedValue, ToAnimatedZero)]
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf)]
#[derive(PartialEq, ToAnimatedValue, ToAnimatedZero)]
#[allow(missing_docs)]
pub enum KeywordSize {
XXSmall = 1, // This is to enable the NonZero optimization
// which simplifies the representation of Option<KeywordSize>
// in bindgen
XXSmall,
XSmall,
Small,
Medium,
Expand All @@ -217,17 +215,9 @@ pub enum KeywordSize {

impl KeywordSize {
/// Convert to an HTML <font size> value
pub fn html_size(&self) -> u8 {
match *self {
KeywordSize::XXSmall => 0,
KeywordSize::XSmall => 1,
KeywordSize::Small => 2,
KeywordSize::Medium => 3,
KeywordSize::Large => 4,
KeywordSize::XLarge => 5,
KeywordSize::XXLarge => 6,
KeywordSize::XXXLarge => 7,
}
#[inline]
pub fn html_size(self) -> u8 {
self as u8
}
}

Expand Down

0 comments on commit be902d5

Please sign in to comment.