aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmltablesectionelement.rs
diff options
context:
space:
mode:
authorchansuke <chansuke@georepublic.de>2018-09-18 23:24:15 +0900
committerJosh Matthews <josh@joshmatthews.net>2018-09-19 17:40:47 -0400
commitc37a345dc9f4dda6ea29c42f96f6c7201c42cbac (patch)
tree1f05b49bac02318455a59d5b143c186fd872bdb9 /components/script/dom/htmltablesectionelement.rs
parent2ca7a134736bb4759ff209c1bc0b6dc3cc1984c9 (diff)
downloadservo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.tar.gz
servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.zip
Format script component
Diffstat (limited to 'components/script/dom/htmltablesectionelement.rs')
-rw-r--r--components/script/dom/htmltablesectionelement.rs40
1 files changed, 25 insertions, 15 deletions
diff --git a/components/script/dom/htmltablesectionelement.rs b/components/script/dom/htmltablesectionelement.rs
index 58c72ddeed5..885b03e018d 100644
--- a/components/script/dom/htmltablesectionelement.rs
+++ b/components/script/dom/htmltablesectionelement.rs
@@ -26,19 +26,29 @@ pub struct HTMLTableSectionElement {
}
impl HTMLTableSectionElement {
- fn new_inherited(local_name: LocalName, prefix: Option<Prefix>, document: &Document)
- -> HTMLTableSectionElement {
+ fn new_inherited(
+ local_name: LocalName,
+ prefix: Option<Prefix>,
+ document: &Document,
+ ) -> HTMLTableSectionElement {
HTMLTableSectionElement {
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
}
}
#[allow(unrooted_must_root)]
- pub fn new(local_name: LocalName, prefix: Option<Prefix>, document: &Document)
- -> DomRoot<HTMLTableSectionElement> {
- Node::reflect_node(Box::new(HTMLTableSectionElement::new_inherited(local_name, prefix, document)),
- document,
- HTMLTableSectionElementBinding::Wrap)
+ pub fn new(
+ local_name: LocalName,
+ prefix: Option<Prefix>,
+ document: &Document,
+ ) -> DomRoot<HTMLTableSectionElement> {
+ Node::reflect_node(
+ Box::new(HTMLTableSectionElement::new_inherited(
+ local_name, prefix, document,
+ )),
+ document,
+ HTMLTableSectionElementBinding::Wrap,
+ )
}
}
@@ -46,8 +56,7 @@ impl HTMLTableSectionElement {
struct RowsFilter;
impl CollectionFilter for RowsFilter {
fn filter(&self, elem: &Element, root: &Node) -> bool {
- elem.is::<HTMLTableRowElement>() &&
- elem.upcast::<Node>().GetParentNode().r() == Some(root)
+ elem.is::<HTMLTableRowElement>() && elem.upcast::<Node>().GetParentNode().r() == Some(root)
}
}
@@ -63,16 +72,14 @@ impl HTMLTableSectionElementMethods for HTMLTableSectionElement {
node.insert_cell_or_row(
index,
|| self.Rows(),
- || HTMLTableRowElement::new(local_name!("tr"), None, &node.owner_doc()))
+ || HTMLTableRowElement::new(local_name!("tr"), None, &node.owner_doc()),
+ )
}
// https://html.spec.whatwg.org/multipage/#dom-tbody-deleterow
fn DeleteRow(&self, index: i32) -> ErrorResult {
let node = self.upcast::<Node>();
- node.delete_cell_or_row(
- index,
- || self.Rows(),
- |n| n.is::<HTMLTableRowElement>())
+ node.delete_cell_or_row(index, || self.Rows(), |n| n.is::<HTMLTableRowElement>())
}
}
@@ -100,7 +107,10 @@ impl VirtualMethods for HTMLTableSectionElement {
fn parse_plain_attribute(&self, local_name: &LocalName, value: DOMString) -> AttrValue {
match *local_name {
local_name!("bgcolor") => AttrValue::from_legacy_color(value.into()),
- _ => self.super_type().unwrap().parse_plain_attribute(local_name, value),
+ _ => self
+ .super_type()
+ .unwrap()
+ .parse_plain_attribute(local_name, value),
}
}
}