mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
servo: Merge #20073 - Remove some useless manual layout optimisation for KeywordSize (from servo:keywordsize); r=emilio
Source-Repo: https://github.com/servo/servo Source-Revision: be902d56c022cbfed2aef7a816de80d139718235 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : db231a1d4d2caf7426cbc98e4c39e6962b104d45
This commit is contained in:
parent
ff9c750728
commit
2627790328
@ -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,
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user