diff options
Diffstat (limited to 'components/script/dom/htmltablecellelement.rs')
-rw-r--r-- | components/script/dom/htmltablecellelement.rs | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/components/script/dom/htmltablecellelement.rs b/components/script/dom/htmltablecellelement.rs index 81a6ba3f9f0..9ca84b0e70f 100644 --- a/components/script/dom/htmltablecellelement.rs +++ b/components/script/dom/htmltablecellelement.rs @@ -14,14 +14,14 @@ use dom::htmlelement::HTMLElement; use dom::node::ElementNodeTypeId; use dom::virtualmethods::VirtualMethods; -use servo_util::str::{mod, AutoLpa, DOMString, LengthOrPercentageOrAuto, SimpleColor}; +use cssparser::RGBA; +use servo_util::str::{mod, AutoLpa, DOMString, LengthOrPercentageOrAuto}; use std::cell::Cell; #[dom_struct] pub struct HTMLTableCellElement { htmlelement: HTMLElement, - background_color: Cell<Option<SimpleColor>>, - border: Cell<Option<u32>>, + background_color: Cell<Option<RGBA>>, colspan: Cell<Option<u32>>, width: Cell<LengthOrPercentageOrAuto>, } @@ -45,7 +45,6 @@ impl HTMLTableCellElement { HTMLTableCellElement { htmlelement: HTMLElement::new_inherited(type_id, tag_name, prefix, document), background_color: Cell::new(None), - border: Cell::new(None), colspan: Cell::new(None), width: Cell::new(AutoLpa), } @@ -58,21 +57,16 @@ impl HTMLTableCellElement { } pub trait HTMLTableCellElementHelpers { - fn get_background_color(&self) -> Option<SimpleColor>; - fn get_border(&self) -> Option<u32>; + fn get_background_color(&self) -> Option<RGBA>; fn get_colspan(&self) -> Option<u32>; fn get_width(&self) -> LengthOrPercentageOrAuto; } impl HTMLTableCellElementHelpers for HTMLTableCellElement { - fn get_background_color(&self) -> Option<SimpleColor> { + fn get_background_color(&self) -> Option<RGBA> { self.background_color.get() } - fn get_border(&self) -> Option<u32> { - self.border.get() - } - fn get_colspan(&self) -> Option<u32> { self.colspan.get() } @@ -98,12 +92,6 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTableCellElement> { &atom!("bgcolor") => { self.background_color.set(str::parse_legacy_color(attr.value().as_slice()).ok()) } - &atom!("border") => { - // According to HTML5 § 14.3.9, invalid values map to 1px. - self.border.set(Some(str::parse_unsigned_integer(attr.value() - .as_slice() - .chars()).unwrap_or(1))) - } &atom!("colspan") => { self.colspan.set(str::parse_unsigned_integer(attr.value().as_slice().chars())); } @@ -120,7 +108,6 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTableCellElement> { match attr.local_name() { &atom!("bgcolor") => self.background_color.set(None), - &atom!("border") => self.border.set(None), &atom!("colspan") => self.colspan.set(None), &atom!("width") => self.width.set(AutoLpa), _ => () |