Changeset 50037 in webkit
- Timestamp:
- Oct 24, 2009 7:44:50 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r50029 r50037 1 2009-10-24 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Dan Bernstein. 4 5 Update tests for https://bugs.webkit.org/show_bug.cgi?id=30751 6 HTMLOptionsCollection should not inherit from HTMLCollection 7 8 * fast/dom/wrapper-classes-expected.txt: 9 1 10 2009-10-24 Dan Bernstein <mitz@apple.com> 2 11 -
trunk/LayoutTests/fast/dom/wrapper-classes-expected.txt
r46211 r50037 142 142 PASS jsWrapperClass(document.constructor) is 'HTMLDocumentConstructor' 143 143 PASS jsWrapperClass(document.createElement('select').options) is 'HTMLOptionsCollection' 144 FAIL jsWrapperClass(document.createElement('select').options.__proto__) should be HTMLOptionsCollectionPrototype. Was HTMLCollectionPrototype. 145 FAIL jsWrapperClass(document.createElement('select').options.constructor) should be HTMLOptionsCollectionConstructor. Was Function. 144 PASS jsWrapperClass(document.createElement('select').options.__proto__) is 'HTMLOptionsCollectionPrototype' 145 PASS jsWrapperClass(document.createElement('select').options.constructor) is 'HTMLOptionsCollectionConstructor' 146 146 147 147 HTML Elements -
trunk/WebCore/ChangeLog
r50036 r50037 1 2009-10-24 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Dan Bernstein. 4 5 Fix for https://bugs.webkit.org/show_bug.cgi?id=30751 6 HTMLOptionsCollection should not inherit from HTMLCollection 7 8 * GNUmakefile.am: 9 * WebCore.gypi: 10 * WebCore.pro: 11 * WebCore.vcproj/WebCore.vcproj: 12 * WebCore.xcodeproj/project.pbxproj: 13 Added JSHTMLCollectionFunctions.h 14 15 * bindings/js/JSHTMLAllCollectionCustom.cpp: 16 (WebCore::callHTMLAllCollection): 17 (WebCore::JSHTMLAllCollection::nameGetter): 18 (WebCore::JSHTMLAllCollection::item): 19 (WebCore::JSHTMLAllCollection::namedItem): 20 * bindings/js/JSHTMLCollectionCustom.cpp: 21 (WebCore::callHTMLCollection): 22 (WebCore::JSHTMLCollection::nameGetter): 23 (WebCore::JSHTMLCollection::item): 24 (WebCore::JSHTMLCollection::namedItem): 25 * bindings/js/JSHTMLOptionsCollectionCustom.cpp: 26 (WebCore::callHTMLCollection): 27 (WebCore::JSHTMLOptionsCollection::getCallData): 28 (WebCore::JSHTMLOptionsCollection::canGetItemsForName): 29 (WebCore::JSHTMLOptionsCollection::nameGetter): 30 (WebCore::JSHTMLOptionsCollection::indexSetter): 31 (WebCore::JSHTMLOptionsCollection::item): 32 (WebCore::JSHTMLOptionsCollection::namedItem): 33 Refactor to use generic implementation of HTMLCollection bindings functions 34 from JSHTMLCollectionFunctions.h 35 36 * bindings/js/JSHTMLCollectionFunctions.h: Added. 37 (WebCore::getCollectionNamedItems): 38 (WebCore::getCollectionItems): 39 (WebCore::callHTMLCollectionGeneric): 40 Added generic functions that JSHTMLCollection, JSHTMLAllCollection and 41 JSHTMLOptionsCollection can all use. 42 43 * bindings/js/JSHTMLDocumentCustom.cpp: Add include of JSHTMLAllCollection.h 44 for toJS on document.all. 45 46 * bindings/objc/DOMHTML.mm: 47 * bindings/objc/DOMUtility.mm: 48 (JSC::createDOMWrapper): 49 Remove special cases for HTMLOptionsCollection. 50 51 * bindings/scripts/CodeGeneratorJS.pm: 52 * html/HTMLAllCollection.idl: 53 * html/HTMLCollection.idl: 54 * html/HTMLOptionsCollection.idl: 55 1 56 2009-10-24 Timothy Hatcher <timothy@apple.com> 2 57 -
trunk/WebCore/GNUmakefile.am
r50013 r50037 377 377 WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp \ 378 378 WebCore/bindings/js/JSHTMLCollectionCustom.cpp \ 379 WebCore/bindings/js/JSHTMLCollectionFunctions.h \ 379 380 WebCore/bindings/js/JSHTMLDataGridElementCustom.cpp \ 380 381 WebCore/bindings/js/JSHTMLDocumentCustom.cpp \ -
trunk/WebCore/WebCore.gypi
r50027 r50037 497 497 'bindings/js/JSHTMLCanvasElementCustom.cpp', 498 498 'bindings/js/JSHTMLCollectionCustom.cpp', 499 'bindings/js/JSHTMLCollectionFunctions.h', 499 500 'bindings/js/JSHTMLDataGridElementCustom.cpp', 500 501 'bindings/js/JSHTMLDocumentCustom.cpp', -
trunk/WebCore/WebCore.pro
r50028 r50037 710 710 bindings/js/JSHTMLAllCollectionCustom.cpp \ 711 711 bindings/js/JSHTMLCollectionCustom.cpp \ 712 bindings/js/JSHTMLCollectionFunctions.h \ 712 713 bindings/js/JSHTMLDataGridElementCustom.cpp \ 713 714 bindings/js/JSHTMLDocumentCustom.cpp \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r50015 r50037 33939 33939 </File> 33940 33940 <File 33941 RelativePath="..\bindings\js\JSHTMLCollectionFunctions.h" 33942 > 33943 </File> 33944 <File 33941 33945 RelativePath="..\bindings\js\JSHTMLDataGridElementCustom.cpp" 33942 33946 > -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r50013 r50037 4329 4329 BC97E413109154FA0010D361 /* JSHTMLAllCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = BC97E411109154FA0010D361 /* JSHTMLAllCollection.h */; }; 4330 4330 BC97E42C10915B060010D361 /* JSHTMLAllCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC97E42B10915B060010D361 /* JSHTMLAllCollectionCustom.cpp */; }; 4331 BC97E53F10926C870010D361 /* JSHTMLCollectionFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = BC97E53E10926C870010D361 /* JSHTMLCollectionFunctions.h */; }; 4331 4332 BC98543D0CD3D98B00069BC1 /* JSConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */; }; 4332 4333 BC98543E0CD3D98C00069BC1 /* JSConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = BC98543C0CD3D98B00069BC1 /* JSConsole.h */; }; … … 9462 9463 BC97E411109154FA0010D361 /* JSHTMLAllCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLAllCollection.h; sourceTree = "<group>"; }; 9463 9464 BC97E42B10915B060010D361 /* JSHTMLAllCollectionCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLAllCollectionCustom.cpp; sourceTree = "<group>"; }; 9465 BC97E53E10926C870010D361 /* JSHTMLCollectionFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLCollectionFunctions.h; sourceTree = "<group>"; }; 9464 9466 BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSConsole.cpp; sourceTree = "<group>"; }; 9465 9467 BC98543C0CD3D98B00069BC1 /* JSConsole.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSConsole.h; sourceTree = "<group>"; }; … … 14271 14273 3314ACE910892086000F0E56 /* JSExceptionBase.cpp */, 14272 14274 3314ACEA10892086000F0E56 /* JSExceptionBase.h */, 14275 BC97E53E10926C870010D361 /* JSHTMLCollectionFunctions.h */, 14273 14276 C09158840DB4209200E55AF4 /* JSInspectedObjectWrapper.cpp */, 14274 14277 C09158850DB4209200E55AF4 /* JSInspectedObjectWrapper.h */, … … 18069 18072 BC97E23A109144950010D361 /* HTMLAllCollection.h in Headers */, 18070 18073 BC97E413109154FA0010D361 /* JSHTMLAllCollection.h in Headers */, 18074 BC97E53F10926C870010D361 /* JSHTMLCollectionFunctions.h in Headers */, 18071 18075 ); 18072 18076 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
r49998 r50037 31 31 #include "JSDOMBinding.h" 32 32 #include "JSHTMLAllCollection.h" 33 #include "JSHTMLCollectionFunctions.h" 33 34 #include "JSNode.h" 34 35 #include "JSNodeList.h" 35 36 #include "Node.h" 36 #include "StaticNodeList.h"37 #include <wtf/Vector.h>38 37 39 38 using namespace JSC; … … 41 40 namespace WebCore { 42 41 43 static JSValue getNamedItems(ExecState* exec, JSHTMLAllCollection* collection, const Identifier& propertyName)44 {45 Vector<RefPtr<Node> > namedItems;46 collection->impl()->namedItems(propertyName, namedItems);47 48 if (namedItems.isEmpty())49 return jsUndefined();50 if (namedItems.size() == 1)51 return toJS(exec, collection->globalObject(), namedItems[0].get());52 53 // FIXME: HTML5 specifies that this should be a DynamicNodeList.54 // FIXME: HTML5 specifies that non-HTMLOptionsCollection collections should return55 // the first matching item instead of a NodeList.56 return toJS(exec, collection->globalObject(), StaticNodeList::adopt(namedItems).get());57 }58 59 // HTMLCollections are strange objects, they support both get and call,60 // so that document.forms.item(0) and document.forms(0) both work.61 42 static JSValue JSC_HOST_CALL callHTMLAllCollection(ExecState* exec, JSObject* function, JSValue, const ArgList& args) 62 43 { 63 if (args.size() < 1) 64 return jsUndefined(); 65 66 // Do not use thisObj here. It can be the JSHTMLDocument, in the document.forms(i) case. 67 JSHTMLAllCollection* jsCollection = static_cast<JSHTMLAllCollection*>(function); 68 HTMLAllCollection* collection = jsCollection->impl(); 69 70 // Also, do we need the TypeError test here ? 71 72 if (args.size() == 1) { 73 // Support for document.all(<index>) etc. 74 bool ok; 75 UString string = args.at(0).toString(exec); 76 unsigned index = string.toUInt32(&ok, false); 77 if (ok) 78 return toJS(exec, jsCollection->globalObject(), collection->item(index)); 79 80 // Support for document.images('<name>') etc. 81 return getNamedItems(exec, jsCollection, Identifier(exec, string)); 82 } 83 84 // The second arg, if set, is the index of the item we want 85 bool ok; 86 UString string = args.at(0).toString(exec); 87 unsigned index = args.at(1).toString(exec).toUInt32(&ok, false); 88 if (ok) { 89 String pstr = string; 90 Node* node = collection->namedItem(pstr); 91 while (node) { 92 if (!index) 93 return toJS(exec, jsCollection->globalObject(), node); 94 node = collection->nextNamedItem(pstr); 95 --index; 96 } 97 } 98 99 return jsUndefined(); 44 return callHTMLCollectionGeneric<HTMLAllCollection, JSHTMLAllCollection>(exec, function, args); 100 45 } 101 46 … … 116 61 { 117 62 JSHTMLAllCollection* thisObj = static_cast<JSHTMLAllCollection*>(asObject(slot.slotBase())); 118 return get NamedItems(exec, thisObj, propertyName);63 return getCollectionNamedItems<JSHTMLAllCollection>(exec, thisObj, propertyName); 119 64 } 120 65 121 66 JSValue JSHTMLAllCollection::item(ExecState* exec, const ArgList& args) 122 67 { 123 bool ok; 124 uint32_t index = args.at(0).toString(exec).toUInt32(&ok, false); 125 if (ok) 126 return toJS(exec, globalObject(), impl()->item(index)); 127 return getNamedItems(exec, this, Identifier(exec, args.at(0).toString(exec))); 68 return getCollectionItems<JSHTMLAllCollection>(exec, this, args.at(0)); 128 69 } 129 70 130 71 JSValue JSHTMLAllCollection::namedItem(ExecState* exec, const ArgList& args) 131 72 { 132 return get NamedItems(exec, this, Identifier(exec, args.at(0).toString(exec)));73 return getCollectionNamedItems<JSHTMLAllCollection>(exec, this, Identifier(exec, args.at(0).toString(exec))); 133 74 } 134 75 -
trunk/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
r49998 r50037 22 22 23 23 #include "AtomicString.h" 24 #include "HTMLAllCollection.h" 24 25 #include "HTMLCollection.h" 25 26 #include "HTMLOptionsCollection.h" 26 #include "HTMLAllCollection.h"27 27 #include "JSDOMBinding.h" 28 28 #include "JSHTMLAllCollection.h" 29 #include "JSHTMLCollectionFunctions.h" 29 30 #include "JSHTMLOptionsCollection.h" 30 31 #include "JSNode.h" … … 38 39 namespace WebCore { 39 40 40 static JSValue getNamedItems(ExecState* exec, JSHTMLCollection* collection, const Identifier& propertyName)41 {42 Vector<RefPtr<Node> > namedItems;43 collection->impl()->namedItems(propertyName, namedItems);44 45 if (namedItems.isEmpty())46 return jsUndefined();47 if (namedItems.size() == 1)48 return toJS(exec, collection->globalObject(), namedItems[0].get());49 50 // FIXME: HTML5 specifies that this should be a DynamicNodeList.51 // FIXME: HTML5 specifies that non-HTMLOptionsCollection collections should return52 // the first matching item instead of a NodeList.53 return toJS(exec, collection->globalObject(), StaticNodeList::adopt(namedItems).get());54 }55 56 // HTMLCollections are strange objects, they support both get and call,57 // so that document.forms.item(0) and document.forms(0) both work.58 41 static JSValue JSC_HOST_CALL callHTMLCollection(ExecState* exec, JSObject* function, JSValue, const ArgList& args) 59 42 { 60 if (args.size() < 1) 61 return jsUndefined(); 62 63 // Do not use thisObj here. It can be the JSHTMLDocument, in the document.forms(i) case. 64 JSHTMLCollection* jsCollection = static_cast<JSHTMLCollection*>(function); 65 HTMLCollection* collection = jsCollection->impl(); 66 67 // Also, do we need the TypeError test here ? 68 69 if (args.size() == 1) { 70 // Support for document.all(<index>) etc. 71 bool ok; 72 UString string = args.at(0).toString(exec); 73 unsigned index = string.toUInt32(&ok, false); 74 if (ok) 75 return toJS(exec, jsCollection->globalObject(), collection->item(index)); 76 77 // Support for document.images('<name>') etc. 78 return getNamedItems(exec, jsCollection, Identifier(exec, string)); 79 } 80 81 // The second arg, if set, is the index of the item we want 82 bool ok; 83 UString string = args.at(0).toString(exec); 84 unsigned index = args.at(1).toString(exec).toUInt32(&ok, false); 85 if (ok) { 86 String pstr = string; 87 Node* node = collection->namedItem(pstr); 88 while (node) { 89 if (!index) 90 return toJS(exec, jsCollection->globalObject(), node); 91 node = collection->nextNamedItem(pstr); 92 --index; 93 } 94 } 95 96 return jsUndefined(); 43 return callHTMLCollectionGeneric<HTMLCollection, JSHTMLCollection>(exec, function, args); 97 44 } 98 45 … … 113 60 { 114 61 JSHTMLCollection* thisObj = static_cast<JSHTMLCollection*>(asObject(slot.slotBase())); 115 return get NamedItems(exec, thisObj, propertyName);62 return getCollectionNamedItems<JSHTMLCollection>(exec, thisObj, propertyName); 116 63 } 117 64 118 65 JSValue JSHTMLCollection::item(ExecState* exec, const ArgList& args) 119 66 { 120 bool ok; 121 uint32_t index = args.at(0).toString(exec).toUInt32(&ok, false); 122 if (ok) 123 return toJS(exec, globalObject(), impl()->item(index)); 124 return getNamedItems(exec, this, Identifier(exec, args.at(0).toString(exec))); 67 return getCollectionItems<JSHTMLCollection>(exec, this, args.at(0)); 125 68 } 126 69 127 70 JSValue JSHTMLCollection::namedItem(ExecState* exec, const ArgList& args) 128 71 { 129 return getNamedItems(exec, this, Identifier(exec, args.at(0).toString(exec))); 130 } 131 132 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, HTMLCollection* collection) 133 { 134 if (!collection) 135 return jsNull(); 136 137 DOMObject* wrapper = getCachedDOMObjectWrapper(exec->globalData(), collection); 138 139 if (wrapper) 140 return wrapper; 141 142 switch (collection->type()) { 143 case SelectOptions: 144 wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, HTMLOptionsCollection, collection); 145 break; 146 case DocAll: 147 wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, HTMLAllCollection, collection); 148 break; 149 default: 150 wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, HTMLCollection, collection); 151 break; 152 } 153 154 return wrapper; 72 return getCollectionNamedItems<JSHTMLCollection>(exec, this, Identifier(exec, args.at(0).toString(exec))); 155 73 } 156 74 -
trunk/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
r49998 r50037 39 39 #include "JSDOMWindowCustom.h" 40 40 #include "JSDOMWindowShell.h" 41 #include "JSHTMLAllCollection.h" 41 42 #include "JSHTMLCollection.h" 42 43 #include "SegmentedString.h" -
trunk/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
r46444 r50037 26 26 #include "HTMLOptionsCollection.h" 27 27 #include "HTMLSelectElement.h" 28 #include "JSHTMLCollection.h" 29 #include "JSHTMLCollectionFunctions.h" 28 30 #include "JSHTMLOptionElement.h" 29 31 #include "JSHTMLSelectElement.h" 30 32 #include "JSHTMLSelectElementCustom.h" 31 32 33 #include <wtf/MathExtras.h> 33 34 … … 36 37 namespace WebCore { 37 38 38 JSValue JSHTMLOptionsCollection::length(ExecState* exec) const 39 static JSValue JSC_HOST_CALL callHTMLCollection(ExecState* exec, JSObject* function, JSValue, const ArgList& args) 40 { 41 return callHTMLCollectionGeneric<HTMLOptionsCollection, JSHTMLOptionsCollection>(exec, function, args); 42 } 43 44 CallType JSHTMLOptionsCollection::getCallData(CallData& callData) 45 { 46 callData.native.function = callHTMLCollection; 47 return CallTypeHost; 48 } 49 50 bool JSHTMLOptionsCollection::canGetItemsForName(ExecState*, HTMLOptionsCollection* collection, const Identifier& propertyName) 51 { 52 Vector<RefPtr<Node> > namedItems; 53 collection->namedItems(propertyName, namedItems); 54 return !namedItems.isEmpty(); 55 } 56 57 JSValue JSHTMLOptionsCollection::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot) 58 { 59 JSHTMLOptionsCollection* thisObj = static_cast<JSHTMLOptionsCollection*>(asObject(slot.slotBase())); 60 return getCollectionNamedItems<JSHTMLOptionsCollection>(exec, thisObj, propertyName); 61 } 62 63 void JSHTMLOptionsCollection::indexSetter(ExecState* exec, unsigned index, JSValue value) 39 64 { 40 65 HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl()); 41 return jsNumber(exec, imp->length()); 66 HTMLSelectElement* base = static_cast<HTMLSelectElement*>(imp->base()); 67 selectIndexSetter(base, exec, index, value); 68 } 69 70 JSValue JSHTMLOptionsCollection::item(ExecState* exec, const ArgList& args) 71 { 72 return getCollectionItems<JSHTMLOptionsCollection>(exec, this, args.at(0)); 73 } 74 75 JSValue JSHTMLOptionsCollection::namedItem(ExecState* exec, const ArgList& args) 76 { 77 return getCollectionNamedItems<JSHTMLOptionsCollection>(exec, this, Identifier(exec, args.at(0).toString(exec))); 42 78 } 43 79 … … 59 95 imp->setLength(newLength, ec); 60 96 setDOMException(exec, ec); 61 }62 63 void JSHTMLOptionsCollection::indexSetter(ExecState* exec, unsigned index, JSValue value)64 {65 HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl());66 HTMLSelectElement* base = static_cast<HTMLSelectElement*>(imp->base());67 selectIndexSetter(base, exec, index, value);68 97 } 69 98 … … 96 125 } 97 126 98 } 127 } // namespace WebCore -
trunk/WebCore/bindings/objc/DOMHTML.mm
r45947 r50037 29 29 #import "DOMDocumentFragmentInternal.h" 30 30 #import "DOMExtensions.h" 31 #import "DOMHTMLCollectionInternal.h"32 31 #import "DOMHTMLDocumentInternal.h" 33 32 #import "DOMHTMLInputElementInternal.h" … … 38 37 #import "DocumentFragment.h" 39 38 #import "FrameView.h" 40 #import "HTMLCollection.h"41 39 #import "HTMLDocument.h" 42 40 #import "HTMLInputElement.h" … … 182 180 183 181 @end 184 185 Class kitClass(WebCore::HTMLCollection* collection)186 {187 if (collection->type() == WebCore::SelectOptions)188 return [DOMHTMLOptionsCollection class];189 return [DOMHTMLCollection class];190 } -
trunk/WebCore/bindings/objc/DOMUtility.mm
r42618 r50037 35 35 #import "DOMEventInternal.h" 36 36 #import "DOMHTMLCollectionInternal.h" 37 #import "DOMHTMLOptionsCollectionInternal.h" 37 38 #import "DOMImplementationFront.h" 38 39 #import "DOMInternal.h" … … 106 107 WRAP(Counter) 107 108 WRAP(Event) 109 WRAP(HTMLCollection) 108 110 WRAP(HTMLOptionsCollection) 109 111 WRAP(MediaList) … … 118 120 WRAP(StyleSheetList) 119 121 WRAP(TreeWalker) 122 WRAP(DOMWindowShell) 120 123 #if ENABLE(XPATH) 121 124 WRAP(XPathExpression) … … 123 126 #endif 124 127 125 // This must be after the HTMLOptionsCollection check, because it's a subclass in the JavaScript126 // binding, but not a subclass in the ObjC binding.127 WRAP(HTMLCollection)128 129 128 #undef WRAP 130 131 if (object->inherits(&WebCore::JSDOMWindowShell::s_info))132 return kit(static_cast<WebCore::JSDOMWindowShell*>(object)->impl());133 129 134 130 if (object->inherits(&WebCore::JSDOMImplementation::s_info)) -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r49998 r50037 1709 1709 } 1710 1710 push(@implContent, "}\n"); 1711 if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection" ) {1711 if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection" or $interfaceName eq "HTMLOptionsCollection") { 1712 1712 $implIncludes{"JSNode.h"} = 1; 1713 1713 $implIncludes{"Node.h"} = 1; … … 1720 1720 push(@implContent, " return jsNumber(exec, static_cast<$implClassName*>(impl())->item(index));\n"); 1721 1721 push(@implContent, "}\n"); 1722 if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection" ) {1722 if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection" or $interfaceName eq "HTMLOptionsCollection") { 1723 1723 $implIncludes{"JSNode.h"} = 1; 1724 1724 $implIncludes{"Node.h"} = 1; -
trunk/WebCore/html/HTMLAllCollection.idl
r49998 r50037 31 31 HasNameGetter, 32 32 CustomCall, 33 CustomToJS,34 33 MasqueradesAsUndefined 35 34 ] HTMLAllCollection { -
trunk/WebCore/html/HTMLCollection.idl
r49998 r50037 26 26 HasNameGetter, 27 27 CustomCall, 28 CustomToJS,29 Polymorphic,30 28 InterfaceUUID=b0d215ff-6f9c-4d1f-86c3-f200a65a5134, 31 29 ImplementationUUID=8e81b17f-7f74-4121-8f2f-a339a7e66447 -
trunk/WebCore/html/HTMLOptionsCollection.idl
r50001 r50037 1 1 /* 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 4 4 * … … 21 21 module html { 22 22 23 // FIXME: The W3C spec says that HTMLOptionsCollection should not have a parent class.24 23 interface [ 25 GenerateNativeConverter, 24 GenerateConstructor, 25 HasIndexGetter, 26 26 HasCustomIndexSetter, 27 HasNameGetter, 28 CustomCall, 27 29 InterfaceUUID=a03aaeac-e47d-4bb3-acb4-f1897ae74237, 28 30 ImplementationUUID=99c11fde-6f9f-44a4-a041-49a894c52e70 29 ] HTMLOptionsCollection : HTMLCollection { 30 attribute long selectedIndex; 31 attribute [Custom] unsigned long length 31 ] HTMLOptionsCollection { 32 attribute [CustomSetter] unsigned long length 32 33 setter raises (DOMException); 34 [Custom] Node item(in unsigned long index); 35 [Custom] Node namedItem(in DOMString name); 33 36 34 37 [Custom] void add(in HTMLOptionElement option, in [Optional] unsigned long index) … … 36 39 [Custom] void remove(in unsigned long index); 37 40 38 #if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT 39 Node item(in unsigned long index); 40 Node namedItem(in DOMString name); 41 #endif 41 // Extension 42 attribute long selectedIndex; 42 43 }; 43 44
Note: See TracChangeset
for help on using the changeset viewer.