|
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 "JSHTMLParamElement.h" |
|
24 |
|
25 #include <wtf/GetPtr.h> |
|
26 |
|
27 #include "HTMLParamElement.h" |
|
28 #include "PlatformString.h" |
|
29 |
|
30 using namespace KJS; |
|
31 |
|
32 namespace WebCore { |
|
33 |
|
34 /* Hash table */ |
|
35 |
|
36 static const HashEntry JSHTMLParamElementTableEntries[] = |
|
37 { |
|
38 { "name", JSHTMLParamElement::NameAttrNum, DontDelete, 0, 0 }, |
|
39 { "valueType", JSHTMLParamElement::ValueTypeAttrNum, DontDelete, 0, 0 }, |
|
40 { "value", JSHTMLParamElement::ValueAttrNum, DontDelete, 0, &JSHTMLParamElementTableEntries[5] }, |
|
41 { "type", JSHTMLParamElement::TypeAttrNum, DontDelete, 0, 0 }, |
|
42 { 0, 0, 0, 0, 0 }, |
|
43 { "constructor", JSHTMLParamElement::ConstructorAttrNum, DontDelete|DontEnum|ReadOnly, 0, 0 } |
|
44 }; |
|
45 |
|
46 static const HashTable JSHTMLParamElementTable = |
|
47 { |
|
48 2, 6, JSHTMLParamElementTableEntries, 5 |
|
49 }; |
|
50 |
|
51 /* Hash table for constructor */ |
|
52 |
|
53 static const HashEntry JSHTMLParamElementConstructorTableEntries[] = |
|
54 { |
|
55 { 0, 0, 0, 0, 0 } |
|
56 }; |
|
57 |
|
58 static const HashTable JSHTMLParamElementConstructorTable = |
|
59 { |
|
60 2, 1, JSHTMLParamElementConstructorTableEntries, 1 |
|
61 }; |
|
62 |
|
63 class JSHTMLParamElementConstructor : public DOMObject { |
|
64 public: |
|
65 JSHTMLParamElementConstructor(ExecState* exec) |
|
66 { |
|
67 setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype()); |
|
68 putDirect(exec->propertyNames().prototype, JSHTMLParamElementPrototype::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 JSHTMLParamElementConstructor::info = { "HTMLParamElementConstructor", 0, &JSHTMLParamElementConstructorTable, 0 }; |
|
79 |
|
80 bool JSHTMLParamElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
81 { |
|
82 return getStaticValueSlot<JSHTMLParamElementConstructor, DOMObject>(exec, &JSHTMLParamElementConstructorTable, this, propertyName, slot); |
|
83 } |
|
84 |
|
85 JSValue* JSHTMLParamElementConstructor::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 JSHTMLParamElementPrototypeTableEntries[] = |
|
94 { |
|
95 { 0, 0, 0, 0, 0 } |
|
96 }; |
|
97 |
|
98 static const HashTable JSHTMLParamElementPrototypeTable = |
|
99 { |
|
100 2, 1, JSHTMLParamElementPrototypeTableEntries, 1 |
|
101 }; |
|
102 |
|
103 const ClassInfo JSHTMLParamElementPrototype::info = { "HTMLParamElementPrototype", 0, &JSHTMLParamElementPrototypeTable, 0 }; |
|
104 |
|
105 JSObject* JSHTMLParamElementPrototype::self(ExecState* exec) |
|
106 { |
|
107 return KJS::cacheGlobalObject<JSHTMLParamElementPrototype>(exec, "[[JSHTMLParamElement.prototype]]"); |
|
108 } |
|
109 |
|
110 const ClassInfo JSHTMLParamElement::info = { "HTMLParamElement", &JSHTMLElement::info, &JSHTMLParamElementTable, 0 }; |
|
111 |
|
112 JSHTMLParamElement::JSHTMLParamElement(ExecState* exec, HTMLParamElement* impl) |
|
113 : JSHTMLElement(exec, impl) |
|
114 { |
|
115 setPrototype(JSHTMLParamElementPrototype::self(exec)); |
|
116 } |
|
117 |
|
118 bool JSHTMLParamElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
119 { |
|
120 return getStaticValueSlot<JSHTMLParamElement, JSHTMLElement>(exec, &JSHTMLParamElementTable, this, propertyName, slot); |
|
121 } |
|
122 |
|
123 JSValue* JSHTMLParamElement::getValueProperty(ExecState* exec, int token) const |
|
124 { |
|
125 switch (token) { |
|
126 case NameAttrNum: { |
|
127 HTMLParamElement* imp = static_cast<HTMLParamElement*>(impl()); |
|
128 |
|
129 return jsString(imp->name()); |
|
130 } |
|
131 case TypeAttrNum: { |
|
132 HTMLParamElement* imp = static_cast<HTMLParamElement*>(impl()); |
|
133 |
|
134 return jsString(imp->type()); |
|
135 } |
|
136 case ValueAttrNum: { |
|
137 HTMLParamElement* imp = static_cast<HTMLParamElement*>(impl()); |
|
138 |
|
139 return jsString(imp->value()); |
|
140 } |
|
141 case ValueTypeAttrNum: { |
|
142 HTMLParamElement* imp = static_cast<HTMLParamElement*>(impl()); |
|
143 |
|
144 return jsString(imp->valueType()); |
|
145 } |
|
146 case ConstructorAttrNum: |
|
147 return getConstructor(exec); |
|
148 } |
|
149 return 0; |
|
150 } |
|
151 |
|
152 void JSHTMLParamElement::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr) |
|
153 { |
|
154 lookupPut<JSHTMLParamElement, JSHTMLElement>(exec, propertyName, value, attr, &JSHTMLParamElementTable, this); |
|
155 } |
|
156 |
|
157 void JSHTMLParamElement::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/) |
|
158 { |
|
159 switch (token) { |
|
160 case NameAttrNum: { |
|
161 HTMLParamElement* imp = static_cast<HTMLParamElement*>(impl()); |
|
162 |
|
163 imp->setName(valueToStringWithNullCheck(exec, value)); |
|
164 break; |
|
165 } |
|
166 case TypeAttrNum: { |
|
167 HTMLParamElement* imp = static_cast<HTMLParamElement*>(impl()); |
|
168 |
|
169 imp->setType(valueToStringWithNullCheck(exec, value)); |
|
170 break; |
|
171 } |
|
172 case ValueAttrNum: { |
|
173 HTMLParamElement* imp = static_cast<HTMLParamElement*>(impl()); |
|
174 |
|
175 imp->setValue(valueToStringWithNullCheck(exec, value)); |
|
176 break; |
|
177 } |
|
178 case ValueTypeAttrNum: { |
|
179 HTMLParamElement* imp = static_cast<HTMLParamElement*>(impl()); |
|
180 |
|
181 imp->setValueType(valueToStringWithNullCheck(exec, value)); |
|
182 break; |
|
183 } |
|
184 } |
|
185 } |
|
186 |
|
187 JSValue* JSHTMLParamElement::getConstructor(ExecState* exec) |
|
188 { |
|
189 return KJS::cacheGlobalObject<JSHTMLParamElementConstructor>(exec, "[[HTMLParamElement.constructor]]"); |
|
190 } |
|
191 |
|
192 } |