Changeset 50087 in webkit


Ignore:
Timestamp:
Oct 26, 2009 1:04:22 PM (14 years ago)
Author:
weinig@apple.com
Message:

Rubber-stamped by Darin Adler.

Rollout r50041-50043. The HTML5 spec changed to make HTMLOptionsCollection
inherit from HTMLCollection.

WebCore:

  • GNUmakefile.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSHTMLAllCollectionCustom.cpp:

(WebCore::getNamedItems):
(WebCore::callHTMLAllCollection):
(WebCore::JSHTMLAllCollection::nameGetter):
(WebCore::JSHTMLAllCollection::item):
(WebCore::JSHTMLAllCollection::namedItem):

  • bindings/js/JSHTMLCollectionCustom.cpp:

(WebCore::getNamedItems):
(WebCore::callHTMLCollection):
(WebCore::JSHTMLCollection::nameGetter):
(WebCore::JSHTMLCollection::item):
(WebCore::JSHTMLCollection::namedItem):
(WebCore::toJS):

  • bindings/js/JSHTMLCollectionFunctions.h: Removed.
  • bindings/js/JSHTMLDocumentCustom.cpp:
  • bindings/js/JSHTMLOptionsCollectionCustom.cpp:

(WebCore::JSHTMLOptionsCollection::length):
(WebCore::JSHTMLOptionsCollection::indexSetter):

  • bindings/objc/DOMHTML.mm:

(kitClass):

  • bindings/objc/DOMUtility.mm:

(JSC::createDOMWrapper):

  • bindings/scripts/CodeGeneratorJS.pm:
  • html/HTMLCollection.idl:
  • html/HTMLOptionsCollection.idl:

WebKit/win:

  • DOMCreateInstance.cpp:

LayoutTests:

  • fast/dom/wrapper-classes-expected.txt:
Location:
trunk
Files:
1 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r50083 r50087  
     12009-10-26  Sam Weinig  <sam@webkit.org>
     2
     3        Rubber-stamped by Darin Adler.
     4
     5        Rollout r50041-50043.  The HTML5 spec changed to make HTMLOptionsCollection
     6        inherit from HTMLCollection.
     7
     8        * fast/dom/wrapper-classes-expected.txt:
     9
    1102009-10-26  Rahul Kuchhal  <kuchhal@chromium.org>
    211
  • trunk/LayoutTests/fast/dom/wrapper-classes-expected.txt

    r50041 r50087  
    142142PASS jsWrapperClass(document.constructor) is 'HTMLDocumentConstructor'
    143143PASS 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'
     144FAIL jsWrapperClass(document.createElement('select').options.__proto__) should be HTMLOptionsCollectionPrototype. Was HTMLCollectionPrototype.
     145FAIL jsWrapperClass(document.createElement('select').options.constructor) should be HTMLOptionsCollectionConstructor. Was Function.
    146146
    147147HTML Elements
  • trunk/WebCore/ChangeLog

    r50085 r50087  
     12009-10-26  Sam Weinig  <sam@webkit.org>
     2
     3        Rubber-stamped by Darin Adler.
     4
     5        Rollout r50041-50043.  The HTML5 spec changed to make HTMLOptionsCollection
     6        inherit from HTMLCollection.
     7
     8        * GNUmakefile.am:
     9        * WebCore.gypi:
     10        * WebCore.pro:
     11        * WebCore.vcproj/WebCore.vcproj:
     12        * WebCore.xcodeproj/project.pbxproj:
     13        * bindings/js/JSHTMLAllCollectionCustom.cpp:
     14        (WebCore::getNamedItems):
     15        (WebCore::callHTMLAllCollection):
     16        (WebCore::JSHTMLAllCollection::nameGetter):
     17        (WebCore::JSHTMLAllCollection::item):
     18        (WebCore::JSHTMLAllCollection::namedItem):
     19        * bindings/js/JSHTMLCollectionCustom.cpp:
     20        (WebCore::getNamedItems):
     21        (WebCore::callHTMLCollection):
     22        (WebCore::JSHTMLCollection::nameGetter):
     23        (WebCore::JSHTMLCollection::item):
     24        (WebCore::JSHTMLCollection::namedItem):
     25        (WebCore::toJS):
     26        * bindings/js/JSHTMLCollectionFunctions.h: Removed.
     27        * bindings/js/JSHTMLDocumentCustom.cpp:
     28        * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
     29        (WebCore::JSHTMLOptionsCollection::length):
     30        (WebCore::JSHTMLOptionsCollection::indexSetter):
     31        * bindings/objc/DOMHTML.mm:
     32        (kitClass):
     33        * bindings/objc/DOMUtility.mm:
     34        (JSC::createDOMWrapper):
     35        * bindings/scripts/CodeGeneratorJS.pm:
     36        * html/HTMLCollection.idl:
     37        * html/HTMLOptionsCollection.idl:
     38
    1392009-10-26  Brent Fulgham  <bfulgham@webkit.org>
    240
  • trunk/WebCore/GNUmakefile.am

    r50075 r50087  
    377377        WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp \
    378378        WebCore/bindings/js/JSHTMLCollectionCustom.cpp \
    379         WebCore/bindings/js/JSHTMLCollectionFunctions.h \
    380379        WebCore/bindings/js/JSHTMLDataGridElementCustom.cpp \
    381380        WebCore/bindings/js/JSHTMLDocumentCustom.cpp \
  • trunk/WebCore/WebCore.gypi

    r50082 r50087  
    499499            'bindings/js/JSHTMLCanvasElementCustom.cpp',
    500500            'bindings/js/JSHTMLCollectionCustom.cpp',
    501             'bindings/js/JSHTMLCollectionFunctions.h',
    502501            'bindings/js/JSHTMLDataGridElementCustom.cpp',
    503502            'bindings/js/JSHTMLDocumentCustom.cpp',
  • trunk/WebCore/WebCore.pro

    r50041 r50087  
    710710    bindings/js/JSHTMLAllCollectionCustom.cpp \
    711711    bindings/js/JSHTMLCollectionCustom.cpp \
    712     bindings/js/JSHTMLCollectionFunctions.h \
    713712    bindings/js/JSHTMLDataGridElementCustom.cpp \
    714713    bindings/js/JSHTMLDocumentCustom.cpp \
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r50085 r50087  
    3401534015                                </File>
    3401634016                                <File
    34017                                         RelativePath="..\bindings\js\JSHTMLCollectionFunctions.h"
    34018                                         >
    34019                                 </File>
    34020                                 <File
    3402134017                                        RelativePath="..\bindings\js\JSHTMLDataGridElementCustom.cpp"
    3402234018                                        >
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r50041 r50087  
    43294329                BC97E413109154FA0010D361 /* JSHTMLAllCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = BC97E411109154FA0010D361 /* JSHTMLAllCollection.h */; };
    43304330                BC97E42C10915B060010D361 /* JSHTMLAllCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC97E42B10915B060010D361 /* JSHTMLAllCollectionCustom.cpp */; };
    4331                 BC97E53F10926C870010D361 /* JSHTMLCollectionFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = BC97E53E10926C870010D361 /* JSHTMLCollectionFunctions.h */; };
    43324331                BC98543D0CD3D98B00069BC1 /* JSConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */; };
    43334332                BC98543E0CD3D98C00069BC1 /* JSConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = BC98543C0CD3D98B00069BC1 /* JSConsole.h */; };
     
    94639462                BC97E411109154FA0010D361 /* JSHTMLAllCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLAllCollection.h; sourceTree = "<group>"; };
    94649463                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>"; };
    94669464                BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSConsole.cpp; sourceTree = "<group>"; };
    94679465                BC98543C0CD3D98B00069BC1 /* JSConsole.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSConsole.h; sourceTree = "<group>"; };
     
    1427314271                                3314ACE910892086000F0E56 /* JSExceptionBase.cpp */,
    1427414272                                3314ACEA10892086000F0E56 /* JSExceptionBase.h */,
    14275                                 BC97E53E10926C870010D361 /* JSHTMLCollectionFunctions.h */,
    1427614273                                C09158840DB4209200E55AF4 /* JSInspectedObjectWrapper.cpp */,
    1427714274                                C09158850DB4209200E55AF4 /* JSInspectedObjectWrapper.h */,
     
    1807218069                                BC97E23A109144950010D361 /* HTMLAllCollection.h in Headers */,
    1807318070                                BC97E413109154FA0010D361 /* JSHTMLAllCollection.h in Headers */,
    18074                                 BC97E53F10926C870010D361 /* JSHTMLCollectionFunctions.h in Headers */,
    1807518071                        );
    1807618072                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp

    r50041 r50087  
    3131#include "JSDOMBinding.h"
    3232#include "JSHTMLAllCollection.h"
    33 #include "JSHTMLCollectionFunctions.h"
    3433#include "JSNode.h"
    3534#include "JSNodeList.h"
    3635#include "Node.h"
     36#include "StaticNodeList.h"
     37#include <wtf/Vector.h>
    3738
    3839using namespace JSC;
     
    4041namespace WebCore {
    4142
     43static 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.
    4261static JSValue JSC_HOST_CALL callHTMLAllCollection(ExecState* exec, JSObject* function, JSValue, const ArgList& args)
    4362{
    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 = static_cast<HTMLAllCollection*>(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();
    45100}
    46101
     
    61116{
    62117    JSHTMLAllCollection* thisObj = static_cast<JSHTMLAllCollection*>(asObject(slot.slotBase()));
    63     return getCollectionNamedItems<JSHTMLAllCollection>(exec, thisObj, propertyName);
     118    return getNamedItems(exec, thisObj, propertyName);
    64119}
    65120
    66121JSValue JSHTMLAllCollection::item(ExecState* exec, const ArgList& args)
    67122{
    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)));
    69128}
    70129
    71130JSValue JSHTMLAllCollection::namedItem(ExecState* exec, const ArgList& args)
    72131{
    73     return getCollectionNamedItems<JSHTMLAllCollection>(exec, this, Identifier(exec, args.at(0).toString(exec)));
     132    return getNamedItems(exec, this, Identifier(exec, args.at(0).toString(exec)));
    74133}
    75134
  • trunk/WebCore/bindings/js/JSHTMLCollectionCustom.cpp

    r50041 r50087  
    2222
    2323#include "AtomicString.h"
    24 #include "HTMLAllCollection.h"
    2524#include "HTMLCollection.h"
    2625#include "HTMLOptionsCollection.h"
     26#include "HTMLAllCollection.h"
    2727#include "JSDOMBinding.h"
    2828#include "JSHTMLAllCollection.h"
    29 #include "JSHTMLCollectionFunctions.h"
    3029#include "JSHTMLOptionsCollection.h"
    3130#include "JSNode.h"
     
    3938namespace WebCore {
    4039
     40static 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.
    4158static JSValue JSC_HOST_CALL callHTMLCollection(ExecState* exec, JSObject* function, JSValue, const ArgList& args)
    4259{
    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();
    4497}
    4598
     
    60113{
    61114    JSHTMLCollection* thisObj = static_cast<JSHTMLCollection*>(asObject(slot.slotBase()));
    62     return getCollectionNamedItems<JSHTMLCollection>(exec, thisObj, propertyName);
     115    return getNamedItems(exec, thisObj, propertyName);
    63116}
    64117
    65118JSValue JSHTMLCollection::item(ExecState* exec, const ArgList& args)
    66119{
    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)));
    68125}
    69126
    70127JSValue JSHTMLCollection::namedItem(ExecState* exec, const ArgList& args)
    71128{
    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
     132JSValue 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;
    73155}
    74156
  • trunk/WebCore/bindings/js/JSHTMLDocumentCustom.cpp

    r50041 r50087  
    3939#include "JSDOMWindowCustom.h"
    4040#include "JSDOMWindowShell.h"
    41 #include "JSHTMLAllCollection.h"
    4241#include "JSHTMLCollection.h"
    4342#include "SegmentedString.h"
  • trunk/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp

    r50041 r50087  
    2626#include "HTMLOptionsCollection.h"
    2727#include "HTMLSelectElement.h"
    28 #include "JSHTMLCollection.h"
    29 #include "JSHTMLCollectionFunctions.h"
    3028#include "JSHTMLOptionElement.h"
    3129#include "JSHTMLSelectElement.h"
    3230#include "JSHTMLSelectElementCustom.h"
     31
    3332#include <wtf/MathExtras.h>
    3433
     
    3736namespace WebCore {
    3837
    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)
     38JSValue JSHTMLOptionsCollection::length(ExecState* exec) const
    6439{
    6540    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());
    7842}
    7943
     
    9559        imp->setLength(newLength, ec);
    9660    setDOMException(exec, ec);
     61}
     62
     63void 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);
    9768}
    9869
     
    12596}
    12697
    127 } // namespace WebCore
     98}
  • trunk/WebCore/bindings/objc/DOMHTML.mm

    r50041 r50087  
    2929#import "DOMDocumentFragmentInternal.h"
    3030#import "DOMExtensions.h"
     31#import "DOMHTMLCollectionInternal.h"
    3132#import "DOMHTMLDocumentInternal.h"
    3233#import "DOMHTMLInputElementInternal.h"
     
    3738#import "DocumentFragment.h"
    3839#import "FrameView.h"
     40#import "HTMLCollection.h"
    3941#import "HTMLDocument.h"
    4042#import "HTMLInputElement.h"
     
    180182
    181183@end
     184
     185Class 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

    r50041 r50087  
    3535#import "DOMEventInternal.h"
    3636#import "DOMHTMLCollectionInternal.h"
    37 #import "DOMHTMLOptionsCollectionInternal.h"
    3837#import "DOMImplementationFront.h"
    3938#import "DOMInternal.h"
     
    107106    WRAP(Counter)
    108107    WRAP(Event)
    109     WRAP(HTMLCollection)
    110108    WRAP(HTMLOptionsCollection)
    111109    WRAP(MediaList)
     
    120118    WRAP(StyleSheetList)
    121119    WRAP(TreeWalker)
    122     WRAP(DOMWindowShell)
    123120#if ENABLE(XPATH)
    124121    WRAP(XPathExpression)
     
    126123#endif
    127124
     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
    128129    #undef WRAP
     130
     131    if (object->inherits(&WebCore::JSDOMWindowShell::s_info))
     132        return kit(static_cast<WebCore::JSDOMWindowShell*>(object)->impl());
    129133
    130134    if (object->inherits(&WebCore::JSDOMImplementation::s_info))
  • trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r50041 r50087  
    17091709        }
    17101710        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") {
    17121712            $implIncludes{"JSNode.h"} = 1;
    17131713            $implIncludes{"Node.h"} = 1;
     
    17201720        push(@implContent, "    return jsNumber(exec, static_cast<$implClassName*>(impl())->item(index));\n");
    17211721        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") {
    17231723            $implIncludes{"JSNode.h"} = 1;
    17241724            $implIncludes{"Node.h"} = 1;
  • trunk/WebCore/html/HTMLCollection.idl

    r50041 r50087  
    2626        HasNameGetter,
    2727        CustomCall,
     28        CustomToJS,
     29        Polymorphic,
    2830        InterfaceUUID=b0d215ff-6f9c-4d1f-86c3-f200a65a5134,
    2931        ImplementationUUID=8e81b17f-7f74-4121-8f2f-a339a7e66447
  • trunk/WebCore/html/HTMLOptionsCollection.idl

    r50041 r50087  
    11/*
    2  * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
    44 *
     
    2121module html {
    2222
     23    // FIXME: The W3C spec says that HTMLOptionsCollection should not have a parent class.
    2324    interface [
    24         GenerateConstructor,
    25         HasIndexGetter,
     25        GenerateNativeConverter,
    2626        HasCustomIndexSetter,
    27         HasNameGetter,
    28         CustomCall,
    2927        InterfaceUUID=a03aaeac-e47d-4bb3-acb4-f1897ae74237,
    3028        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
    3332                        setter raises (DOMException);
    34         [Custom] Node item(in unsigned long index);
    35         [Custom] Node namedItem(in DOMString name);
    3633
    3734        [Custom] void add(in HTMLOptionElement option, in [Optional] unsigned long index)
    3835             raises (DOMException);
    3936        [Custom] void remove(in unsigned long index);
    40 
    41         // Extension
    42                  attribute long selectedIndex;
    4337    };
    4438
  • trunk/WebKit/win/ChangeLog

    r50045 r50087  
     12009-10-26  Sam Weinig  <sam@webkit.org>
     2
     3        Rubber-stamped by Darin Adler.
     4
     5        Rollout r50041-50043.  The HTML5 spec changed to make HTMLOptionsCollection
     6        inherit from HTMLCollection.
     7
     8        * DOMCreateInstance.cpp:
     9
    1102009-10-25  Dan Bernstein  <mitz@apple.com>
    211
  • trunk/WebKit/win/DOMCreateInstance.cpp

    r50043 r50087  
    4646#include "GEN_DOMHTMLDocument.h"
    4747#include "GEN_DOMHTMLCollection.h"
    48 #include "GEN_DOMHTMLOptionsCollection.h"
    4948#include "GEN_DOMDocumentType.h"
    5049#include "GEN_DOMDocumentFragment.h"
     
    9291#include <WebCore/HTMLElement.h>
    9392#include <WebCore/HTMLCollection.h>
    94 #include <WebCore/HTMLOptionsCollection.h>
    9593#include <WebCore/DocumentType.h>
    9694#include <WebCore/DocumentFragment.h>
     
    358356
    359357CREATE_ONLY_SELF(HTMLCollection)
    360 CREATE_ONLY_SELF(HTMLOptionsCollection)
Note: See TracChangeset for help on using the changeset viewer.