diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-05-01 13:08:34 +0000 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-05-07 12:55:41 +0200 |
commit | c990c9623d8f204594e9fa12777fd595e1559bbc (patch) | |
tree | 706a527bae99ad0840f494b7d57d38ab8b44e308 /components/style/gecko/conversions.rs | |
parent | 8123007717a60e57ee13d98ae5df23e42d47aa53 (diff) | |
download | servo-c990c9623d8f204594e9fa12777fd595e1559bbc.tar.gz servo-c990c9623d8f204594e9fa12777fd595e1559bbc.zip |
style: Use rust types for vertical-align.
The previous commit removed the dependence on the discriminant value, so we
don't need to keep discriminants different from text-align anymore.
Differential Revision: https://phabricator.services.mozilla.com/D29361
Diffstat (limited to 'components/style/gecko/conversions.rs')
-rw-r--r-- | components/style/gecko/conversions.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/components/style/gecko/conversions.rs b/components/style/gecko/conversions.rs index 7b73f00e73e..4cd5722bdb0 100644 --- a/components/style/gecko/conversions.rs +++ b/components/style/gecko/conversions.rs @@ -22,7 +22,6 @@ use crate::values::computed::url::ComputedImageUrl; use crate::values::computed::{Angle, Gradient, Image}; use crate::values::computed::{Integer, LengthPercentage}; use crate::values::computed::{Length, Percentage, TextAlign}; -use crate::values::generics::box_::VerticalAlign; use crate::values::generics::grid::{TrackListValue, TrackSize}; use crate::values::generics::image::{CompatMode, Image as GenericImage}; use crate::values::generics::rect::Rect; @@ -875,26 +874,6 @@ where } } -impl<L> VerticalAlign<L> { - /// Converts an enumerated value coming from Gecko to a `VerticalAlign<L>`. - pub fn from_gecko_keyword(value: u32) -> Self { - match value { - structs::NS_STYLE_VERTICAL_ALIGN_BASELINE => VerticalAlign::Baseline, - structs::NS_STYLE_VERTICAL_ALIGN_SUB => VerticalAlign::Sub, - structs::NS_STYLE_VERTICAL_ALIGN_SUPER => VerticalAlign::Super, - structs::NS_STYLE_VERTICAL_ALIGN_TOP => VerticalAlign::Top, - structs::NS_STYLE_VERTICAL_ALIGN_TEXT_TOP => VerticalAlign::TextTop, - structs::NS_STYLE_VERTICAL_ALIGN_MIDDLE => VerticalAlign::Middle, - structs::NS_STYLE_VERTICAL_ALIGN_BOTTOM => VerticalAlign::Bottom, - structs::NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM => VerticalAlign::TextBottom, - structs::NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE => { - VerticalAlign::MozMiddleWithBaseline - }, - _ => panic!("unexpected enumerated value for vertical-align"), - } - } -} - impl TextAlign { /// Obtain a specified value from a Gecko keyword value /// |