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

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
« no previous file with comments | « LayoutTests/fast/forms/select/select-add-expected.txt ('k') | Source/core/html/HTMLSelectElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLOptionsCollection.cpp
diff --git a/Source/core/html/HTMLOptionsCollection.cpp b/Source/core/html/HTMLOptionsCollection.cpp
index d1abb1d3c23f1a98665710f3e1f94e168b1186e2..867b7bf70734d9f37f2a30dba2f0e70a5a26757a 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, index, exceptionState);
ASSERT(!exceptionState.hadException());
}
« no previous file with comments | « LayoutTests/fast/forms/select/select-add-expected.txt ('k') | Source/core/html/HTMLSelectElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698