Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

Commit 97269a9

Browse files
author
Eric Atkinson
committed
Added text decoration to rust-css
1 parent 83ab489 commit 97269a9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

computed.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ pub impl<'self> ComputedStyle<'self> {
137137
convert_net_text_align_value(self.inner.text_align())
138138
}
139139

140+
pub fn text_decoration(&self) -> CSSValue<CSSTextDecoration> {
141+
convert_net_text_decoration_value(self.inner.text_decoration())
142+
}
143+
140144
// CSS 2.1, Section 17 - Tables
141145

142146
// CSS 2.1, Section 18 - User interface
@@ -309,6 +313,17 @@ fn convert_net_text_align_value(value: n::v::CssTextAlignValue) -> CSSValue<CSST
309313
}
310314
}
311315

316+
fn convert_net_text_decoration_value(value: n::v::CssTextDecorationValue) -> CSSValue<CSSTextDecoration> {
317+
match value {
318+
n::v::CssTextDecorationInherit => Inherit,
319+
n::v::CssTextDecorationNone => Specified(CSSTextDecorationNone),
320+
n::v::CssTextDecorationBlink => Specified(CSSTextDecorationBlink),
321+
n::v::CssTextDecorationLineThrough => Specified(CSSTextDecorationLineThrough),
322+
n::v::CssTextDecorationOverline => Specified(CSSTextDecorationOverline),
323+
n::v::CssTextDecorationUnderline => Specified(CSSTextDecorationUnderline),
324+
}
325+
}
326+
312327
fn convert_net_line_height_value(value: n::v::CssLineHeightValue) -> CSSValue<CSSLineHeight> {
313328
match value {
314329
n::v::CssLineHeightInherit => Inherit,

0 commit comments

Comments
 (0)