|
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 #include "JSHTMLHRElement.h" |
|
23 |
|
24 #include "HTMLHRElement.h" |
|
25 #include "HTMLNames.h" |
|
26 #include "KURL.h" |
|
27 #include <runtime/JSString.h> |
|
28 #include <wtf/GetPtr.h> |
|
29 |
|
30 using namespace JSC; |
|
31 |
|
32 namespace WebCore { |
|
33 |
|
34 ASSERT_CLASS_FITS_IN_CELL(JSHTMLHRElement); |
|
35 |
|
36 /* Hash table */ |
|
37 #if ENABLE(JIT) |
|
38 #define THUNK_GENERATOR(generator) , generator |
|
39 #else |
|
40 #define THUNK_GENERATOR(generator) |
|
41 #endif |
|
42 |
|
43 static const HashTableValue JSHTMLHRElementTableValues[6] = |
|
44 { |
|
45 { "align", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLHRElementAlign), (intptr_t)setJSHTMLHRElementAlign THUNK_GENERATOR(0) }, |
|
46 { "noShade", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLHRElementNoShade), (intptr_t)setJSHTMLHRElementNoShade THUNK_GENERATOR(0) }, |
|
47 { "size", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLHRElementSize), (intptr_t)setJSHTMLHRElementSize THUNK_GENERATOR(0) }, |
|
48 { "width", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLHRElementWidth), (intptr_t)setJSHTMLHRElementWidth THUNK_GENERATOR(0) }, |
|
49 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLHRElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
50 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
51 }; |
|
52 |
|
53 #undef THUNK_GENERATOR |
|
54 static JSC_CONST_HASHTABLE HashTable JSHTMLHRElementTable = { 17, 15, JSHTMLHRElementTableValues, 0 }; |
|
55 /* Hash table for constructor */ |
|
56 #if ENABLE(JIT) |
|
57 #define THUNK_GENERATOR(generator) , generator |
|
58 #else |
|
59 #define THUNK_GENERATOR(generator) |
|
60 #endif |
|
61 |
|
62 static const HashTableValue JSHTMLHRElementConstructorTableValues[1] = |
|
63 { |
|
64 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
65 }; |
|
66 |
|
67 #undef THUNK_GENERATOR |
|
68 static JSC_CONST_HASHTABLE HashTable JSHTMLHRElementConstructorTable = { 1, 0, JSHTMLHRElementConstructorTableValues, 0 }; |
|
69 class JSHTMLHRElementConstructor : public DOMConstructorObject { |
|
70 public: |
|
71 JSHTMLHRElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
72 |
|
73 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
74 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
75 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
76 static const JSC::ClassInfo s_info; |
|
77 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
78 { |
|
79 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
80 } |
|
81 protected: |
|
82 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
83 }; |
|
84 |
|
85 const ClassInfo JSHTMLHRElementConstructor::s_info = { "HTMLHRElementConstructor", 0, &JSHTMLHRElementConstructorTable, 0 }; |
|
86 |
|
87 JSHTMLHRElementConstructor::JSHTMLHRElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
88 : DOMConstructorObject(JSHTMLHRElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
89 { |
|
90 putDirect(exec->propertyNames().prototype, JSHTMLHRElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
91 } |
|
92 |
|
93 bool JSHTMLHRElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
94 { |
|
95 return getStaticValueSlot<JSHTMLHRElementConstructor, DOMObject>(exec, &JSHTMLHRElementConstructorTable, this, propertyName, slot); |
|
96 } |
|
97 |
|
98 bool JSHTMLHRElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
99 { |
|
100 return getStaticValueDescriptor<JSHTMLHRElementConstructor, DOMObject>(exec, &JSHTMLHRElementConstructorTable, this, propertyName, descriptor); |
|
101 } |
|
102 |
|
103 /* Hash table for prototype */ |
|
104 #if ENABLE(JIT) |
|
105 #define THUNK_GENERATOR(generator) , generator |
|
106 #else |
|
107 #define THUNK_GENERATOR(generator) |
|
108 #endif |
|
109 |
|
110 static const HashTableValue JSHTMLHRElementPrototypeTableValues[1] = |
|
111 { |
|
112 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
113 }; |
|
114 |
|
115 #undef THUNK_GENERATOR |
|
116 static JSC_CONST_HASHTABLE HashTable JSHTMLHRElementPrototypeTable = { 1, 0, JSHTMLHRElementPrototypeTableValues, 0 }; |
|
117 const ClassInfo JSHTMLHRElementPrototype::s_info = { "HTMLHRElementPrototype", 0, &JSHTMLHRElementPrototypeTable, 0 }; |
|
118 |
|
119 JSObject* JSHTMLHRElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
120 { |
|
121 return getDOMPrototype<JSHTMLHRElement>(exec, globalObject); |
|
122 } |
|
123 |
|
124 const ClassInfo JSHTMLHRElement::s_info = { "HTMLHRElement", &JSHTMLElement::s_info, &JSHTMLHRElementTable, 0 }; |
|
125 |
|
126 JSHTMLHRElement::JSHTMLHRElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLHRElement> impl) |
|
127 : JSHTMLElement(structure, globalObject, impl) |
|
128 { |
|
129 } |
|
130 |
|
131 JSObject* JSHTMLHRElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
132 { |
|
133 return new (exec) JSHTMLHRElementPrototype(globalObject, JSHTMLHRElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
134 } |
|
135 |
|
136 bool JSHTMLHRElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
137 { |
|
138 return getStaticValueSlot<JSHTMLHRElement, Base>(exec, &JSHTMLHRElementTable, this, propertyName, slot); |
|
139 } |
|
140 |
|
141 bool JSHTMLHRElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
142 { |
|
143 return getStaticValueDescriptor<JSHTMLHRElement, Base>(exec, &JSHTMLHRElementTable, this, propertyName, descriptor); |
|
144 } |
|
145 |
|
146 JSValue jsHTMLHRElementAlign(ExecState* exec, JSValue slotBase, const Identifier&) |
|
147 { |
|
148 JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(asObject(slotBase)); |
|
149 UNUSED_PARAM(exec); |
|
150 HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); |
|
151 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::alignAttr)); |
|
152 return result; |
|
153 } |
|
154 |
|
155 JSValue jsHTMLHRElementNoShade(ExecState* exec, JSValue slotBase, const Identifier&) |
|
156 { |
|
157 JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(asObject(slotBase)); |
|
158 UNUSED_PARAM(exec); |
|
159 HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); |
|
160 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::noshadeAttr)); |
|
161 return result; |
|
162 } |
|
163 |
|
164 JSValue jsHTMLHRElementSize(ExecState* exec, JSValue slotBase, const Identifier&) |
|
165 { |
|
166 JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(asObject(slotBase)); |
|
167 UNUSED_PARAM(exec); |
|
168 HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); |
|
169 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::sizeAttr)); |
|
170 return result; |
|
171 } |
|
172 |
|
173 JSValue jsHTMLHRElementWidth(ExecState* exec, JSValue slotBase, const Identifier&) |
|
174 { |
|
175 JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(asObject(slotBase)); |
|
176 UNUSED_PARAM(exec); |
|
177 HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); |
|
178 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::widthAttr)); |
|
179 return result; |
|
180 } |
|
181 |
|
182 JSValue jsHTMLHRElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
183 { |
|
184 JSHTMLHRElement* domObject = static_cast<JSHTMLHRElement*>(asObject(slotBase)); |
|
185 return JSHTMLHRElement::getConstructor(exec, domObject->globalObject()); |
|
186 } |
|
187 void JSHTMLHRElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
188 { |
|
189 lookupPut<JSHTMLHRElement, Base>(exec, propertyName, value, &JSHTMLHRElementTable, this, slot); |
|
190 } |
|
191 |
|
192 void setJSHTMLHRElementAlign(ExecState* exec, JSObject* thisObject, JSValue value) |
|
193 { |
|
194 JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(thisObject); |
|
195 HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); |
|
196 imp->setAttribute(WebCore::HTMLNames::alignAttr, valueToStringWithNullCheck(exec, value)); |
|
197 } |
|
198 |
|
199 void setJSHTMLHRElementNoShade(ExecState* exec, JSObject* thisObject, JSValue value) |
|
200 { |
|
201 JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(thisObject); |
|
202 HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); |
|
203 imp->setBooleanAttribute(WebCore::HTMLNames::noshadeAttr, value.toBoolean(exec)); |
|
204 } |
|
205 |
|
206 void setJSHTMLHRElementSize(ExecState* exec, JSObject* thisObject, JSValue value) |
|
207 { |
|
208 JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(thisObject); |
|
209 HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); |
|
210 imp->setAttribute(WebCore::HTMLNames::sizeAttr, valueToStringWithNullCheck(exec, value)); |
|
211 } |
|
212 |
|
213 void setJSHTMLHRElementWidth(ExecState* exec, JSObject* thisObject, JSValue value) |
|
214 { |
|
215 JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(thisObject); |
|
216 HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); |
|
217 imp->setAttribute(WebCore::HTMLNames::widthAttr, valueToStringWithNullCheck(exec, value)); |
|
218 } |
|
219 |
|
220 JSValue JSHTMLHRElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
221 { |
|
222 return getDOMConstructor<JSHTMLHRElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
223 } |
|
224 |
|
225 |
|
226 } |