Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp

Issue 8015008: Merge 95489 - [V8] document.all gets confused about its prototype chain (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 return result; 70 return result;
71 } 71 }
72 72
73 RefPtr<Node> result = collection->item(index->Uint32Value()); 73 RefPtr<Node> result = collection->item(index->Uint32Value());
74 return toV8(result.release()); 74 return toV8(result.release());
75 } 75 }
76 76
77 v8::Handle<v8::Value> V8HTMLCollection::namedPropertyGetter(v8::Local<v8::String > name, const v8::AccessorInfo& info) 77 v8::Handle<v8::Value> V8HTMLCollection::namedPropertyGetter(v8::Local<v8::String > name, const v8::AccessorInfo& info)
78 { 78 {
79 INC_STATS("DOM.HTMLCollection.NamedPropertyGetter"); 79 INC_STATS("DOM.HTMLCollection.NamedPropertyGetter");
80 // Search the prototype chain first.
81 v8::Handle<v8::Value> value = info.Holder()->GetRealNamedPropertyInPrototype Chain(name);
82 80
83 if (!value.IsEmpty()) 81 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
84 return value; 82 return notHandledByInterceptor();
83 if (info.Holder()->HasRealNamedCallbackProperty(name))
84 return notHandledByInterceptor();
85 85
86 // Search local callback properties next to find IDL defined
87 // properties.
88 if (info.Holder()->HasRealNamedCallbackProperty(name))
89 return v8::Handle<v8::Value>();
90
91 // Finally, search the DOM structure.
92 HTMLCollection* imp = V8HTMLCollection::toNative(info.Holder()); 86 HTMLCollection* imp = V8HTMLCollection::toNative(info.Holder());
93 return getNamedItems(imp, v8StringToAtomicWebCoreString(name)); 87 return getNamedItems(imp, v8StringToAtomicWebCoreString(name));
94 } 88 }
95 89
96 v8::Handle<v8::Value> V8HTMLCollection::itemCallback(const v8::Arguments& args) 90 v8::Handle<v8::Value> V8HTMLCollection::itemCallback(const v8::Arguments& args)
97 { 91 {
98 INC_STATS("DOM.HTMLCollection.item()"); 92 INC_STATS("DOM.HTMLCollection.item()");
99 HTMLCollection* imp = V8HTMLCollection::toNative(args.Holder()); 93 HTMLCollection* imp = V8HTMLCollection::toNative(args.Holder());
100 return getItem(imp, args[0]); 94 return getItem(imp, args[0]);
101 } 95 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 137 }
144 138
145 v8::Handle<v8::Value> toV8(HTMLCollection* impl) 139 v8::Handle<v8::Value> toV8(HTMLCollection* impl)
146 { 140 {
147 if (impl->type() == DocAll) 141 if (impl->type() == DocAll)
148 return toV8(static_cast<HTMLAllCollection*>(impl)); 142 return toV8(static_cast<HTMLAllCollection*>(impl));
149 return V8HTMLCollection::wrap(impl); 143 return V8HTMLCollection::wrap(impl);
150 } 144 }
151 145
152 } // namespace WebCore 146 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698