webengine/osswebengine/DerivedSources/WebCore/JSHTMLDivElement.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 "JSHTMLDivElement.h"
       
    24 
       
    25 #include <wtf/GetPtr.h>
       
    26 
       
    27 #include "HTMLDivElement.h"
       
    28 #include "PlatformString.h"
       
    29 
       
    30 using namespace KJS;
       
    31 
       
    32 namespace WebCore {
       
    33 
       
    34 /* Hash table */
       
    35 
       
    36 static const HashEntry JSHTMLDivElementTableEntries[] =
       
    37 {
       
    38     { 0, 0, 0, 0, 0 },
       
    39     { "align", JSHTMLDivElement::AlignAttrNum, DontDelete, 0, &JSHTMLDivElementTableEntries[2] },
       
    40     { "constructor", JSHTMLDivElement::ConstructorAttrNum, DontDelete|DontEnum|ReadOnly, 0, 0 }
       
    41 };
       
    42 
       
    43 static const HashTable JSHTMLDivElementTable = 
       
    44 {
       
    45     2, 3, JSHTMLDivElementTableEntries, 2
       
    46 };
       
    47 
       
    48 /* Hash table for constructor */
       
    49 
       
    50 static const HashEntry JSHTMLDivElementConstructorTableEntries[] =
       
    51 {
       
    52     { 0, 0, 0, 0, 0 }
       
    53 };
       
    54 
       
    55 static const HashTable JSHTMLDivElementConstructorTable = 
       
    56 {
       
    57     2, 1, JSHTMLDivElementConstructorTableEntries, 1
       
    58 };
       
    59 
       
    60 class JSHTMLDivElementConstructor : public DOMObject {
       
    61 public:
       
    62     JSHTMLDivElementConstructor(ExecState* exec)
       
    63     {
       
    64         setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
       
    65         putDirect(exec->propertyNames().prototype, JSHTMLDivElementPrototype::self(exec), None);
       
    66     }
       
    67     virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
       
    68     JSValue* getValueProperty(ExecState*, int token) const;
       
    69     virtual const ClassInfo* classInfo() const { return &info; }
       
    70     static const ClassInfo info;
       
    71 
       
    72     virtual bool implementsHasInstance() const { return true; }
       
    73 };
       
    74 
       
    75 const ClassInfo JSHTMLDivElementConstructor::info = { "HTMLDivElementConstructor", 0, &JSHTMLDivElementConstructorTable, 0 };
       
    76 
       
    77 bool JSHTMLDivElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    78 {
       
    79     return getStaticValueSlot<JSHTMLDivElementConstructor, DOMObject>(exec, &JSHTMLDivElementConstructorTable, this, propertyName, slot);
       
    80 }
       
    81 
       
    82 JSValue* JSHTMLDivElementConstructor::getValueProperty(ExecState*, int token) const
       
    83 {
       
    84     // The token is the numeric value of its associated constant
       
    85     return jsNumber(token);
       
    86 }
       
    87 
       
    88 /* Hash table for prototype */
       
    89 
       
    90 static const HashEntry JSHTMLDivElementPrototypeTableEntries[] =
       
    91 {
       
    92     { 0, 0, 0, 0, 0 }
       
    93 };
       
    94 
       
    95 static const HashTable JSHTMLDivElementPrototypeTable = 
       
    96 {
       
    97     2, 1, JSHTMLDivElementPrototypeTableEntries, 1
       
    98 };
       
    99 
       
   100 const ClassInfo JSHTMLDivElementPrototype::info = { "HTMLDivElementPrototype", 0, &JSHTMLDivElementPrototypeTable, 0 };
       
   101 
       
   102 JSObject* JSHTMLDivElementPrototype::self(ExecState* exec)
       
   103 {
       
   104     return KJS::cacheGlobalObject<JSHTMLDivElementPrototype>(exec, "[[JSHTMLDivElement.prototype]]");
       
   105 }
       
   106 
       
   107 const ClassInfo JSHTMLDivElement::info = { "HTMLDivElement", &JSHTMLElement::info, &JSHTMLDivElementTable, 0 };
       
   108 
       
   109 JSHTMLDivElement::JSHTMLDivElement(ExecState* exec, HTMLDivElement* impl)
       
   110     : JSHTMLElement(exec, impl)
       
   111 {
       
   112     setPrototype(JSHTMLDivElementPrototype::self(exec));
       
   113 }
       
   114 
       
   115 bool JSHTMLDivElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   116 {
       
   117     return getStaticValueSlot<JSHTMLDivElement, JSHTMLElement>(exec, &JSHTMLDivElementTable, this, propertyName, slot);
       
   118 }
       
   119 
       
   120 JSValue* JSHTMLDivElement::getValueProperty(ExecState* exec, int token) const
       
   121 {
       
   122     switch (token) {
       
   123     case AlignAttrNum: {
       
   124         HTMLDivElement* imp = static_cast<HTMLDivElement*>(impl());
       
   125 
       
   126         return jsString(imp->align());
       
   127     }
       
   128     case ConstructorAttrNum:
       
   129         return getConstructor(exec);
       
   130     }
       
   131     return 0;
       
   132 }
       
   133 
       
   134 void JSHTMLDivElement::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
       
   135 {
       
   136     lookupPut<JSHTMLDivElement, JSHTMLElement>(exec, propertyName, value, attr, &JSHTMLDivElementTable, this);
       
   137 }
       
   138 
       
   139 void JSHTMLDivElement::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
       
   140 {
       
   141     switch (token) {
       
   142     case AlignAttrNum: {
       
   143         HTMLDivElement* imp = static_cast<HTMLDivElement*>(impl());
       
   144 
       
   145         imp->setAlign(valueToStringWithNullCheck(exec, value));
       
   146         break;
       
   147     }
       
   148     }
       
   149 }
       
   150 
       
   151 JSValue* JSHTMLDivElement::getConstructor(ExecState* exec)
       
   152 {
       
   153     return KJS::cacheGlobalObject<JSHTMLDivElementConstructor>(exec, "[[HTMLDivElement.constructor]]");
       
   154 }
       
   155 
       
   156 }