tizen beta release
[framework/web/webkit-efl.git] / DerivedSources / WebCore / JSHTMLStyleElement.cpp
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 "JSHTMLStyleElement.h"
23
24 #include "HTMLNames.h"
25 #include "HTMLStyleElement.h"
26 #include "JSStyleSheet.h"
27 #include "KURL.h"
28 #include "StyleSheet.h"
29 #include <runtime/JSString.h>
30 #include <wtf/GetPtr.h>
31
32 using namespace JSC;
33
34 namespace WebCore {
35
36 ASSERT_CLASS_FITS_IN_CELL(JSHTMLStyleElement);
37
38 /* Hash table */
39 #if ENABLE(JIT)
40 #define THUNK_GENERATOR(generator) , generator
41 #else
42 #define THUNK_GENERATOR(generator)
43 #endif
44 #if ENABLE(DFG_JIT)
45 #define INTRINSIC(intrinsic) , intrinsic
46 #else
47 #define INTRINSIC(intrinsic)
48 #endif
49
50 static const HashTableValue JSHTMLStyleElementTableValues[] =
51 {
52     { "disabled", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLStyleElementDisabled), (intptr_t)setJSHTMLStyleElementDisabled THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53     { "media", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLStyleElementMedia), (intptr_t)setJSHTMLStyleElementMedia THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54     { "type", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLStyleElementType), (intptr_t)setJSHTMLStyleElementType THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55     { "sheet", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLStyleElementSheet), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLStyleElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
58 };
59
60 #undef THUNK_GENERATOR
61 static const HashTable JSHTMLStyleElementTable = { 17, 15, JSHTMLStyleElementTableValues, 0 };
62 /* Hash table for constructor */
63 #if ENABLE(JIT)
64 #define THUNK_GENERATOR(generator) , generator
65 #else
66 #define THUNK_GENERATOR(generator)
67 #endif
68 #if ENABLE(DFG_JIT)
69 #define INTRINSIC(intrinsic) , intrinsic
70 #else
71 #define INTRINSIC(intrinsic)
72 #endif
73
74 static const HashTableValue JSHTMLStyleElementConstructorTableValues[] =
75 {
76     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
77 };
78
79 #undef THUNK_GENERATOR
80 static const HashTable JSHTMLStyleElementConstructorTable = { 1, 0, JSHTMLStyleElementConstructorTableValues, 0 };
81 const ClassInfo JSHTMLStyleElementConstructor::s_info = { "HTMLStyleElementConstructor", &DOMConstructorObject::s_info, &JSHTMLStyleElementConstructorTable, 0, CREATE_METHOD_TABLE(JSHTMLStyleElementConstructor) };
82
83 JSHTMLStyleElementConstructor::JSHTMLStyleElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
84     : DOMConstructorObject(structure, globalObject)
85 {
86 }
87
88 void JSHTMLStyleElementConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
89 {
90     Base::finishCreation(exec->globalData());
91     ASSERT(inherits(&s_info));
92     putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLStyleElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
93 }
94
95 bool JSHTMLStyleElementConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
96 {
97     return getStaticValueSlot<JSHTMLStyleElementConstructor, JSDOMWrapper>(exec, &JSHTMLStyleElementConstructorTable, static_cast<JSHTMLStyleElementConstructor*>(cell), propertyName, slot);
98 }
99
100 bool JSHTMLStyleElementConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
101 {
102     return getStaticValueDescriptor<JSHTMLStyleElementConstructor, JSDOMWrapper>(exec, &JSHTMLStyleElementConstructorTable, static_cast<JSHTMLStyleElementConstructor*>(object), propertyName, descriptor);
103 }
104
105 /* Hash table for prototype */
106 #if ENABLE(JIT)
107 #define THUNK_GENERATOR(generator) , generator
108 #else
109 #define THUNK_GENERATOR(generator)
110 #endif
111 #if ENABLE(DFG_JIT)
112 #define INTRINSIC(intrinsic) , intrinsic
113 #else
114 #define INTRINSIC(intrinsic)
115 #endif
116
117 static const HashTableValue JSHTMLStyleElementPrototypeTableValues[] =
118 {
119     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
120 };
121
122 #undef THUNK_GENERATOR
123 static const HashTable JSHTMLStyleElementPrototypeTable = { 1, 0, JSHTMLStyleElementPrototypeTableValues, 0 };
124 const ClassInfo JSHTMLStyleElementPrototype::s_info = { "HTMLStyleElementPrototype", &JSC::JSNonFinalObject::s_info, &JSHTMLStyleElementPrototypeTable, 0, CREATE_METHOD_TABLE(JSHTMLStyleElementPrototype) };
125
126 JSObject* JSHTMLStyleElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
127 {
128     return getDOMPrototype<JSHTMLStyleElement>(exec, globalObject);
129 }
130
131 const ClassInfo JSHTMLStyleElement::s_info = { "HTMLStyleElement", &JSHTMLElement::s_info, &JSHTMLStyleElementTable, 0 , CREATE_METHOD_TABLE(JSHTMLStyleElement) };
132
133 JSHTMLStyleElement::JSHTMLStyleElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLStyleElement> impl)
134     : JSHTMLElement(structure, globalObject, impl)
135 {
136 }
137
138 void JSHTMLStyleElement::finishCreation(JSGlobalData& globalData)
139 {
140     Base::finishCreation(globalData);
141     ASSERT(inherits(&s_info));
142 }
143
144 JSObject* JSHTMLStyleElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
145 {
146     return JSHTMLStyleElementPrototype::create(exec->globalData(), globalObject, JSHTMLStyleElementPrototype::createStructure(exec->globalData(), globalObject, JSHTMLElementPrototype::self(exec, globalObject)));
147 }
148
149 bool JSHTMLStyleElement::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
150 {
151     JSHTMLStyleElement* thisObject = jsCast<JSHTMLStyleElement*>(cell);
152     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
153     return getStaticValueSlot<JSHTMLStyleElement, Base>(exec, &JSHTMLStyleElementTable, thisObject, propertyName, slot);
154 }
155
156 bool JSHTMLStyleElement::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
157 {
158     JSHTMLStyleElement* thisObject = jsCast<JSHTMLStyleElement*>(object);
159     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
160     return getStaticValueDescriptor<JSHTMLStyleElement, Base>(exec, &JSHTMLStyleElementTable, thisObject, propertyName, descriptor);
161 }
162
163 JSValue jsHTMLStyleElementDisabled(ExecState* exec, JSValue slotBase, const Identifier&)
164 {
165     JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(asObject(slotBase));
166     UNUSED_PARAM(exec);
167     HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
168     JSValue result = jsBoolean(imp->disabled());
169     return result;
170 }
171
172
173 JSValue jsHTMLStyleElementMedia(ExecState* exec, JSValue slotBase, const Identifier&)
174 {
175     JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(asObject(slotBase));
176     UNUSED_PARAM(exec);
177     HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
178     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::mediaAttr));
179     return result;
180 }
181
182
183 JSValue jsHTMLStyleElementType(ExecState* exec, JSValue slotBase, const Identifier&)
184 {
185     JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(asObject(slotBase));
186     UNUSED_PARAM(exec);
187     HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
188     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::typeAttr));
189     return result;
190 }
191
192
193 JSValue jsHTMLStyleElementSheet(ExecState* exec, JSValue slotBase, const Identifier&)
194 {
195     JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(asObject(slotBase));
196     UNUSED_PARAM(exec);
197     HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
198     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->sheet()));
199     return result;
200 }
201
202
203 JSValue jsHTMLStyleElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
204 {
205     JSHTMLStyleElement* domObject = static_cast<JSHTMLStyleElement*>(asObject(slotBase));
206     return JSHTMLStyleElement::getConstructor(exec, domObject->globalObject());
207 }
208
209 void JSHTMLStyleElement::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
210 {
211     JSHTMLStyleElement* thisObject = jsCast<JSHTMLStyleElement*>(cell);
212     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
213     lookupPut<JSHTMLStyleElement, Base>(exec, propertyName, value, &JSHTMLStyleElementTable, thisObject, slot);
214 }
215
216 void setJSHTMLStyleElementDisabled(ExecState* exec, JSObject* thisObject, JSValue value)
217 {
218     JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(thisObject);
219     HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
220     imp->setDisabled(value.toBoolean(exec));
221 }
222
223
224 void setJSHTMLStyleElementMedia(ExecState* exec, JSObject* thisObject, JSValue value)
225 {
226     JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(thisObject);
227     HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
228     imp->setAttribute(WebCore::HTMLNames::mediaAttr, valueToStringWithNullCheck(exec, value));
229 }
230
231
232 void setJSHTMLStyleElementType(ExecState* exec, JSObject* thisObject, JSValue value)
233 {
234     JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(thisObject);
235     HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
236     imp->setAttribute(WebCore::HTMLNames::typeAttr, valueToStringWithNullCheck(exec, value));
237 }
238
239
240 JSValue JSHTMLStyleElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
241 {
242     return getDOMConstructor<JSHTMLStyleElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
243 }
244
245
246 }