webengine/osswebengine/DerivedSources/WebCore/JSHTMLIsIndexElement.cpp
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2     This file is part of the WebKit open source project.
       
     3     This file has been generated by generate-bindings.pl. DO NOT MODIFY!
       
     4 
       
     5     This library is free software; you can redistribute it and/or
       
     6     modify it under the terms of the GNU Library General Public
       
     7     License as published by the Free Software Foundation; either
       
     8     version 2 of the License, or (at your option) any later version.
       
     9 
       
    10     This library is distributed in the hope that it will be useful,
       
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    13     Library General Public License for more details.
       
    14 
       
    15     You should have received a copy of the GNU Library General Public License
       
    16     along with this library; see the file COPYING.LIB.  If not, write to
       
    17     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
       
    18     Boston, MA 02110-1301, USA.
       
    19 */
       
    20 
       
    21 #include "config.h"
       
    22 
       
    23 #include "JSHTMLIsIndexElement.h"
       
    24 
       
    25 #include <wtf/GetPtr.h>
       
    26 
       
    27 #include "HTMLFormElement.h"
       
    28 #include "HTMLIsIndexElement.h"
       
    29 #include "JSHTMLFormElement.h"
       
    30 #include "PlatformString.h"
       
    31 
       
    32 using namespace KJS;
       
    33 
       
    34 namespace WebCore {
       
    35 
       
    36 /* Hash table */
       
    37 
       
    38 static const HashEntry JSHTMLIsIndexElementTableEntries[] =
       
    39 {
       
    40     { "constructor", JSHTMLIsIndexElement::ConstructorAttrNum, DontDelete|DontEnum|ReadOnly, 0, 0 },
       
    41     { 0, 0, 0, 0, 0 },
       
    42     { "form", JSHTMLIsIndexElement::FormAttrNum, DontDelete|ReadOnly, 0, &JSHTMLIsIndexElementTableEntries[3] },
       
    43     { "prompt", JSHTMLIsIndexElement::PromptAttrNum, DontDelete, 0, 0 }
       
    44 };
       
    45 
       
    46 static const HashTable JSHTMLIsIndexElementTable = 
       
    47 {
       
    48     2, 4, JSHTMLIsIndexElementTableEntries, 3
       
    49 };
       
    50 
       
    51 /* Hash table for constructor */
       
    52 
       
    53 static const HashEntry JSHTMLIsIndexElementConstructorTableEntries[] =
       
    54 {
       
    55     { 0, 0, 0, 0, 0 }
       
    56 };
       
    57 
       
    58 static const HashTable JSHTMLIsIndexElementConstructorTable = 
       
    59 {
       
    60     2, 1, JSHTMLIsIndexElementConstructorTableEntries, 1
       
    61 };
       
    62 
       
    63 class JSHTMLIsIndexElementConstructor : public DOMObject {
       
    64 public:
       
    65     JSHTMLIsIndexElementConstructor(ExecState* exec)
       
    66     {
       
    67         setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
       
    68         putDirect(exec->propertyNames().prototype, JSHTMLIsIndexElementPrototype::self(exec), None);
       
    69     }
       
    70     virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
       
    71     JSValue* getValueProperty(ExecState*, int token) const;
       
    72     virtual const ClassInfo* classInfo() const { return &info; }
       
    73     static const ClassInfo info;
       
    74 
       
    75     virtual bool implementsHasInstance() const { return true; }
       
    76 };
       
    77 
       
    78 const ClassInfo JSHTMLIsIndexElementConstructor::info = { "HTMLIsIndexElementConstructor", 0, &JSHTMLIsIndexElementConstructorTable, 0 };
       
    79 
       
    80 bool JSHTMLIsIndexElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    81 {
       
    82     return getStaticValueSlot<JSHTMLIsIndexElementConstructor, DOMObject>(exec, &JSHTMLIsIndexElementConstructorTable, this, propertyName, slot);
       
    83 }
       
    84 
       
    85 JSValue* JSHTMLIsIndexElementConstructor::getValueProperty(ExecState*, int token) const
       
    86 {
       
    87     // The token is the numeric value of its associated constant
       
    88     return jsNumber(token);
       
    89 }
       
    90 
       
    91 /* Hash table for prototype */
       
    92 
       
    93 static const HashEntry JSHTMLIsIndexElementPrototypeTableEntries[] =
       
    94 {
       
    95     { 0, 0, 0, 0, 0 }
       
    96 };
       
    97 
       
    98 static const HashTable JSHTMLIsIndexElementPrototypeTable = 
       
    99 {
       
   100     2, 1, JSHTMLIsIndexElementPrototypeTableEntries, 1
       
   101 };
       
   102 
       
   103 const ClassInfo JSHTMLIsIndexElementPrototype::info = { "HTMLIsIndexElementPrototype", 0, &JSHTMLIsIndexElementPrototypeTable, 0 };
       
   104 
       
   105 JSObject* JSHTMLIsIndexElementPrototype::self(ExecState* exec)
       
   106 {
       
   107     return KJS::cacheGlobalObject<JSHTMLIsIndexElementPrototype>(exec, "[[JSHTMLIsIndexElement.prototype]]");
       
   108 }
       
   109 
       
   110 const ClassInfo JSHTMLIsIndexElement::info = { "HTMLIsIndexElement", &JSHTMLInputElement::info, &JSHTMLIsIndexElementTable, 0 };
       
   111 
       
   112 JSHTMLIsIndexElement::JSHTMLIsIndexElement(ExecState* exec, HTMLIsIndexElement* impl)
       
   113     : JSHTMLInputElement(exec, impl)
       
   114 {
       
   115     setPrototype(JSHTMLIsIndexElementPrototype::self(exec));
       
   116 }
       
   117 
       
   118 bool JSHTMLIsIndexElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   119 {
       
   120     return getStaticValueSlot<JSHTMLIsIndexElement, JSHTMLInputElement>(exec, &JSHTMLIsIndexElementTable, this, propertyName, slot);
       
   121 }
       
   122 
       
   123 JSValue* JSHTMLIsIndexElement::getValueProperty(ExecState* exec, int token) const
       
   124 {
       
   125     switch (token) {
       
   126     case FormAttrNum: {
       
   127         HTMLIsIndexElement* imp = static_cast<HTMLIsIndexElement*>(impl());
       
   128 
       
   129         return toJS(exec, WTF::getPtr(imp->form()));
       
   130     }
       
   131     case PromptAttrNum: {
       
   132         HTMLIsIndexElement* imp = static_cast<HTMLIsIndexElement*>(impl());
       
   133 
       
   134         return jsString(imp->prompt());
       
   135     }
       
   136     case ConstructorAttrNum:
       
   137         return getConstructor(exec);
       
   138     }
       
   139     return 0;
       
   140 }
       
   141 
       
   142 void JSHTMLIsIndexElement::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
       
   143 {
       
   144     lookupPut<JSHTMLIsIndexElement, JSHTMLInputElement>(exec, propertyName, value, attr, &JSHTMLIsIndexElementTable, this);
       
   145 }
       
   146 
       
   147 void JSHTMLIsIndexElement::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
       
   148 {
       
   149     switch (token) {
       
   150     case PromptAttrNum: {
       
   151         HTMLIsIndexElement* imp = static_cast<HTMLIsIndexElement*>(impl());
       
   152 
       
   153         imp->setPrompt(valueToStringWithNullCheck(exec, value));
       
   154         break;
       
   155     }
       
   156     }
       
   157 }
       
   158 
       
   159 JSValue* JSHTMLIsIndexElement::getConstructor(ExecState* exec)
       
   160 {
       
   161     return KJS::cacheGlobalObject<JSHTMLIsIndexElementConstructor>(exec, "[[HTMLIsIndexElement.constructor]]");
       
   162 }
       
   163 
       
   164 }