| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 return result; | 67 return result; |
| 68 } | 68 } |
| 69 | 69 |
| 70 RefPtr<Node> result = collection->item(index->Uint32Value()); | 70 RefPtr<Node> result = collection->item(index->Uint32Value()); |
| 71 return toV8(result.release()); | 71 return toV8(result.release()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 v8::Handle<v8::Value> V8HTMLAllCollection::namedPropertyGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | 74 v8::Handle<v8::Value> V8HTMLAllCollection::namedPropertyGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) |
| 75 { | 75 { |
| 76 INC_STATS("DOM.HTMLAllCollection.NamedPropertyGetter"); | 76 INC_STATS("DOM.HTMLAllCollection.NamedPropertyGetter"); |
| 77 // Search the prototype chain first. | |
| 78 v8::Handle<v8::Value> value = info.Holder()->GetRealNamedPropertyInPrototype
Chain(name); | |
| 79 | 77 |
| 80 if (!value.IsEmpty()) | 78 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
| 81 return value; | 79 return notHandledByInterceptor(); |
| 80 if (info.Holder()->HasRealNamedCallbackProperty(name)) |
| 81 return notHandledByInterceptor(); |
| 82 | 82 |
| 83 // Search local callback properties next to find IDL defined | |
| 84 // properties. | |
| 85 if (info.Holder()->HasRealNamedCallbackProperty(name)) | |
| 86 return v8::Handle<v8::Value>(); | |
| 87 | |
| 88 // Finally, search the DOM structure. | |
| 89 HTMLAllCollection* imp = V8HTMLAllCollection::toNative(info.Holder()); | 83 HTMLAllCollection* imp = V8HTMLAllCollection::toNative(info.Holder()); |
| 90 return getNamedItems(imp, v8StringToAtomicWebCoreString(name)); | 84 return getNamedItems(imp, v8StringToAtomicWebCoreString(name)); |
| 91 } | 85 } |
| 92 | 86 |
| 93 v8::Handle<v8::Value> V8HTMLAllCollection::itemCallback(const v8::Arguments& arg
s) | 87 v8::Handle<v8::Value> V8HTMLAllCollection::itemCallback(const v8::Arguments& arg
s) |
| 94 { | 88 { |
| 95 INC_STATS("DOM.HTMLAllCollection.item()"); | 89 INC_STATS("DOM.HTMLAllCollection.item()"); |
| 96 HTMLAllCollection* imp = V8HTMLAllCollection::toNative(args.Holder()); | 90 HTMLAllCollection* imp = V8HTMLAllCollection::toNative(args.Holder()); |
| 97 return getItem(imp, args[0]); | 91 return getItem(imp, args[0]); |
| 98 } | 92 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 return toV8(node); | 127 return toV8(node); |
| 134 | 128 |
| 135 node = imp->nextNamedItem(name); | 129 node = imp->nextNamedItem(name); |
| 136 current--; | 130 current--; |
| 137 } | 131 } |
| 138 | 132 |
| 139 return v8::Undefined(); | 133 return v8::Undefined(); |
| 140 } | 134 } |
| 141 | 135 |
| 142 } // namespace WebCore | 136 } // namespace WebCore |
| OLD | NEW |