Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: Source/WebCore/html/HTMLOptionElement.cpp

Issue 9569046: Merge 109362 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/html/HTMLElement.cpp ('k') | Source/WebCore/html/HTMLScriptElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « Source/WebCore/html/HTMLElement.cpp ('k') | Source/WebCore/html/HTMLScriptElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698