| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 void V8HTMLOptionsCollection::namedItemMethodCustom(const v8::FunctionCallbackIn
fo<v8::Value>& info) | 66 void V8HTMLOptionsCollection::namedItemMethodCustom(const v8::FunctionCallbackIn
fo<v8::Value>& info) |
| 67 { | 67 { |
| 68 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]); | 68 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]); |
| 69 HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(info.Holder()
); | 69 HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(info.Holder()
); |
| 70 getNamedItems(imp, name, info); | 70 getNamedItems(imp, name, info); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void V8HTMLOptionsCollection::addMethodCustom(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 73 void V8HTMLOptionsCollection::addMethodCustom(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 74 { | 74 { |
| 75 ExceptionState exceptionState(ExceptionState::ExecutionContext, "add", "HTML
OptionsCollection", info.Holder(), info.GetIsolate()); | 75 ExceptionState exceptionState(ExceptionState::ExecutionContext, "add", "HTML
OptionsCollection", info.Holder(), info.GetIsolate()); |
| 76 if (!V8HTMLOptionElement::hasInstance(info[0], info.GetIsolate(), worldType(
info.GetIsolate()))) { | 76 if (!V8HTMLOptionElement::hasInstance(info[0], info.GetIsolate())) { |
| 77 exceptionState.throwTypeError("The element provided was not an HTMLOptio
nElement."); | 77 exceptionState.throwTypeError("The element provided was not an HTMLOptio
nElement."); |
| 78 } else { | 78 } else { |
| 79 HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(info.Hold
er()); | 79 HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(info.Hold
er()); |
| 80 HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8:
:Object>(v8::Handle<v8::Object>::Cast(info[0]))); | 80 HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8:
:Object>(v8::Handle<v8::Object>::Cast(info[0]))); |
| 81 | 81 |
| 82 if (info.Length() < 2) { | 82 if (info.Length() < 2) { |
| 83 imp->add(option, exceptionState); | 83 imp->add(option, exceptionState); |
| 84 } else { | 84 } else { |
| 85 int index = toInt32(info[1], exceptionState); | 85 int index = toInt32(info[1], exceptionState); |
| 86 if (exceptionState.throwIfNeeded()) | 86 if (exceptionState.throwIfNeeded()) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 108 newLength = static_cast<unsigned>(v); | 108 newLength = static_cast<unsigned>(v); |
| 109 } | 109 } |
| 110 | 110 |
| 111 if (exceptionState.throwIfNeeded()) | 111 if (exceptionState.throwIfNeeded()) |
| 112 return; | 112 return; |
| 113 | 113 |
| 114 imp->setLength(newLength, exceptionState); | 114 imp->setLength(newLength, exceptionState); |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace WebCore | 117 } // namespace WebCore |
| OLD | NEW |