mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Implement rowIndex
property on <tr>
.
Part of https://github.com/servo/servo/issues/10509.
This commit is contained in:
parent
ea97c89055
commit
23eb15c820
5 changed files with 31 additions and 45 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue