Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text-decoration #9

Merged
merged 3 commits into from May 24, 2013
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Added text decoration to rust-css

  • Loading branch information
Eric Atkinson
Eric Atkinson committed May 21, 2013
commit 97269a97c924359ac9b84436cf77c9508623fa22
@@ -137,6 +137,10 @@ pub impl<'self> ComputedStyle<'self> {
convert_net_text_align_value(self.inner.text_align())
}

pub fn text_decoration(&self) -> CSSValue<CSSTextDecoration> {
convert_net_text_decoration_value(self.inner.text_decoration())
}

// CSS 2.1, Section 17 - Tables

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

fn convert_net_text_decoration_value(value: n::v::CssTextDecorationValue) -> CSSValue<CSSTextDecoration> {
match value {
n::v::CssTextDecorationInherit => Inherit,
n::v::CssTextDecorationNone => Specified(CSSTextDecorationNone),
n::v::CssTextDecorationBlink => Specified(CSSTextDecorationBlink),
n::v::CssTextDecorationLineThrough => Specified(CSSTextDecorationLineThrough),
n::v::CssTextDecorationOverline => Specified(CSSTextDecorationOverline),
n::v::CssTextDecorationUnderline => Specified(CSSTextDecorationUnderline),
}
}

fn convert_net_line_height_value(value: n::v::CssLineHeightValue) -> CSSValue<CSSLineHeight> {
match value {
n::v::CssLineHeightInherit => Inherit,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.