diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-05-12 14:18:58 +0200 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-05-12 14:18:58 +0200 |
commit | 69f92596cabcbd716fa5686232b8cc04e61bafe9 (patch) | |
tree | 65ded0e08b4af362e73144f1702afd3a0c417302 /components/script/dom/element.rs | |
parent | 52afa1dc348f0f9af74301be498a7392cfdc316d (diff) | |
download | servo-69f92596cabcbd716fa5686232b8cc04e61bafe9.tar.gz servo-69f92596cabcbd716fa5686232b8cc04e61bafe9.zip |
Move table border to the new infrastructure.
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index ef240679388..f6e34985f5c 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -383,6 +383,30 @@ impl RawLayoutElementHelpers for Element { longhands::height::SpecifiedValue( specified::LengthOrPercentageOrAuto::Length(value)))))); } + + + let border = if self.is_htmltableelement() { + let this: &HTMLTableElement = mem::transmute(self); + this.get_border() + } else { + None + }; + + if let Some(border) = border { + let width_value = specified::Length::Absolute(Au::from_px(border as i32)); + hints.push(from_declaration( + PropertyDeclaration::BorderTopWidth(SpecifiedValue( + longhands::border_top_width::SpecifiedValue(width_value))))); + hints.push(from_declaration( + PropertyDeclaration::BorderLeftWidth(SpecifiedValue( + longhands::border_left_width::SpecifiedValue(width_value))))); + hints.push(from_declaration( + PropertyDeclaration::BorderBottomWidth(SpecifiedValue( + longhands::border_bottom_width::SpecifiedValue(width_value))))); + hints.push(from_declaration( + PropertyDeclaration::BorderRightWidth(SpecifiedValue( + longhands::border_right_width::SpecifiedValue(width_value))))); + } } #[inline] @@ -412,16 +436,6 @@ impl RawLayoutElementHelpers for Element { attribute: UnsignedIntegerAttribute) -> Option<u32> { match attribute { - UnsignedIntegerAttribute::Border => { - if self.is_htmltableelement() { - let this: &HTMLTableElement = mem::transmute(self); - this.get_border() - } else { - // Don't panic since `:-servo-nonzero-border` can cause this to be called on - // arbitrary elements. - None - } - } UnsignedIntegerAttribute::ColSpan => { if self.is_htmltablecellelement() { let this: &HTMLTableCellElement = mem::transmute(self); |