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

Unified Diff: third_party/WebKit/Source/core/html/HTMLSelectElement.cpp

Issue 2208483003: Delay DOM mutation events in HTMLSelectElement::setOption(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « third_party/WebKit/LayoutTests/fast/forms/select/select-add-assertion.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
index 271a9d84cedf1ffc61b0d23912f1481b92152030..7ca8bc148263b660afa5d064085642e28925c4a2 100644
--- a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
@@ -429,12 +429,13 @@ void HTMLSelectElement::setOption(unsigned index, HTMLOptionElement* option, Exc
before.setHTMLElement(options()->item(index + 1));
remove(index);
}
+ if (exceptionState.hadException())
+ return;
// Finally add the new element.
- if (!exceptionState.hadException()) {
- add(element, before, exceptionState);
- if (diff >= 0 && option->selected())
- optionSelectionStateChanged(option, true);
- }
+ EventQueueScope scope;
+ add(element, before, exceptionState);
+ if (diff >= 0 && option->selected())
+ optionSelectionStateChanged(option, true);
}
void HTMLSelectElement::setLength(unsigned newLen, ExceptionState& exceptionState)
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/select/select-add-assertion.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698