Index: Source/WebCore/html/HTMLOptionElement.cpp |
=================================================================== |
--- Source/WebCore/html/HTMLOptionElement.cpp (revision 109461) |
+++ Source/WebCore/html/HTMLOptionElement.cpp (working copy) |
@@ -137,10 +137,12 @@ |
void HTMLOptionElement::setText(const String &text, ExceptionCode& ec) |
{ |
+ RefPtr<Node> protectFromMutationEvents(this); |
+ |
// Changing the text causes a recalc of a select's items, which will reset the selected |
// index to the first item if the select is single selection with a menu list. We attempt to |
// preserve the selected item. |
- HTMLSelectElement* select = ownerSelectElement(); |
+ RefPtr<HTMLSelectElement> select = ownerSelectElement(); |
bool selectIsMenuList = select && select->usesMenuList(); |
int oldSelectedIndex = selectIsMenuList ? select->selectedIndex() : -1; |