@@ -113,6 +113,10 @@ impl<'self> ComputedStyle<'self> {
113
113
convert_net_line_height_value ( self . inner . line_height ( ) )
114
114
}
115
115
116
+ pub fn vertical_align ( & self ) -> CSSValue < CSSVerticalAlign > {
117
+ convert_net_vertical_align_value ( self . inner . vertical_align ( ) )
118
+ }
119
+
116
120
// CSS 2.1, Section 11 - Visual effects
117
121
118
122
// CSS 2.1, Section 12 - Generated content, automatic numbering, and lists
@@ -395,6 +399,26 @@ fn convert_net_line_height_value(value: n::v::CssLineHeightValue) -> CSSValue<CS
395
399
}
396
400
}
397
401
402
+ fn convert_net_vertical_align_value ( value : n:: v:: CssVerticalAlignValue ) -> CSSValue < CSSVerticalAlign > {
403
+ match value {
404
+ n:: v:: CssVerticalAlignInherit => Inherit ,
405
+ n:: v:: CssVerticalAlignBaseline => Specified ( CSSVerticalAlignBaseline ) ,
406
+ n:: v:: CssVerticalAlignSub => Specified ( CSSVerticalAlignSub ) ,
407
+ n:: v:: CssVerticalAlignSuper => Specified ( CSSVerticalAlignSuper ) ,
408
+ n:: v:: CssVerticalAlignTop => Specified ( CSSVerticalAlignTop ) ,
409
+ n:: v:: CssVerticalAlignTextTop => Specified ( CSSVerticalAlignTextTop ) ,
410
+ n:: v:: CssVerticalAlignMiddle => Specified ( CSSVerticalAlignMiddle ) ,
411
+ n:: v:: CssVerticalAlignBottom => Specified ( CSSVerticalAlignBottom ) ,
412
+ n:: v:: CssVerticalAlignTextBottom => Specified ( CSSVerticalAlignTextBottom ) ,
413
+ n:: v:: CssVerticalAlignDimension ( v) => {
414
+ match convert_net_unit_to_length_or_percent ( v) {
415
+ Left ( val) => Specified ( CSSVerticalAlignLength ( val) ) ,
416
+ Right ( val) => Specified ( CSSVerticalAlignPercentage ( val) )
417
+ }
418
+ }
419
+ }
420
+ }
421
+
398
422
fn convert_net_unit_to_length( unit : n:: t:: CssUnit ) -> Length {
399
423
match convert_net_unit_to_length_or_percent ( unit) {
400
424
Left ( v) => v,
0 commit comments