|
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 |
|
45 static const HashTableValue JSHTMLStyleElementTableValues[6] = |
|
46 { |
|
47 { "disabled", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLStyleElementDisabled), (intptr_t)setJSHTMLStyleElementDisabled THUNK_GENERATOR(0) }, |
|
48 { "media", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLStyleElementMedia), (intptr_t)setJSHTMLStyleElementMedia THUNK_GENERATOR(0) }, |
|
49 { "type", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLStyleElementType), (intptr_t)setJSHTMLStyleElementType THUNK_GENERATOR(0) }, |
|
50 { "sheet", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLStyleElementSheet), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
51 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLStyleElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
52 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
53 }; |
|
54 |
|
55 #undef THUNK_GENERATOR |
|
56 static JSC_CONST_HASHTABLE HashTable JSHTMLStyleElementTable = { 17, 15, JSHTMLStyleElementTableValues, 0 }; |
|
57 /* Hash table for constructor */ |
|
58 #if ENABLE(JIT) |
|
59 #define THUNK_GENERATOR(generator) , generator |
|
60 #else |
|
61 #define THUNK_GENERATOR(generator) |
|
62 #endif |
|
63 |
|
64 static const HashTableValue JSHTMLStyleElementConstructorTableValues[1] = |
|
65 { |
|
66 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
67 }; |
|
68 |
|
69 #undef THUNK_GENERATOR |
|
70 static JSC_CONST_HASHTABLE HashTable JSHTMLStyleElementConstructorTable = { 1, 0, JSHTMLStyleElementConstructorTableValues, 0 }; |
|
71 class JSHTMLStyleElementConstructor : public DOMConstructorObject { |
|
72 public: |
|
73 JSHTMLStyleElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
74 |
|
75 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
76 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
77 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
78 static const JSC::ClassInfo s_info; |
|
79 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
80 { |
|
81 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
82 } |
|
83 protected: |
|
84 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
85 }; |
|
86 |
|
87 const ClassInfo JSHTMLStyleElementConstructor::s_info = { "HTMLStyleElementConstructor", 0, &JSHTMLStyleElementConstructorTable, 0 }; |
|
88 |
|
89 JSHTMLStyleElementConstructor::JSHTMLStyleElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
90 : DOMConstructorObject(JSHTMLStyleElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
91 { |
|
92 putDirect(exec->propertyNames().prototype, JSHTMLStyleElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
93 } |
|
94 |
|
95 bool JSHTMLStyleElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
96 { |
|
97 return getStaticValueSlot<JSHTMLStyleElementConstructor, DOMObject>(exec, &JSHTMLStyleElementConstructorTable, this, propertyName, slot); |
|
98 } |
|
99 |
|
100 bool JSHTMLStyleElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
101 { |
|
102 return getStaticValueDescriptor<JSHTMLStyleElementConstructor, DOMObject>(exec, &JSHTMLStyleElementConstructorTable, this, 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 |
|
112 static const HashTableValue JSHTMLStyleElementPrototypeTableValues[1] = |
|
113 { |
|
114 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
115 }; |
|
116 |
|
117 #undef THUNK_GENERATOR |
|
118 static JSC_CONST_HASHTABLE HashTable JSHTMLStyleElementPrototypeTable = { 1, 0, JSHTMLStyleElementPrototypeTableValues, 0 }; |
|
119 const ClassInfo JSHTMLStyleElementPrototype::s_info = { "HTMLStyleElementPrototype", 0, &JSHTMLStyleElementPrototypeTable, 0 }; |
|
120 |
|
121 JSObject* JSHTMLStyleElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
122 { |
|
123 return getDOMPrototype<JSHTMLStyleElement>(exec, globalObject); |
|
124 } |
|
125 |
|
126 const ClassInfo JSHTMLStyleElement::s_info = { "HTMLStyleElement", &JSHTMLElement::s_info, &JSHTMLStyleElementTable, 0 }; |
|
127 |
|
128 JSHTMLStyleElement::JSHTMLStyleElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLStyleElement> impl) |
|
129 : JSHTMLElement(structure, globalObject, impl) |
|
130 { |
|
131 } |
|
132 |
|
133 JSObject* JSHTMLStyleElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
134 { |
|
135 return new (exec) JSHTMLStyleElementPrototype(globalObject, JSHTMLStyleElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
136 } |
|
137 |
|
138 bool JSHTMLStyleElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
139 { |
|
140 return getStaticValueSlot<JSHTMLStyleElement, Base>(exec, &JSHTMLStyleElementTable, this, propertyName, slot); |
|
141 } |
|
142 |
|
143 bool JSHTMLStyleElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
144 { |
|
145 return getStaticValueDescriptor<JSHTMLStyleElement, Base>(exec, &JSHTMLStyleElementTable, this, propertyName, descriptor); |
|
146 } |
|
147 |
|
148 JSValue jsHTMLStyleElementDisabled(ExecState* exec, JSValue slotBase, const Identifier&) |
|
149 { |
|
150 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(asObject(slotBase)); |
|
151 UNUSED_PARAM(exec); |
|
152 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl()); |
|
153 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::disabledAttr)); |
|
154 return result; |
|
155 } |
|
156 |
|
157 JSValue jsHTMLStyleElementMedia(ExecState* exec, JSValue slotBase, const Identifier&) |
|
158 { |
|
159 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(asObject(slotBase)); |
|
160 UNUSED_PARAM(exec); |
|
161 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl()); |
|
162 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::mediaAttr)); |
|
163 return result; |
|
164 } |
|
165 |
|
166 JSValue jsHTMLStyleElementType(ExecState* exec, JSValue slotBase, const Identifier&) |
|
167 { |
|
168 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(asObject(slotBase)); |
|
169 UNUSED_PARAM(exec); |
|
170 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl()); |
|
171 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::typeAttr)); |
|
172 return result; |
|
173 } |
|
174 |
|
175 JSValue jsHTMLStyleElementSheet(ExecState* exec, JSValue slotBase, const Identifier&) |
|
176 { |
|
177 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(asObject(slotBase)); |
|
178 UNUSED_PARAM(exec); |
|
179 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl()); |
|
180 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->sheet())); |
|
181 return result; |
|
182 } |
|
183 |
|
184 JSValue jsHTMLStyleElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
185 { |
|
186 JSHTMLStyleElement* domObject = static_cast<JSHTMLStyleElement*>(asObject(slotBase)); |
|
187 return JSHTMLStyleElement::getConstructor(exec, domObject->globalObject()); |
|
188 } |
|
189 void JSHTMLStyleElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
190 { |
|
191 lookupPut<JSHTMLStyleElement, Base>(exec, propertyName, value, &JSHTMLStyleElementTable, this, slot); |
|
192 } |
|
193 |
|
194 void setJSHTMLStyleElementDisabled(ExecState* exec, JSObject* thisObject, JSValue value) |
|
195 { |
|
196 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(thisObject); |
|
197 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl()); |
|
198 imp->setBooleanAttribute(WebCore::HTMLNames::disabledAttr, value.toBoolean(exec)); |
|
199 } |
|
200 |
|
201 void setJSHTMLStyleElementMedia(ExecState* exec, JSObject* thisObject, JSValue value) |
|
202 { |
|
203 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(thisObject); |
|
204 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl()); |
|
205 imp->setAttribute(WebCore::HTMLNames::mediaAttr, valueToStringWithNullCheck(exec, value)); |
|
206 } |
|
207 |
|
208 void setJSHTMLStyleElementType(ExecState* exec, JSObject* thisObject, JSValue value) |
|
209 { |
|
210 JSHTMLStyleElement* castedThis = static_cast<JSHTMLStyleElement*>(thisObject); |
|
211 HTMLStyleElement* imp = static_cast<HTMLStyleElement*>(castedThis->impl()); |
|
212 imp->setAttribute(WebCore::HTMLNames::typeAttr, valueToStringWithNullCheck(exec, value)); |
|
213 } |
|
214 |
|
215 JSValue JSHTMLStyleElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
216 { |
|
217 return getDOMConstructor<JSHTMLStyleElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
218 } |
|
219 |
|
220 |
|
221 } |