| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Harri Porten (porten@kde.org) | 2 * Copyright (C) 2000 Harri Porten (porten@kde.org) |
| 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 4 * Copyright (C) 2004-2006 Apple Computer, Inc. | 4 * Copyright (C) 2004-2006 Apple Computer, Inc. |
| 5 * Copyright (C) 2006 James G. Speth (speth@end.com) | 5 * Copyright (C) 2006 James G. Speth (speth@end.com) |
| 6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) | 6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) |
| 7 * Copyright 2007, 2008 Google Inc. All Rights Reserved. | 7 * Copyright 2007, 2008 Google Inc. All Rights Reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Lesser General Public | 10 * modify it under the terms of the GNU Lesser General Public |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 #define NAMED_PROPERTY_SETTER(NAME) \ | 134 #define NAMED_PROPERTY_SETTER(NAME) \ |
| 135 v8::Handle<v8::Value> V8Custom::v8##NAME##NamedPropertySetter(\ | 135 v8::Handle<v8::Value> V8Custom::v8##NAME##NamedPropertySetter(\ |
| 136 v8::Local<v8::String> name, v8::Local<v8::Value> value, \ | 136 v8::Local<v8::String> name, v8::Local<v8::Value> value, \ |
| 137 const v8::AccessorInfo& info) | 137 const v8::AccessorInfo& info) |
| 138 | 138 |
| 139 #define NAMED_PROPERTY_DELETER(NAME) \ | 139 #define NAMED_PROPERTY_DELETER(NAME) \ |
| 140 v8::Handle<v8::Boolean> V8Custom::v8##NAME##NamedPropertyDeleter(\ | 140 v8::Handle<v8::Boolean> V8Custom::v8##NAME##NamedPropertyDeleter(\ |
| 141 v8::Local<v8::String> name, const v8::AccessorInfo& info) | 141 v8::Local<v8::String> name, const v8::AccessorInfo& info) |
| 142 | 142 |
| 143 #define INDEXED_PROPERTY_GETTER(NAME) \ | |
| 144 v8::Handle<v8::Value> V8Custom::v8##NAME##IndexedPropertyGetter(\ | |
| 145 uint32_t index, const v8::AccessorInfo& info) | |
| 146 | |
| 147 #define INDEXED_PROPERTY_SETTER(NAME) \ | |
| 148 v8::Handle<v8::Value> V8Custom::v8##NAME##IndexedPropertySetter(\ | |
| 149 uint32_t index, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 150 | |
| 151 #define INDEXED_PROPERTY_DELETER(NAME) \ | |
| 152 v8::Handle<v8::Boolean> V8Custom::v8##NAME##IndexedPropertyDeleter(\ | |
| 153 uint32_t index, const v8::AccessorInfo& info) | |
| 154 | |
| 155 #define NAMED_ACCESS_CHECK(NAME) \ | 143 #define NAMED_ACCESS_CHECK(NAME) \ |
| 156 bool V8Custom::v8##NAME##NamedSecurityCheck(v8::Local<v8::Object> host, \ | 144 bool V8Custom::v8##NAME##NamedSecurityCheck(v8::Local<v8::Object> host, \ |
| 157 v8::Local<v8::Value> key, \ | 145 v8::Local<v8::Value> key, \ |
| 158 v8::AccessType type, \ | 146 v8::AccessType type, \ |
| 159 v8::Local<v8::Value> data) | 147 v8::Local<v8::Value> data) |
| 160 | 148 |
| 161 #define INDEXED_ACCESS_CHECK(NAME) \ | 149 #define INDEXED_ACCESS_CHECK(NAME) \ |
| 162 bool V8Custom::v8##NAME##IndexedSecurityCheck(v8::Local<v8::Object> host, \ | 150 bool V8Custom::v8##NAME##IndexedSecurityCheck(v8::Local<v8::Object> host, \ |
| 163 uint32_t index, \ | 151 uint32_t index, \ |
| 164 v8::AccessType type, \ | 152 v8::AccessType type, \ |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 return v8::Handle<v8::Value>(); | 667 return v8::Handle<v8::Value>(); |
| 680 } | 668 } |
| 681 | 669 |
| 682 // Finally, search the DOM structure. | 670 // Finally, search the DOM structure. |
| 683 HTMLCollection* imp = V8Proxy::ToNativeObject<HTMLCollection>( | 671 HTMLCollection* imp = V8Proxy::ToNativeObject<HTMLCollection>( |
| 684 V8ClassIndex::HTMLCOLLECTION, info.Holder()); | 672 V8ClassIndex::HTMLCOLLECTION, info.Holder()); |
| 685 String key = ToWebCoreString(name); | 673 String key = ToWebCoreString(name); |
| 686 return HTMLCollectionGetNamedItems(imp, key); | 674 return HTMLCollectionGetNamedItems(imp, key); |
| 687 } | 675 } |
| 688 | 676 |
| 677 |
| 689 CALLBACK_FUNC_DECL(HTMLCollectionItem) { | 678 CALLBACK_FUNC_DECL(HTMLCollectionItem) { |
| 690 INC_STATS("DOM.HTMLCollection.item()"); | 679 INC_STATS("DOM.HTMLCollection.item()"); |
| 691 HTMLCollection* imp = V8Proxy::ToNativeObject<HTMLCollection>( | 680 HTMLCollection* imp = V8Proxy::ToNativeObject<HTMLCollection>( |
| 692 V8ClassIndex::HTMLCOLLECTION, args.Holder()); | 681 V8ClassIndex::HTMLCOLLECTION, args.Holder()); |
| 693 return HTMLCollectionGetItem(imp, args[0]); | 682 return HTMLCollectionGetItem(imp, args[0]); |
| 694 } | 683 } |
| 695 | 684 |
| 696 | 685 |
| 697 CALLBACK_FUNC_DECL(HTMLCollectionNamedItem) { | 686 CALLBACK_FUNC_DECL(HTMLCollectionNamedItem) { |
| 698 INC_STATS("DOM.HTMLCollection.namedItem()"); | 687 INC_STATS("DOM.HTMLCollection.namedItem()"); |
| (...skipping 2759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3458 Location* imp = | 3447 Location* imp = |
| 3459 V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, host); | 3448 V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, host); |
| 3460 return V8Proxy::CanAccessFrame(imp->frame(), false); | 3449 return V8Proxy::CanAccessFrame(imp->frame(), false); |
| 3461 } | 3450 } |
| 3462 | 3451 |
| 3463 | 3452 |
| 3464 #undef INDEXED_ACCESS_CHECK | 3453 #undef INDEXED_ACCESS_CHECK |
| 3465 #undef NAMED_ACCESS_CHECK | 3454 #undef NAMED_ACCESS_CHECK |
| 3466 #undef NAMED_PROPERTY_GETTER | 3455 #undef NAMED_PROPERTY_GETTER |
| 3467 #undef NAMED_PROPERTY_SETTER | 3456 #undef NAMED_PROPERTY_SETTER |
| 3468 #undef INDEXED_PROPERTY_GETTER | |
| 3469 #undef INDEXED_PROPERTY_SETTER | |
| 3470 | 3457 |
| 3471 | 3458 |
| 3472 // static | 3459 // static |
| 3473 Frame* V8Custom::GetTargetFrame(v8::Local<v8::Object> host, | 3460 Frame* V8Custom::GetTargetFrame(v8::Local<v8::Object> host, |
| 3474 v8::Local<v8::Value> data) { | 3461 v8::Local<v8::Value> data) { |
| 3475 Frame* target = 0; | 3462 Frame* target = 0; |
| 3476 switch (V8ClassIndex::FromInt(data->Int32Value())) { | 3463 switch (V8ClassIndex::FromInt(data->Int32Value())) { |
| 3477 case V8ClassIndex::DOMWINDOW: { | 3464 case V8ClassIndex::DOMWINDOW: { |
| 3478 v8::Handle<v8::Value> window = | 3465 v8::Handle<v8::Value> window = |
| 3479 V8Proxy::LookupDOMWrapper(V8ClassIndex::DOMWINDOW, host); | 3466 V8Proxy::LookupDOMWrapper(V8ClassIndex::DOMWINDOW, host); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3538 #undef MAKE_CASE | 3525 #undef MAKE_CASE |
| 3539 | 3526 |
| 3540 default: | 3527 default: |
| 3541 return V8ClassIndex::INVALID_CLASS_INDEX; | 3528 return V8ClassIndex::INVALID_CLASS_INDEX; |
| 3542 } | 3529 } |
| 3543 } | 3530 } |
| 3544 | 3531 |
| 3545 #endif // ENABLE(SVG) | 3532 #endif // ENABLE(SVG) |
| 3546 | 3533 |
| 3547 } // namespace WebCore | 3534 } // namespace WebCore |
| OLD | NEW |