From 2de4c9dc8adde93fab848f91d07ee7c579ae1ced Mon Sep 17 00:00:00 2001 From: "davemoore@chromium.org" Date: Wed, 15 Apr 2009 18:21:28 +0000 Subject: Reverting 13760. Review URL: http://codereview.chromium.org/75002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13762 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/port/bindings/v8/v8_custom.cpp | 29 ----------------------------- webkit/port/bindings/v8/v8_custom.h | 1 - webkit/port/bindings/v8/v8_proxy.cpp | 13 +++++++++---- 3 files changed, 9 insertions(+), 34 deletions(-) (limited to 'webkit/port') diff --git a/webkit/port/bindings/v8/v8_custom.cpp b/webkit/port/bindings/v8/v8_custom.cpp index 4ac1554..4b2e545 100644 --- a/webkit/port/bindings/v8/v8_custom.cpp +++ b/webkit/port/bindings/v8/v8_custom.cpp @@ -41,7 +41,6 @@ #include "V8HTMLDocument.h" #include "V8HTMLImageElement.h" #include "V8HTMLOptionElement.h" -#include "V8NamedNodesCollection.h" #include "V8Node.h" #include "V8XPathNSResolver.h" #include "V8XPathResult.h" @@ -234,34 +233,6 @@ INDEXED_PROPERTY_SETTER(HTMLOptionsCollection) { return OptionsCollectionSetter(index, value, base); } -NAMED_PROPERTY_GETTER(HTMLSelectElementCollection) { - INC_STATS("DOM.HTMLSelectElementCollection.NamedPropertySetter"); - HTMLSelectElement* select = - V8Proxy::DOMWrapperToNode(info.Holder()); - v8::Handle value = info.Holder()->GetRealNamedPropertyInPrototypeChain(name); - - if (!value.IsEmpty()) - return value; - - // Search local callback properties next to find IDL defined - // properties. - if (info.Holder()->HasRealNamedCallbackProperty(name)) - return notHandledByInterceptor(); - - PassRefPtr collection = select->options(); - - Vector > items; - collection->namedItems(v8StringToAtomicWebCoreString(name), items); - - if (!items.size()) - return v8::Handle(); - - if (items.size() == 1) - return V8Proxy::NodeToV8Object(items.at(0).get()); - - NodeList* list = new V8NamedNodesCollection(items); - return V8Proxy::ToV8Object(V8ClassIndex::NODELIST, list); -} INDEXED_PROPERTY_SETTER(HTMLSelectElementCollection) { INC_STATS("DOM.HTMLSelectElementCollection.IndexedPropertySetter"); diff --git a/webkit/port/bindings/v8/v8_custom.h b/webkit/port/bindings/v8/v8_custom.h index e8a0bad..73b5f96 100644 --- a/webkit/port/bindings/v8/v8_custom.h +++ b/webkit/port/bindings/v8/v8_custom.h @@ -477,7 +477,6 @@ DECLARE_INDEXED_PROPERTY_GETTER(NamedNodeMap) DECLARE_INDEXED_PROPERTY_GETTER(HTMLFormElement) DECLARE_INDEXED_PROPERTY_GETTER(HTMLOptionsCollection) DECLARE_INDEXED_PROPERTY_SETTER(HTMLOptionsCollection) -DECLARE_NAMED_PROPERTY_GETTER(HTMLSelectElementCollection) DECLARE_INDEXED_PROPERTY_SETTER(HTMLSelectElementCollection) DECLARE_NAMED_PROPERTY_GETTER(HTMLCollection) diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp index f7af9db..723d32b 100644 --- a/webkit/port/bindings/v8/v8_proxy.cpp +++ b/webkit/port/bindings/v8/v8_proxy.cpp @@ -1292,8 +1292,9 @@ v8::Persistent V8Proxy::GetTemplate( V8ClassIndex::NODE); break; case V8ClassIndex::HTMLOPTIONSCOLLECTION: - desc->InstanceTemplate()->SetNamedPropertyHandler( - USE_NAMED_PROPERTY_GETTER(HTMLCollection)); + setCollectionNamedGetter( + desc, + V8ClassIndex::NODE); desc->InstanceTemplate()->SetIndexedPropertyHandler( USE_INDEXED_PROPERTY_GETTER(HTMLOptionsCollection), USE_INDEXED_PROPERTY_SETTER(HTMLOptionsCollection)); @@ -1302,7 +1303,12 @@ v8::Persistent V8Proxy::GetTemplate( break; case V8ClassIndex::HTMLSELECTELEMENT: desc->InstanceTemplate()->SetNamedPropertyHandler( - USE_NAMED_PROPERTY_GETTER(HTMLSelectElementCollection)); + nodeCollectionNamedPropertyGetter, + 0, + 0, + 0, + 0, + v8::Integer::New(V8ClassIndex::NODE)); desc->InstanceTemplate()->SetIndexedPropertyHandler( nodeCollectionIndexedPropertyGetter, USE_INDEXED_PROPERTY_SETTER(HTMLSelectElementCollection), @@ -2403,7 +2409,6 @@ void* V8Proxy::ToNativeObjectImpl(V8ClassIndex::V8WrapperType type, return DOMWrapperToNative(object); } - v8::Handle V8Proxy::LookupDOMWrapper( V8ClassIndex::V8WrapperType type, v8::Handle value) { -- cgit v1.1