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

Unified Diff: Source/core/html/HTMLOptionsCollection.cpp

Issue 213773003: select.add() should support optgroup adding and before index (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
Index: Source/core/html/HTMLOptionsCollection.cpp
diff --git a/Source/core/html/HTMLOptionsCollection.cpp b/Source/core/html/HTMLOptionsCollection.cpp
index d1abb1d3c23f1a98665710f3e1f94e168b1186e2..4a37c0ab0a6a4aedd5678cdf123ffbe247499d6a 100644
--- a/Source/core/html/HTMLOptionsCollection.cpp
+++ b/Source/core/html/HTMLOptionsCollection.cpp
@@ -93,7 +93,7 @@ void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index
if (index == -1 || unsigned(index) >= length())
select.add(newOption, 0, exceptionState);
else
- select.add(newOption, toHTMLOptionElement(item(index)), exceptionState);
+ select.addBeforeOptionAtIndex(newOption, unsigned(index), exceptionState);
tkent 2014/03/27 06:13:35 Do not use C-style cast.
keishi 2014/03/27 06:52:03 Done.
ASSERT(!exceptionState.hadException());
}

Powered by Google App Engine
This is Rietveld 408576698