| Index: Source/core/html/HTMLOptionsCollection.cpp
|
| diff --git a/Source/core/html/HTMLOptionsCollection.cpp b/Source/core/html/HTMLOptionsCollection.cpp
|
| index 672737edffb5a535c6d092e3af26952a507d9a1a..3899f43ad62a06d3571591977bc65c9f4f5a7ff9 100644
|
| --- a/Source/core/html/HTMLOptionsCollection.cpp
|
| +++ b/Source/core/html/HTMLOptionsCollection.cpp
|
| @@ -69,33 +69,9 @@ PassRefPtrWillBeRawPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(Cont
|
| return adoptRefWillBeNoop(new HTMLOptionsCollection(select));
|
| }
|
|
|
| -void HTMLOptionsCollection::add(PassRefPtrWillBeRawPtr<HTMLOptionElement> element, ExceptionState& exceptionState)
|
| +void HTMLOptionsCollection::add(const HTMLOptionElementOrHTMLOptGroupElement& element, const HTMLElementOrLong& before, ExceptionState& exceptionState)
|
| {
|
| - add(element, length(), exceptionState);
|
| -}
|
| -
|
| -void HTMLOptionsCollection::add(PassRefPtrWillBeRawPtr<HTMLOptionElement> element, int index, ExceptionState& exceptionState)
|
| -{
|
| - HTMLOptionElement* newOption = element.get();
|
| -
|
| - if (!newOption) {
|
| - exceptionState.throwTypeError("The element provided was not an HTMLOptionElement.");
|
| - return;
|
| - }
|
| -
|
| - if (index < -1) {
|
| - exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is less than -1.");
|
| - return;
|
| - }
|
| -
|
| - HTMLSelectElement& select = toHTMLSelectElement(ownerNode());
|
| -
|
| - if (index == -1 || unsigned(index) >= length())
|
| - select.add(newOption, 0, exceptionState);
|
| - else
|
| - select.addBeforeOptionAtIndex(newOption, index, exceptionState);
|
| -
|
| - ASSERT(!exceptionState.hadException());
|
| + toHTMLSelectElement(ownerNode()).add(element, before, exceptionState);
|
| }
|
|
|
| void HTMLOptionsCollection::remove(int index)
|
|
|