Changeset 50040 in webkit
- Timestamp:
- Oct 25, 2009 12:08:03 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r50037 r50040 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=307516 HTMLOptionsCollection should not inherit from HTMLCollection7 8 * fast/dom/wrapper-classes-expected.txt:9 10 1 2009-10-24 Dan Bernstein <mitz@apple.com> 11 2 -
trunk/LayoutTests/fast/dom/wrapper-classes-expected.txt
r50037 r50040 142 142 PASS jsWrapperClass(document.constructor) is 'HTMLDocumentConstructor' 143 143 PASS jsWrapperClass(document.createElement('select').options) is 'HTMLOptionsCollection' 144 PASS jsWrapperClass(document.createElement('select').options.__proto__) is 'HTMLOptionsCollectionPrototype' 145 PASS jsWrapperClass(document.createElement('select').options.constructor) is 'HTMLOptionsCollectionConstructor' 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. 146 146 147 147 HTML Elements -
trunk/WebCore/ChangeLog
r50039 r50040 36 36 (WebInspector.ResourcesPanel.prototype.filter): 37 37 (WebInspector.ResourcesPanel.prototype._updateFilter): 38 39 2009-10-24 Sam Weinig <sam@webkit.org>40 41 Reviewed by Dan Bernstein.42 43 Fix for https://bugs.webkit.org/show_bug.cgi?id=3075144 HTMLOptionsCollection should not inherit from HTMLCollection45 46 * GNUmakefile.am:47 * WebCore.gypi:48 * WebCore.pro:49 * WebCore.vcproj/WebCore.vcproj:50 * WebCore.xcodeproj/project.pbxproj:51 Added JSHTMLCollectionFunctions.h52 53 * bindings/js/JSHTMLAllCollectionCustom.cpp:54 (WebCore::callHTMLAllCollection):55 (WebCore::JSHTMLAllCollection::nameGetter):56 (WebCore::JSHTMLAllCollection::item):57 (WebCore::JSHTMLAllCollection::namedItem):58 * bindings/js/JSHTMLCollectionCustom.cpp:59 (WebCore::callHTMLCollection):60 (WebCore::JSHTMLCollection::nameGetter):61 (WebCore::JSHTMLCollection::item):62 (WebCore::JSHTMLCollection::namedItem):63 * bindings/js/JSHTMLOptionsCollectionCustom.cpp:64 (WebCore::callHTMLCollection):65 (WebCore::JSHTMLOptionsCollection::getCallData):66 (WebCore::JSHTMLOptionsCollection::canGetItemsForName):67 (WebCore::JSHTMLOptionsCollection::nameGetter):68 (WebCore::JSHTMLOptionsCollection::indexSetter):69 (WebCore::JSHTMLOptionsCollection::item):70 (WebCore::JSHTMLOptionsCollection::namedItem):71 Refactor to use generic implementation of HTMLCollection bindings functions72 from JSHTMLCollectionFunctions.h73 74 * bindings/js/JSHTMLCollectionFunctions.h: Added.75 (WebCore::getCollectionNamedItems):76 (WebCore::getCollectionItems):77 (WebCore::callHTMLCollectionGeneric):78 Added generic functions that JSHTMLCollection, JSHTMLAllCollection and79 JSHTMLOptionsCollection can all use.80 81 * bindings/js/JSHTMLDocumentCustom.cpp: Add include of JSHTMLAllCollection.h82 for toJS on document.all.83 84 * bindings/objc/DOMHTML.mm:85 * bindings/objc/DOMUtility.mm:86 (JSC::createDOMWrapper):87 Remove special cases for HTMLOptionsCollection.88 89 * bindings/scripts/CodeGeneratorJS.pm:90 * html/HTMLAllCollection.idl:91 * html/HTMLCollection.idl:92 * html/HTMLOptionsCollection.idl:93 38 94 39 2009-10-24 Timothy Hatcher <timothy@apple.com> -
trunk/WebCore/GNUmakefile.am
r50037 r50040 377 377 WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp \ 378 378 WebCore/bindings/js/JSHTMLCollectionCustom.cpp \ 379 WebCore/bindings/js/JSHTMLCollectionFunctions.h \380 379 WebCore/bindings/js/JSHTMLDataGridElementCustom.cpp \ 381 380 WebCore/bindings/js/JSHTMLDocumentCustom.cpp \ -
trunk/WebCore/WebCore.gypi
r50037 r50040 497 497 'bindings/js/JSHTMLCanvasElementCustom.cpp', 498 498 'bindings/js/JSHTMLCollectionCustom.cpp', 499 'bindings/js/JSHTMLCollectionFunctions.h',500 499 'bindings/js/JSHTMLDataGridElementCustom.cpp', 501 500 'bindings/js/JSHTMLDocumentCustom.cpp', -
trunk/WebCore/WebCore.pro
r50037 r50040 710 710 bindings/js/JSHTMLAllCollectionCustom.cpp \ 711 711 bindings/js/JSHTMLCollectionCustom.cpp \ 712 bindings/js/JSHTMLCollectionFunctions.h \713 712 bindings/js/JSHTMLDataGridElementCustom.cpp \ 714 713 bindings/js/JSHTMLDocumentCustom.cpp \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r50037 r50040 33939 33939 </File> 33940 33940 <File 33941 RelativePath="..\bindings\js\JSHTMLCollectionFunctions.h"33942 >33943 </File>33944 <File33945 33941 RelativePath="..\bindings\js\JSHTMLDataGridElementCustom.cpp" 33946 33942 > -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r50037 r50040 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 */; };4332 4331 BC98543D0CD3D98B00069BC1 /* JSConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */; }; 4333 4332 BC98543E0CD3D98C00069BC1 /* JSConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = BC98543C0CD3D98B00069BC1 /* JSConsole.h */; }; … … 9463 9462 BC97E411109154FA0010D361 /* JSHTMLAllCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLAllCollection.h; sourceTree = "<group>"; }; 9464 9463 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>"; };9466 9464 BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSConsole.cpp; sourceTree = "<group>"; }; 9467 9465 BC98543C0CD3D98B00069BC1 /* JSConsole.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSConsole.h; sourceTree = "<group>"; }; … … 14273 14271 3314ACE910892086000F0E56 /* JSExceptionBase.cpp */, 14274 14272 3314ACEA10892086000F0E56 /* JSExceptionBase.h */, 14275 BC97E53E10926C870010D361 /* JSHTMLCollectionFunctions.h */,14276 14273 C09158840DB4209200E55AF4 /* JSInspectedObjectWrapper.cpp */, 14277 14274 C09158850DB4209200E55AF4 /* JSInspectedObjectWrapper.h */, … … 18072 18069 BC97E23A109144950010D361 /* HTMLAllCollection.h in Headers */, 18073 18070 BC97E413109154FA0010D361 /* JSHTMLAllCollection.h in Headers */, 18074 BC97E53F10926C870010D361 /* JSHTMLCollectionFunctions.h in Headers */,18075 18071 ); 18076 18072 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
r50037 r50040 31 31 #include "JSDOMBinding.h" 32 32 #include "JSHTMLAllCollection.h" 33 #include "JSHTMLCollectionFunctions.h"34 33 #include "JSNode.h" 35 34 #include "JSNodeList.h" 36 35 #include "Node.h" 36 #include "StaticNodeList.h" 37 #include <wtf/Vector.h> 37 38 38 39 using namespace JSC; … … 40 41 namespace WebCore { 41 42 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 return 55 // 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. 42 61 static JSValue JSC_HOST_CALL callHTMLAllCollection(ExecState* exec, JSObject* function, JSValue, const ArgList& args) 43 62 { 44 return callHTMLCollectionGeneric<HTMLAllCollection, JSHTMLAllCollection>(exec, function, args); 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(); 45 100 } 46 101 … … 61 116 { 62 117 JSHTMLAllCollection* thisObj = static_cast<JSHTMLAllCollection*>(asObject(slot.slotBase())); 63 return get CollectionNamedItems<JSHTMLAllCollection>(exec, thisObj, propertyName);118 return getNamedItems(exec, thisObj, propertyName); 64 119 } 65 120 66 121 JSValue JSHTMLAllCollection::item(ExecState* exec, const ArgList& args) 67 122 { 68 return getCollectionItems<JSHTMLAllCollection>(exec, this, args.at(0)); 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))); 69 128 } 70 129 71 130 JSValue JSHTMLAllCollection::namedItem(ExecState* exec, const ArgList& args) 72 131 { 73 return get CollectionNamedItems<JSHTMLAllCollection>(exec, this, Identifier(exec, args.at(0).toString(exec)));132 return getNamedItems(exec, this, Identifier(exec, args.at(0).toString(exec))); 74 133 } 75 134 -
trunk/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
r50037 r50040 22 22 23 23 #include "AtomicString.h" 24 #include "HTMLAllCollection.h"25 24 #include "HTMLCollection.h" 26 25 #include "HTMLOptionsCollection.h" 26 #include "HTMLAllCollection.h" 27 27 #include "JSDOMBinding.h" 28 28 #include "JSHTMLAllCollection.h" 29 #include "JSHTMLCollectionFunctions.h"30 29 #include "JSHTMLOptionsCollection.h" 31 30 #include "JSNode.h" … … 39 38 namespace WebCore { 40 39 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 return 52 // 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. 41 58 static JSValue JSC_HOST_CALL callHTMLCollection(ExecState* exec, JSObject* function, JSValue, const ArgList& args) 42 59 { 43 return callHTMLCollectionGeneric<HTMLCollection, JSHTMLCollection>(exec, function, args); 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(); 44 97 } 45 98 … … 60 113 { 61 114 JSHTMLCollection* thisObj = static_cast<JSHTMLCollection*>(asObject(slot.slotBase())); 62 return get CollectionNamedItems<JSHTMLCollection>(exec, thisObj, propertyName);115 return getNamedItems(exec, thisObj, propertyName); 63 116 } 64 117 65 118 JSValue JSHTMLCollection::item(ExecState* exec, const ArgList& args) 66 119 { 67 return getCollectionItems<JSHTMLCollection>(exec, this, args.at(0)); 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))); 68 125 } 69 126 70 127 JSValue JSHTMLCollection::namedItem(ExecState* exec, const ArgList& args) 71 128 { 72 return getCollectionNamedItems<JSHTMLCollection>(exec, this, Identifier(exec, args.at(0).toString(exec))); 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; 73 155 } 74 156 -
trunk/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
r50037 r50040 39 39 #include "JSDOMWindowCustom.h" 40 40 #include "JSDOMWindowShell.h" 41 #include "JSHTMLAllCollection.h"42 41 #include "JSHTMLCollection.h" 43 42 #include "SegmentedString.h" -
trunk/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
r50037 r50040 26 26 #include "HTMLOptionsCollection.h" 27 27 #include "HTMLSelectElement.h" 28 #include "JSHTMLCollection.h"29 #include "JSHTMLCollectionFunctions.h"30 28 #include "JSHTMLOptionElement.h" 31 29 #include "JSHTMLSelectElement.h" 32 30 #include "JSHTMLSelectElementCustom.h" 31 33 32 #include <wtf/MathExtras.h> 34 33 … … 37 36 namespace WebCore { 38 37 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) 38 JSValue JSHTMLOptionsCollection::length(ExecState* exec) const 64 39 { 65 40 HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl()); 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))); 41 return jsNumber(exec, imp->length()); 78 42 } 79 43 … … 95 59 imp->setLength(newLength, ec); 96 60 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); 97 68 } 98 69 … … 125 96 } 126 97 127 } // namespace WebCore98 } -
trunk/WebCore/bindings/objc/DOMHTML.mm
r50037 r50040 29 29 #import "DOMDocumentFragmentInternal.h" 30 30 #import "DOMExtensions.h" 31 #import "DOMHTMLCollectionInternal.h" 31 32 #import "DOMHTMLDocumentInternal.h" 32 33 #import "DOMHTMLInputElementInternal.h" … … 37 38 #import "DocumentFragment.h" 38 39 #import "FrameView.h" 40 #import "HTMLCollection.h" 39 41 #import "HTMLDocument.h" 40 42 #import "HTMLInputElement.h" … … 180 182 181 183 @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
r50037 r50040 35 35 #import "DOMEventInternal.h" 36 36 #import "DOMHTMLCollectionInternal.h" 37 #import "DOMHTMLOptionsCollectionInternal.h"38 37 #import "DOMImplementationFront.h" 39 38 #import "DOMInternal.h" … … 107 106 WRAP(Counter) 108 107 WRAP(Event) 109 WRAP(HTMLCollection)110 108 WRAP(HTMLOptionsCollection) 111 109 WRAP(MediaList) … … 120 118 WRAP(StyleSheetList) 121 119 WRAP(TreeWalker) 122 WRAP(DOMWindowShell)123 120 #if ENABLE(XPATH) 124 121 WRAP(XPathExpression) … … 126 123 #endif 127 124 125 // This must be after the HTMLOptionsCollection check, because it's a subclass in the JavaScript 126 // binding, but not a subclass in the ObjC binding. 127 WRAP(HTMLCollection) 128 128 129 #undef WRAP 130 131 if (object->inherits(&WebCore::JSDOMWindowShell::s_info)) 132 return kit(static_cast<WebCore::JSDOMWindowShell*>(object)->impl()); 129 133 130 134 if (object->inherits(&WebCore::JSDOMImplementation::s_info)) -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r50037 r50040 1709 1709 } 1710 1710 push(@implContent, "}\n"); 1711 if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection" or $interfaceName eq "HTMLOptionsCollection") {1711 if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") { 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" or $interfaceName eq "HTMLOptionsCollection") {1722 if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") { 1723 1723 $implIncludes{"JSNode.h"} = 1; 1724 1724 $implIncludes{"Node.h"} = 1; -
trunk/WebCore/html/HTMLAllCollection.idl
r50037 r50040 31 31 HasNameGetter, 32 32 CustomCall, 33 CustomToJS, 33 34 MasqueradesAsUndefined 34 35 ] HTMLAllCollection { -
trunk/WebCore/html/HTMLCollection.idl
r50037 r50040 26 26 HasNameGetter, 27 27 CustomCall, 28 CustomToJS, 29 Polymorphic, 28 30 InterfaceUUID=b0d215ff-6f9c-4d1f-86c3-f200a65a5134, 29 31 ImplementationUUID=8e81b17f-7f74-4121-8f2f-a339a7e66447 -
trunk/WebCore/html/HTMLOptionsCollection.idl
r50037 r50040 1 1 /* 2 * Copyright (C) 2006, 2007 , 2009Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007 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. 23 24 interface [ 24 GenerateConstructor, 25 HasIndexGetter, 25 GenerateNativeConverter, 26 26 HasCustomIndexSetter, 27 HasNameGetter,28 CustomCall,29 27 InterfaceUUID=a03aaeac-e47d-4bb3-acb4-f1897ae74237, 30 28 ImplementationUUID=99c11fde-6f9f-44a4-a041-49a894c52e70 31 ] HTMLOptionsCollection { 32 attribute [CustomSetter] unsigned long length 29 ] HTMLOptionsCollection : HTMLCollection { 30 attribute long selectedIndex; 31 attribute [Custom] unsigned long length 33 32 setter raises (DOMException); 34 [Custom] Node item(in unsigned long index);35 [Custom] Node namedItem(in DOMString name);36 33 37 34 [Custom] void add(in HTMLOptionElement option, in [Optional] unsigned long index) … … 39 36 [Custom] void remove(in unsigned long index); 40 37 41 // Extension 42 attribute long selectedIndex; 38 #if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT 39 Node item(in unsigned long index); 40 Node namedItem(in DOMString name); 41 #endif 43 42 }; 44 43
Note: See TracChangeset
for help on using the changeset viewer.