| 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 24 matching lines...) Expand all Loading... |
| 35 #include "bindings/core/v8/V8Binding.h" | 35 #include "bindings/core/v8/V8Binding.h" |
| 36 #include "bindings/core/v8/V8HTMLOptionElement.h" | 36 #include "bindings/core/v8/V8HTMLOptionElement.h" |
| 37 #include "bindings/core/v8/V8Node.h" | 37 #include "bindings/core/v8/V8Node.h" |
| 38 #include "bindings/core/v8/V8NodeList.h" | 38 #include "bindings/core/v8/V8NodeList.h" |
| 39 #include "core/dom/ExceptionCode.h" | 39 #include "core/dom/ExceptionCode.h" |
| 40 #include "core/dom/NamedNodesCollection.h" | 40 #include "core/dom/NamedNodesCollection.h" |
| 41 #include "core/html/HTMLOptionElement.h" | 41 #include "core/html/HTMLOptionElement.h" |
| 42 #include "core/html/HTMLOptionsCollection.h" | 42 #include "core/html/HTMLOptionsCollection.h" |
| 43 #include "core/html/HTMLSelectElement.h" | 43 #include "core/html/HTMLSelectElement.h" |
| 44 | 44 |
| 45 namespace WebCore { | 45 namespace blink { |
| 46 | 46 |
| 47 void V8HTMLOptionsCollection::addMethodCustom(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 47 void V8HTMLOptionsCollection::addMethodCustom(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 48 { | 48 { |
| 49 ExceptionState exceptionState(ExceptionState::ExecutionContext, "add", "HTML
OptionsCollection", info.Holder(), info.GetIsolate()); | 49 ExceptionState exceptionState(ExceptionState::ExecutionContext, "add", "HTML
OptionsCollection", info.Holder(), info.GetIsolate()); |
| 50 if (!V8HTMLOptionElement::hasInstance(info[0], info.GetIsolate())) { | 50 if (!V8HTMLOptionElement::hasInstance(info[0], info.GetIsolate())) { |
| 51 exceptionState.throwTypeError("The element provided was not an HTMLOptio
nElement."); | 51 exceptionState.throwTypeError("The element provided was not an HTMLOptio
nElement."); |
| 52 } else { | 52 } else { |
| 53 HTMLOptionsCollection* impl = V8HTMLOptionsCollection::toNative(info.Hol
der()); | 53 HTMLOptionsCollection* impl = V8HTMLOptionsCollection::toNative(info.Hol
der()); |
| 54 HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8:
:Object>(v8::Handle<v8::Object>::Cast(info[0]))); | 54 HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8:
:Object>(v8::Handle<v8::Object>::Cast(info[0]))); |
| 55 | 55 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 81 else | 81 else |
| 82 newLength = static_cast<unsigned>(v); | 82 newLength = static_cast<unsigned>(v); |
| 83 } | 83 } |
| 84 | 84 |
| 85 if (exceptionState.throwIfNeeded()) | 85 if (exceptionState.throwIfNeeded()) |
| 86 return; | 86 return; |
| 87 | 87 |
| 88 impl->setLength(newLength, exceptionState); | 88 impl->setLength(newLength, exceptionState); |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace WebCore | 91 } // namespace blink |
| OLD | NEW |