|
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 "JSHTMLLegendElement.h" |
|
24 |
|
25 #include <wtf/GetPtr.h> |
|
26 |
|
27 #include "HTMLFormElement.h" |
|
28 #include "HTMLLegendElement.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 JSHTMLLegendElementTableEntries[] = |
|
39 { |
|
40 { 0, 0, 0, 0, 0 }, |
|
41 { "form", JSHTMLLegendElement::FormAttrNum, DontDelete|ReadOnly, 0, &JSHTMLLegendElementTableEntries[4] }, |
|
42 { "accessKey", JSHTMLLegendElement::AccessKeyAttrNum, DontDelete, 0, 0 }, |
|
43 { 0, 0, 0, 0, 0 }, |
|
44 { "align", JSHTMLLegendElement::AlignAttrNum, DontDelete, 0, &JSHTMLLegendElementTableEntries[5] }, |
|
45 { "constructor", JSHTMLLegendElement::ConstructorAttrNum, DontDelete|DontEnum|ReadOnly, 0, 0 } |
|
46 }; |
|
47 |
|
48 static const HashTable JSHTMLLegendElementTable = |
|
49 { |
|
50 2, 6, JSHTMLLegendElementTableEntries, 4 |
|
51 }; |
|
52 |
|
53 /* Hash table for constructor */ |
|
54 |
|
55 static const HashEntry JSHTMLLegendElementConstructorTableEntries[] = |
|
56 { |
|
57 { 0, 0, 0, 0, 0 } |
|
58 }; |
|
59 |
|
60 static const HashTable JSHTMLLegendElementConstructorTable = |
|
61 { |
|
62 2, 1, JSHTMLLegendElementConstructorTableEntries, 1 |
|
63 }; |
|
64 |
|
65 class JSHTMLLegendElementConstructor : public DOMObject { |
|
66 public: |
|
67 JSHTMLLegendElementConstructor(ExecState* exec) |
|
68 { |
|
69 setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype()); |
|
70 putDirect(exec->propertyNames().prototype, JSHTMLLegendElementPrototype::self(exec), None); |
|
71 } |
|
72 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); |
|
73 JSValue* getValueProperty(ExecState*, int token) const; |
|
74 virtual const ClassInfo* classInfo() const { return &info; } |
|
75 static const ClassInfo info; |
|
76 |
|
77 virtual bool implementsHasInstance() const { return true; } |
|
78 }; |
|
79 |
|
80 const ClassInfo JSHTMLLegendElementConstructor::info = { "HTMLLegendElementConstructor", 0, &JSHTMLLegendElementConstructorTable, 0 }; |
|
81 |
|
82 bool JSHTMLLegendElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
83 { |
|
84 return getStaticValueSlot<JSHTMLLegendElementConstructor, DOMObject>(exec, &JSHTMLLegendElementConstructorTable, this, propertyName, slot); |
|
85 } |
|
86 |
|
87 JSValue* JSHTMLLegendElementConstructor::getValueProperty(ExecState*, int token) const |
|
88 { |
|
89 // The token is the numeric value of its associated constant |
|
90 return jsNumber(token); |
|
91 } |
|
92 |
|
93 /* Hash table for prototype */ |
|
94 |
|
95 static const HashEntry JSHTMLLegendElementPrototypeTableEntries[] = |
|
96 { |
|
97 { "focus", JSHTMLLegendElement::FocusFuncNum, DontDelete|Function, 0, 0 } |
|
98 }; |
|
99 |
|
100 static const HashTable JSHTMLLegendElementPrototypeTable = |
|
101 { |
|
102 2, 1, JSHTMLLegendElementPrototypeTableEntries, 1 |
|
103 }; |
|
104 |
|
105 const ClassInfo JSHTMLLegendElementPrototype::info = { "HTMLLegendElementPrototype", 0, &JSHTMLLegendElementPrototypeTable, 0 }; |
|
106 |
|
107 JSObject* JSHTMLLegendElementPrototype::self(ExecState* exec) |
|
108 { |
|
109 return KJS::cacheGlobalObject<JSHTMLLegendElementPrototype>(exec, "[[JSHTMLLegendElement.prototype]]"); |
|
110 } |
|
111 |
|
112 bool JSHTMLLegendElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
113 { |
|
114 return getStaticFunctionSlot<JSHTMLLegendElementPrototypeFunction, JSObject>(exec, &JSHTMLLegendElementPrototypeTable, this, propertyName, slot); |
|
115 } |
|
116 |
|
117 const ClassInfo JSHTMLLegendElement::info = { "HTMLLegendElement", &JSHTMLElement::info, &JSHTMLLegendElementTable, 0 }; |
|
118 |
|
119 JSHTMLLegendElement::JSHTMLLegendElement(ExecState* exec, HTMLLegendElement* impl) |
|
120 : JSHTMLElement(exec, impl) |
|
121 { |
|
122 setPrototype(JSHTMLLegendElementPrototype::self(exec)); |
|
123 } |
|
124 |
|
125 bool JSHTMLLegendElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
126 { |
|
127 return getStaticValueSlot<JSHTMLLegendElement, JSHTMLElement>(exec, &JSHTMLLegendElementTable, this, propertyName, slot); |
|
128 } |
|
129 |
|
130 JSValue* JSHTMLLegendElement::getValueProperty(ExecState* exec, int token) const |
|
131 { |
|
132 switch (token) { |
|
133 case FormAttrNum: { |
|
134 HTMLLegendElement* imp = static_cast<HTMLLegendElement*>(impl()); |
|
135 |
|
136 return toJS(exec, WTF::getPtr(imp->form())); |
|
137 } |
|
138 case AccessKeyAttrNum: { |
|
139 HTMLLegendElement* imp = static_cast<HTMLLegendElement*>(impl()); |
|
140 |
|
141 return jsString(imp->accessKey()); |
|
142 } |
|
143 case AlignAttrNum: { |
|
144 HTMLLegendElement* imp = static_cast<HTMLLegendElement*>(impl()); |
|
145 |
|
146 return jsString(imp->align()); |
|
147 } |
|
148 case ConstructorAttrNum: |
|
149 return getConstructor(exec); |
|
150 } |
|
151 return 0; |
|
152 } |
|
153 |
|
154 void JSHTMLLegendElement::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr) |
|
155 { |
|
156 lookupPut<JSHTMLLegendElement, JSHTMLElement>(exec, propertyName, value, attr, &JSHTMLLegendElementTable, this); |
|
157 } |
|
158 |
|
159 void JSHTMLLegendElement::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/) |
|
160 { |
|
161 switch (token) { |
|
162 case AccessKeyAttrNum: { |
|
163 HTMLLegendElement* imp = static_cast<HTMLLegendElement*>(impl()); |
|
164 |
|
165 imp->setAccessKey(valueToStringWithNullCheck(exec, value)); |
|
166 break; |
|
167 } |
|
168 case AlignAttrNum: { |
|
169 HTMLLegendElement* imp = static_cast<HTMLLegendElement*>(impl()); |
|
170 |
|
171 imp->setAlign(valueToStringWithNullCheck(exec, value)); |
|
172 break; |
|
173 } |
|
174 } |
|
175 } |
|
176 |
|
177 JSValue* JSHTMLLegendElement::getConstructor(ExecState* exec) |
|
178 { |
|
179 return KJS::cacheGlobalObject<JSHTMLLegendElementConstructor>(exec, "[[HTMLLegendElement.constructor]]"); |
|
180 } |
|
181 JSValue* JSHTMLLegendElementPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args) |
|
182 { |
|
183 if (!thisObj->inherits(&JSHTMLLegendElement::info)) |
|
184 return throwError(exec, TypeError); |
|
185 |
|
186 HTMLLegendElement* imp = static_cast<HTMLLegendElement*>(static_cast<JSHTMLLegendElement*>(thisObj)->impl()); |
|
187 |
|
188 switch (id) { |
|
189 case JSHTMLLegendElement::FocusFuncNum: { |
|
190 |
|
191 imp->focus(); |
|
192 return jsUndefined(); |
|
193 } |
|
194 } |
|
195 return 0; |
|
196 } |
|
197 |
|
198 } |