2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
22 #include "JSHTMLStyleElement.h"
24 #include "HTMLNames.h"
25 #include "HTMLStyleElement.h"
26 #include "JSStyleSheet.h"
28 #include "StyleSheet.h"
29 #include <runtime/JSString.h>
30 #include <wtf/GetPtr.h>
36 ASSERT_CLASS_FITS_IN_CELL(JSHTMLStyleElement);
40 #define THUNK_GENERATOR(generator) , generator
42 #define THUNK_GENERATOR(generator)
45 #define INTRINSIC(intrinsic) , intrinsic
47 #define INTRINSIC(intrinsic)
50 static const HashTableValue JSHTMLStyleElementTableValues[] =
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) }
60 #undef THUNK_GENERATOR
61 static const HashTable JSHTMLStyleElementTable = { 17, 15, JSHTMLStyleElementTableValues, 0 };
62 /* Hash table for constructor */
64 #define THUNK_GENERATOR(generator) , generator
66 #define THUNK_GENERATOR(generator)
69 #define INTRINSIC(intrinsic) , intrinsic
71 #define INTRINSIC(intrinsic)
74 static const HashTableValue JSHTMLStyleElementConstructorTableValues[] =
76 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
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) };
83 JSHTMLStyleElementConstructor::JSHTMLStyleElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
84 : DOMConstructorObject(structure, globalObject)
88 void JSHTMLStyleElementConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
90 Base::finishCreation(exec->globalData());
91 ASSERT(inherits(&s_info));
92 putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLStyleElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
95 bool JSHTMLStyleElementConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
97 return getStaticValueSlot<JSHTMLStyleElementConstructor, JSDOMWrapper>(exec, &JSHTMLStyleElementConstructorTable, static_cast<JSHTMLStyleElementConstructor*>(cell), propertyName, slot);
100 bool JSHTMLStyleElementConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
102 return getStaticValueDescriptor<JSHTMLStyleElementConstructor, JSDOMWrapper>(exec, &JSHTMLStyleElementConstructorTable, static_cast<JSHTMLStyleElementConstructor*>(object), propertyName, descriptor);
105 /* Hash table for prototype */
107 #define THUNK_GENERATOR(generator) , generator
109 #define THUNK_GENERATOR(generator)
112 #define INTRINSIC(intrinsic) , intrinsic
114 #define INTRINSIC(intrinsic)
117 static const HashTableValue JSHTMLStyleElementPrototypeTableValues[] =
119 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
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) };
126 JSObject* JSHTMLStyleElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
128 return getDOMPrototype<JSHTMLStyleElement>(exec, globalObject);
131 const ClassInfo JSHTMLStyleElement::s_info = { "HTMLStyleElement", &JSHTMLElement::s_info, &JSHTMLStyleElementTable, 0 , CREATE_METHOD_TABLE(JSHTMLStyleElement) };
133 JSHTMLStyleElement::JSHTMLStyleElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLStyleElement> impl)
134 : JSHTMLElement(structure, globalObject, impl)
138 void JSHTMLStyleElement::finishCreation(JSGlobalData& globalData)
140 Base::finishCreation(globalData);
141 ASSERT(inherits(&s_info));
144 JSObject* JSHTMLStyleElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
146 return JSHTMLStyleElementPrototype::create(exec->globalData(), globalObject, JSHTMLStyleElementPrototype::createStructure(exec->globalData(), globalObject, JSHTMLElementPrototype::self(exec, globalObject)));
149 bool JSHTMLStyleElement::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
151 JSHTMLStyleElement* thisObject = jsCast<JSHTMLStyleElement*>(cell);
152 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
153 return getStaticValueSlot<JSHTMLStyleElement, Base>(exec, &JSHTMLStyleElementTable, thisObject, propertyName, slot);
156 bool JSHTMLStyleElement::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
158 JSHTMLStyleElement* thisObject = jsCast<JSHTMLStyleElement*>(object);
159 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
160 return getStaticValueDescriptor<JSHTMLStyleElement, Base>(exec, &JSHTMLStyleElementTable, thisObject, propertyName, descriptor);
163 JSValue jsHTMLStyleElementDisabled(ExecState* exec, JSValue slotBase, const Identifier&)
165 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(asObject(slotBase));
167 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
168 JSValue result = jsBoolean(imp->disabled());
173 JSValue jsHTMLStyleElementMedia(ExecState* exec, JSValue slotBase, const Identifier&)
175 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(asObject(slotBase));
177 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
178 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::mediaAttr));
183 JSValue jsHTMLStyleElementType(ExecState* exec, JSValue slotBase, const Identifier&)
185 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(asObject(slotBase));
187 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
188 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::typeAttr));
193 JSValue jsHTMLStyleElementSheet(ExecState* exec, JSValue slotBase, const Identifier&)
195 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(asObject(slotBase));
197 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
198 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->sheet()));
203 JSValue jsHTMLStyleElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
205 JSHTMLStyleElement* domObject = static_cast<JSHTMLStyleElement*>(asObject(slotBase));
206 return JSHTMLStyleElement::getConstructor(exec, domObject->globalObject());
209 void JSHTMLStyleElement::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
211 JSHTMLStyleElement* thisObject = jsCast<JSHTMLStyleElement*>(cell);
212 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
213 lookupPut<JSHTMLStyleElement, Base>(exec, propertyName, value, &JSHTMLStyleElementTable, thisObject, slot);
216 void setJSHTMLStyleElementDisabled(ExecState* exec, JSObject* thisObject, JSValue value)
218 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(thisObject);
219 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
220 imp->setDisabled(value.toBoolean(exec));
224 void setJSHTMLStyleElementMedia(ExecState* exec, JSObject* thisObject, JSValue value)
226 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(thisObject);
227 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
228 imp->setAttribute(WebCore::HTMLNames::mediaAttr, valueToStringWithNullCheck(exec, value));
232 void setJSHTMLStyleElementType(ExecState* exec, JSObject* thisObject, JSValue value)
234 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(thisObject);
235 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl());
236 imp->setAttribute(WebCore::HTMLNames::typeAttr, valueToStringWithNullCheck(exec, value));
240 JSValue JSHTMLStyleElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
242 return getDOMConstructor<JSHTMLStyleElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));