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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 void V8HTMLOptionsCollection::removeMethodCustom(const v8::FunctionCallbackInfo<
v8::Value>& args) | 73 void V8HTMLOptionsCollection::removeMethodCustom(const v8::FunctionCallbackInfo<
v8::Value>& args) |
74 { | 74 { |
75 HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder()
); | 75 HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder()
); |
76 HTMLSelectElement* base = toHTMLSelectElement(imp->ownerNode()); | 76 HTMLSelectElement* base = toHTMLSelectElement(imp->ownerNode()); |
77 removeElement(base, args); | 77 removeElement(base, args); |
78 } | 78 } |
79 | 79 |
80 void V8HTMLOptionsCollection::addMethodCustom(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 80 void V8HTMLOptionsCollection::addMethodCustom(const v8::FunctionCallbackInfo<v8:
:Value>& args) |
81 { | 81 { |
82 if (!V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate(), worldType(
args.GetIsolate()))) { | 82 if (!V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate(), worldType(
args.GetIsolate()))) { |
83 setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate()); | 83 setDOMException(TypeMismatchError, args.GetIsolate()); |
84 return; | 84 return; |
85 } | 85 } |
86 HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder()
); | 86 HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder()
); |
87 HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8::Obj
ect>(v8::Handle<v8::Object>::Cast(args[0]))); | 87 HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8::Obj
ect>(v8::Handle<v8::Object>::Cast(args[0]))); |
88 | 88 |
89 ExceptionCode ec = 0; | 89 ExceptionCode ec = 0; |
90 if (args.Length() < 2) | 90 if (args.Length() < 2) |
91 imp->add(option, ec); | 91 imp->add(option, ec); |
92 else { | 92 else { |
93 bool ok; | 93 bool ok; |
94 V8TRYCATCH_VOID(int, index, toInt32(args[1], ok)); | 94 V8TRYCATCH_VOID(int, index, toInt32(args[1], ok)); |
95 if (!ok) | 95 if (!ok) |
96 ec = TYPE_MISMATCH_ERR; | 96 ec = TypeMismatchError; |
97 else | 97 else |
98 imp->add(option, index, ec); | 98 imp->add(option, index, ec); |
99 } | 99 } |
100 | 100 |
101 if (!ec) | 101 if (!ec) |
102 return; | 102 return; |
103 setDOMException(ec, args.GetIsolate()); | 103 setDOMException(ec, args.GetIsolate()); |
104 } | 104 } |
105 | 105 |
106 void V8HTMLOptionsCollection::lengthAttrSetterCustom(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) | 106 void V8HTMLOptionsCollection::lengthAttrSetterCustom(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) |
(...skipping 10 matching lines...) Expand all Loading... |
117 else | 117 else |
118 newLength = static_cast<unsigned>(v); | 118 newLength = static_cast<unsigned>(v); |
119 } | 119 } |
120 if (!ec) | 120 if (!ec) |
121 imp->setLength(newLength, ec); | 121 imp->setLength(newLength, ec); |
122 | 122 |
123 setDOMException(ec, info.GetIsolate()); | 123 setDOMException(ec, info.GetIsolate()); |
124 } | 124 } |
125 | 125 |
126 } // namespace WebCore | 126 } // namespace WebCore |
OLD | NEW |