Changeset 51501 in webkit
- Timestamp:
- Nov 30, 2009 10:59:36 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r51498 r51501 1 2009-11-30 Erik Arvidsson <arv@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 Clean up V8 bindings for CSSStyleDeclaration and CSSVariableDeclaration 6 https://bugs.webkit.org/show_bug.cgi?id=31895 7 8 No new tests. This is already covered by: 9 fast/dom/CSSStyleDeclaration/css-computed-style-item.html 10 fast/dom/CSSStyleDeclaration/css-style-item.html 11 12 * bindings/v8/V8Collection.h: 13 (WebCore::collectionStringIndexedPropertyGetter): 14 (WebCore::setCollectionStringIndexedGetter): 15 * bindings/v8/V8DOMWrapper.cpp: 16 (WebCore::V8DOMWrapper::getTemplate): 17 1 18 2009-11-30 Steve Block <steveblock@google.com> 2 19 -
trunk/WebCore/bindings/v8/V8Collection.h
r50253 r51501 178 178 179 179 180 // A template for indexed getters on collections of strings. 181 template<class Collection> static v8::Handle<v8::Value> collectionStringIndexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info) 182 { 183 // FIXME: assert that object must be a collection type 184 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); 185 V8ClassIndex::V8WrapperType wrapperType = V8DOMWrapper::domWrapperType(info.Holder()); 186 Collection* collection = V8DOMWrapper::convertToNativeObject<Collection>(wrapperType, info.Holder()); 187 String result = collection->item(index); 188 return v8String(result); 189 } 190 191 180 192 // Add indexed getter to the function template for a collection. 181 193 template<class Collection, class ItemType> static void setCollectionIndexedGetter(v8::Handle<v8::FunctionTemplate> desc, V8ClassIndex::V8WrapperType type) … … 209 221 } 210 222 223 224 // Add indexed getter returning a string to a function template for a collection. 225 template<class Collection> static void setCollectionStringIndexedGetter(v8::Handle<v8::FunctionTemplate> desc) 226 { 227 desc->InstanceTemplate()->SetIndexedPropertyHandler(collectionStringIndexedPropertyGetter<Collection>, 0, 0, 0, collectionIndexedPropertyEnumerator<Collection>); 228 } 229 211 230 v8::Handle<v8::Value> toOptionsCollectionSetter(uint32_t index, v8::Handle<v8::Value>, HTMLSelectElement*); 212 231 -
trunk/WebCore/bindings/v8/V8DOMWrapper.cpp
r51416 r51501 276 276 // itself and not on the prototype object. 277 277 descriptor->InstanceTemplate()->SetNamedPropertyHandler( USE_NAMED_PROPERTY_GETTER(CSSStyleDeclaration), USE_NAMED_PROPERTY_SETTER(CSSStyleDeclaration)); 278 setCollectionString OrNullIndexedGetter<CSSStyleDeclaration>(descriptor);278 setCollectionStringIndexedGetter<CSSStyleDeclaration>(descriptor); 279 279 break; 280 280 case V8ClassIndex::CSSRULELIST: … … 285 285 break; 286 286 case V8ClassIndex::CSSVARIABLESDECLARATION: 287 setCollectionString OrNullIndexedGetter<CSSVariablesDeclaration>(descriptor);287 setCollectionStringIndexedGetter<CSSVariablesDeclaration>(descriptor); 288 288 break; 289 289 case V8ClassIndex::WEBKITCSSTRANSFORMVALUE:
Note: See TracChangeset
for help on using the changeset viewer.