зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
f3cea2b0e3
Коммит
4fae449274
|
@ -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
|
||||||
|
|
Загрузка…
Ссылка в новой задаче