mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Move table border to the new infrastructure.
This commit is contained in:
parent
52afa1dc34
commit
69f92596ca
2 changed files with 25 additions and 73 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue