aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmltableelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmltableelement.rs')
-rw-r--r--components/script/dom/htmltableelement.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs
index 4ea908675b1..efcc24f4370 100644
--- a/components/script/dom/htmltableelement.rs
+++ b/components/script/dom/htmltableelement.rs
@@ -118,6 +118,13 @@ impl HTMLTableElement {
thead.upcast::<Node>().remove_self();
}
}
+
+ /// Determine the row index for the given `HTMLTableRowElement`.
+ pub fn row_index(&self, row_elem: &HTMLTableRowElement) -> Option<usize> {
+ self.Rows()
+ .elements_iter()
+ .position(|elem| (&elem as &Element) == row_elem.upcast::<Element>())
+ }
}
impl HTMLTableElementMethods for HTMLTableElement {