aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmltableelement.rs
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2015-12-21 19:49:30 -0800
committerCorey Farwell <coreyf@rwell.org>2015-12-24 13:20:43 -0800
commitba659cb99cd07ca93736e44226bf164dd7f01088 (patch)
treed9898cccc51298e0dfd4e7321e892e992acb933d /components/script/dom/htmltableelement.rs
parentdafdc856ac3fc2bd000e61bdcaed2c024828de0c (diff)
downloadservo-ba659cb99cd07ca93736e44226bf164dd7f01088.tar.gz
servo-ba659cb99cd07ca93736e44226bf164dd7f01088.zip
Implement non-zero dimension attribute parsing
Fixes #8445 The only attributes I found that we have implemented that uses non-zero dimenion attributes: * `width` for `<td>` and `<th>` (table cells) * `width` for `<table>` I updated these implementations to use the new non-zero dimension attribute parsing and added associated regression tests.
Diffstat (limited to 'components/script/dom/htmltableelement.rs')
-rw-r--r--components/script/dom/htmltableelement.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs
index 0de4c81fd9d..acc43beff9b 100644
--- a/components/script/dom/htmltableelement.rs
+++ b/components/script/dom/htmltableelement.rs
@@ -120,7 +120,7 @@ impl HTMLTableElementMethods for HTMLTableElement {
make_getter!(Width, "width");
// https://html.spec.whatwg.org/multipage/#dom-table-width
- make_dimension_setter!(SetWidth, "width");
+ make_nonzero_dimension_setter!(SetWidth, "width");
}
pub trait HTMLTableElementLayoutHelpers {
@@ -195,7 +195,7 @@ impl VirtualMethods for HTMLTableElement {
fn parse_plain_attribute(&self, local_name: &Atom, value: DOMString) -> AttrValue {
match *local_name {
atom!("border") => AttrValue::from_u32(value, 1),
- atom!("width") => AttrValue::from_dimension(value),
+ atom!("width") => AttrValue::from_nonzero_dimension(value),
_ => self.super_type().unwrap().parse_plain_attribute(local_name, value),
}
}