Index: Source/WebCore/html/HTMLTableElement.cpp |
=================================================================== |
--- Source/WebCore/html/HTMLTableElement.cpp (revision 109466) |
+++ Source/WebCore/html/HTMLTableElement.cpp (working copy) |
@@ -185,13 +185,15 @@ |
return 0; |
} |
- HTMLTableRowElement* lastRow = 0; |
- HTMLTableRowElement* row = 0; |
+ RefPtr<Node> protectFromMutationEvents(this); |
+ |
+ RefPtr<HTMLTableRowElement> lastRow = 0; |
+ RefPtr<HTMLTableRowElement> row = 0; |
if (index == -1) |
lastRow = HTMLTableRowsCollection::lastRow(this); |
else { |
for (int i = 0; i <= index; ++i) { |
- row = HTMLTableRowsCollection::rowAfter(this, lastRow); |
+ row = HTMLTableRowsCollection::rowAfter(this, lastRow.get()); |
if (!row) { |
if (i != index) { |
ec = INDEX_SIZE_ERR; |
@@ -203,7 +205,7 @@ |
} |
} |
- ContainerNode* parent; |
+ RefPtr<ContainerNode> parent; |
if (lastRow) |
parent = row ? row->parentNode() : lastRow->parentNode(); |
else { |
@@ -218,7 +220,7 @@ |
} |
RefPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(document()); |
- parent->insertBefore(newRow, row, ec); |
+ parent->insertBefore(newRow, row.get(), ec); |
return newRow.release(); |
} |