mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #20073 - servo:keywordsize, r=emilio
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 -->
This commit is contained in:
commit
be902d56c0
1 changed files with 6 additions and 16 deletions
|
@ -197,13 +197,11 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CSS font keywords
|
/// CSS font keywords
|
||||||
#[derive(Animate, ComputeSquaredDistance, MallocSizeOf, ToAnimatedValue, ToAnimatedZero)]
|
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf)]
|
||||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
#[derive(PartialEq, ToAnimatedValue, ToAnimatedZero)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum KeywordSize {
|
pub enum KeywordSize {
|
||||||
XXSmall = 1, // This is to enable the NonZero optimization
|
XXSmall,
|
||||||
// which simplifies the representation of Option<KeywordSize>
|
|
||||||
// in bindgen
|
|
||||||
XSmall,
|
XSmall,
|
||||||
Small,
|
Small,
|
||||||
Medium,
|
Medium,
|
||||||
|
@ -217,17 +215,9 @@ pub enum KeywordSize {
|
||||||
|
|
||||||
impl KeywordSize {
|
impl KeywordSize {
|
||||||
/// Convert to an HTML <font size> value
|
/// Convert to an HTML <font size> value
|
||||||
pub fn html_size(&self) -> u8 {
|
#[inline]
|
||||||
match *self {
|
pub fn html_size(self) -> u8 {
|
||||||
KeywordSize::XXSmall => 0,
|
self as u8
|
||||||
KeywordSize::XSmall => 1,
|
|
||||||
KeywordSize::Small => 2,
|
|
||||||
KeywordSize::Medium => 3,
|
|
||||||
KeywordSize::Large => 4,
|
|
||||||
KeywordSize::XLarge => 5,
|
|
||||||
KeywordSize::XXLarge => 6,
|
|
||||||
KeywordSize::XXXLarge => 7,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue