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

Add support for padding properties. #10

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

Always

Just for now

@@ -96,6 +96,22 @@ impl<'self> CompleteStyle<'self> {
strip(self.inner.margin_left())
}

pub fn padding_top(&self) -> CSSPadding {
strip(self.inner.padding_top())
}

pub fn padding_right(&self) -> CSSPadding {
strip(self.inner.padding_right())
}

pub fn padding_bottom(&self) -> CSSPadding {
strip(self.inner.padding_bottom())
}

pub fn padding_left(&self) -> CSSPadding {
strip(self.inner.padding_left())
}

pub fn border_top_width(&self) -> CSSBorderWidth {
strip(self.inner.border_top_width())
}
@@ -33,6 +33,22 @@ pub impl<'self> ComputedStyle<'self> {
convert_net_margin(self.inner.margin_left())
}

pub fn padding_top(&self) -> CSSValue<CSSPadding> {
convert_net_padding(self.inner.padding_top())
}

pub fn padding_right(&self) -> CSSValue<CSSPadding> {
convert_net_padding(self.inner.padding_right())
}

pub fn padding_bottom(&self) -> CSSValue<CSSPadding> {
convert_net_padding(self.inner.padding_bottom())
}

pub fn padding_left(&self) -> CSSValue<CSSPadding> {
convert_net_padding(self.inner.padding_left())
}

pub fn border_top_width(&self) -> CSSValue<CSSBorderWidth> {
convert_net_border_width(self.inner.border_top_width())
}
@@ -176,6 +192,13 @@ fn convert_net_margin(margin: n::v::CssMarginValue) -> CSSValue<CSSMargin> {
}
}

fn convert_net_padding(padding: n::v::CssPaddingValue) -> CSSValue<CSSPadding> {
match padding {
n::v::CssPaddingInherit => Inherit,
n::v::CssPaddingSet(length) => Specified(CSSPaddingLength(convert_net_unit_to_length(length)))
}
}

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