aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmltableelement.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-03-12 13:03:49 -0600
committerbors-servo <metajack+bors@gmail.com>2015-03-12 13:03:49 -0600
commit8e811229bae6b338fabcd7df602079730c942889 (patch)
tree0c5257a98351c5a83bf24f6468c127e716f71c23 /components/script/dom/htmltableelement.rs
parent6593cf9ec498160c2b5bc096cc7ec3ff3a7479ee (diff)
parent586c12ccc4de666c0cfbef84689c2e8ed7d7719d (diff)
downloadservo-8e811229bae6b338fabcd7df602079730c942889.tar.gz
servo-8e811229bae6b338fabcd7df602079730c942889.zip
auto merge of #4417 : pcwalton/servo/border-spacing, r=larsbergstrom
Table layout code has been refactored to push the spacing down to rowgroups and rows; this will aid the implementation of `border-collapse` as well. r? @SimonSapin
Diffstat (limited to 'components/script/dom/htmltableelement.rs')
-rw-r--r--components/script/dom/htmltableelement.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs
index e1494f67007..d7d85eb19bc 100644
--- a/components/script/dom/htmltableelement.rs
+++ b/components/script/dom/htmltableelement.rs
@@ -26,6 +26,7 @@ pub struct HTMLTableElement {
htmlelement: HTMLElement,
background_color: Cell<Option<RGBA>>,
border: Cell<Option<u32>>,
+ cellspacing: Cell<Option<u32>>,
width: Cell<LengthOrPercentageOrAuto>,
}
@@ -45,6 +46,7 @@ impl HTMLTableElement {
document),
background_color: Cell::new(None),
border: Cell::new(None),
+ cellspacing: Cell::new(None),
width: Cell::new(LengthOrPercentageOrAuto::Auto),
}
}
@@ -94,6 +96,7 @@ impl<'a> HTMLTableElementMethods for JSRef<'a, HTMLTableElement> {
pub trait HTMLTableElementHelpers {
fn get_background_color(&self) -> Option<RGBA>;
fn get_border(&self) -> Option<u32>;
+ fn get_cellspacing(&self) -> Option<u32>;
fn get_width(&self) -> LengthOrPercentageOrAuto;
}
@@ -106,6 +109,10 @@ impl HTMLTableElementHelpers for HTMLTableElement {
self.border.get()
}
+ fn get_cellspacing(&self) -> Option<u32> {
+ self.cellspacing.get()
+ }
+
fn get_width(&self) -> LengthOrPercentageOrAuto {
self.width.get()
}
@@ -132,6 +139,9 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTableElement> {
.as_slice()
.chars()).unwrap_or(1)))
}
+ &atom!("cellspacing") => {
+ self.cellspacing.set(str::parse_unsigned_integer(attr.value().as_slice().chars()))
+ }
&atom!("width") => self.width.set(str::parse_length(attr.value().as_slice())),
_ => ()
}
@@ -145,6 +155,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTableElement> {
match attr.local_name() {
&atom!("bgcolor") => self.background_color.set(None),
&atom!("border") => self.border.set(None),
+ &atom!("cellspacing") => self.cellspacing.set(None),
&atom!("width") => self.width.set(LengthOrPercentageOrAuto::Auto),
_ => ()
}