int32_t HTMLTableRowElement::RowIndex() const { HTMLTableElement* table = GetTable(); if (!table) { return -1; } nsIHTMLCollection* rows = table->Rows(); uint32_t numRows = rows->Length(); for (uint32_t i = 0; i < numRows; i++) { if (rows->GetElementAt(i) == this) { return i; } } return -1; }