Object bounding box wrong for some paths
[WebKit-https.git] / Source / WebCore / bindings / js / JSHTMLSelectElementCustom.cpp
index 90384ad..c74aed3 100644 (file)
@@ -39,18 +39,10 @@ void selectElementIndexSetter(JSC::ExecState& state, HTMLSelectElement& element,
     VM& vm = state.vm();
     auto throwScope = DECLARE_THROW_SCOPE(vm);
 
-    if (value.isUndefinedOrNull()) {
-        element.remove(index);
-        return;
-    }
-
-    auto* option = JSHTMLOptionElement::toWrapped(value);
-    if (!option) {
-        throwTypeMismatchError(state, throwScope);
-        return;
-    }
-
-    propagateException(state, throwScope, element.setOption(index, *option));
+    auto* option = convert<IDLNullable<IDLInterface<HTMLOptionElement>>>(state, value);
+    RETURN_IF_EXCEPTION(throwScope, void());
+
+    propagateException(state, throwScope, element.setItem(index, option));
 }
 
 void JSHTMLSelectElement::indexSetter(JSC::ExecState* state, unsigned index, JSC::JSValue value)