Bug 188645 - HTMLTableElement.insertRow(-1) should append a new row, per DOM Level 2 HTML

Patch by Ruslan Ismailov <croo@nm.ru>
r=caillon sr=bzbarsky
This commit is contained in:
caillon%returnzero.com 2003-01-11 21:33:00 +00:00
Родитель f3cea2b0e3
Коммит 4fae449274
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -797,8 +797,9 @@ nsHTMLTableElement::InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
nsCOMPtr<nsIDOMNode> newRowNode(do_QueryInterface(newRow)); nsCOMPtr<nsIDOMNode> newRowNode(do_QueryInterface(newRow));
nsCOMPtr<nsIDOMNode> retChild; nsCOMPtr<nsIDOMNode> retChild;
// the index is greater than the number of rows, so just append // If index is -1 or equal to the number of rows, the new row
if ((0 <= aIndex) && (PRInt32(rowCount) <= aIndex)) { // is appended.
if (aIndex == -1 || PRUint32(aIndex) == rowCount) {
rv = parent->AppendChild(newRowNode, getter_AddRefs(retChild)); rv = parent->AppendChild(newRowNode, getter_AddRefs(retChild));
} }
else else