|
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 "JSHTMLFontElement.h" |
|
23 |
|
24 #include "HTMLFontElement.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(JSHTMLFontElement); |
|
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 JSHTMLFontElementTableValues[5] = |
|
44 { |
|
45 { "color", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFontElementColor), (intptr_t)setJSHTMLFontElementColor THUNK_GENERATOR(0) }, |
|
46 { "face", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFontElementFace), (intptr_t)setJSHTMLFontElementFace THUNK_GENERATOR(0) }, |
|
47 { "size", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFontElementSize), (intptr_t)setJSHTMLFontElementSize THUNK_GENERATOR(0) }, |
|
48 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFontElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
49 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
50 }; |
|
51 |
|
52 #undef THUNK_GENERATOR |
|
53 static JSC_CONST_HASHTABLE HashTable JSHTMLFontElementTable = { 9, 7, JSHTMLFontElementTableValues, 0 }; |
|
54 /* Hash table for constructor */ |
|
55 #if ENABLE(JIT) |
|
56 #define THUNK_GENERATOR(generator) , generator |
|
57 #else |
|
58 #define THUNK_GENERATOR(generator) |
|
59 #endif |
|
60 |
|
61 static const HashTableValue JSHTMLFontElementConstructorTableValues[1] = |
|
62 { |
|
63 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
64 }; |
|
65 |
|
66 #undef THUNK_GENERATOR |
|
67 static JSC_CONST_HASHTABLE HashTable JSHTMLFontElementConstructorTable = { 1, 0, JSHTMLFontElementConstructorTableValues, 0 }; |
|
68 class JSHTMLFontElementConstructor : public DOMConstructorObject { |
|
69 public: |
|
70 JSHTMLFontElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
71 |
|
72 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
73 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
74 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
75 static const JSC::ClassInfo s_info; |
|
76 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
77 { |
|
78 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
79 } |
|
80 protected: |
|
81 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
82 }; |
|
83 |
|
84 const ClassInfo JSHTMLFontElementConstructor::s_info = { "HTMLFontElementConstructor", 0, &JSHTMLFontElementConstructorTable, 0 }; |
|
85 |
|
86 JSHTMLFontElementConstructor::JSHTMLFontElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
87 : DOMConstructorObject(JSHTMLFontElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
88 { |
|
89 putDirect(exec->propertyNames().prototype, JSHTMLFontElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
90 } |
|
91 |
|
92 bool JSHTMLFontElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
93 { |
|
94 return getStaticValueSlot<JSHTMLFontElementConstructor, DOMObject>(exec, &JSHTMLFontElementConstructorTable, this, propertyName, slot); |
|
95 } |
|
96 |
|
97 bool JSHTMLFontElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
98 { |
|
99 return getStaticValueDescriptor<JSHTMLFontElementConstructor, DOMObject>(exec, &JSHTMLFontElementConstructorTable, this, propertyName, descriptor); |
|
100 } |
|
101 |
|
102 /* Hash table for prototype */ |
|
103 #if ENABLE(JIT) |
|
104 #define THUNK_GENERATOR(generator) , generator |
|
105 #else |
|
106 #define THUNK_GENERATOR(generator) |
|
107 #endif |
|
108 |
|
109 static const HashTableValue JSHTMLFontElementPrototypeTableValues[1] = |
|
110 { |
|
111 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
112 }; |
|
113 |
|
114 #undef THUNK_GENERATOR |
|
115 static JSC_CONST_HASHTABLE HashTable JSHTMLFontElementPrototypeTable = { 1, 0, JSHTMLFontElementPrototypeTableValues, 0 }; |
|
116 const ClassInfo JSHTMLFontElementPrototype::s_info = { "HTMLFontElementPrototype", 0, &JSHTMLFontElementPrototypeTable, 0 }; |
|
117 |
|
118 JSObject* JSHTMLFontElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
119 { |
|
120 return getDOMPrototype<JSHTMLFontElement>(exec, globalObject); |
|
121 } |
|
122 |
|
123 const ClassInfo JSHTMLFontElement::s_info = { "HTMLFontElement", &JSHTMLElement::s_info, &JSHTMLFontElementTable, 0 }; |
|
124 |
|
125 JSHTMLFontElement::JSHTMLFontElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLFontElement> impl) |
|
126 : JSHTMLElement(structure, globalObject, impl) |
|
127 { |
|
128 } |
|
129 |
|
130 JSObject* JSHTMLFontElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
131 { |
|
132 return new (exec) JSHTMLFontElementPrototype(globalObject, JSHTMLFontElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
133 } |
|
134 |
|
135 bool JSHTMLFontElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
136 { |
|
137 return getStaticValueSlot<JSHTMLFontElement, Base>(exec, &JSHTMLFontElementTable, this, propertyName, slot); |
|
138 } |
|
139 |
|
140 bool JSHTMLFontElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
141 { |
|
142 return getStaticValueDescriptor<JSHTMLFontElement, Base>(exec, &JSHTMLFontElementTable, this, propertyName, descriptor); |
|
143 } |
|
144 |
|
145 JSValue jsHTMLFontElementColor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
146 { |
|
147 JSHTMLFontElement* castedThis = static_cast<JSHTMLFontElement*>(asObject(slotBase)); |
|
148 UNUSED_PARAM(exec); |
|
149 HTMLFontElement* imp = static_cast<HTMLFontElement*>(castedThis->impl()); |
|
150 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::colorAttr)); |
|
151 return result; |
|
152 } |
|
153 |
|
154 JSValue jsHTMLFontElementFace(ExecState* exec, JSValue slotBase, const Identifier&) |
|
155 { |
|
156 JSHTMLFontElement* castedThis = static_cast<JSHTMLFontElement*>(asObject(slotBase)); |
|
157 UNUSED_PARAM(exec); |
|
158 HTMLFontElement* imp = static_cast<HTMLFontElement*>(castedThis->impl()); |
|
159 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::faceAttr)); |
|
160 return result; |
|
161 } |
|
162 |
|
163 JSValue jsHTMLFontElementSize(ExecState* exec, JSValue slotBase, const Identifier&) |
|
164 { |
|
165 JSHTMLFontElement* castedThis = static_cast<JSHTMLFontElement*>(asObject(slotBase)); |
|
166 UNUSED_PARAM(exec); |
|
167 HTMLFontElement* imp = static_cast<HTMLFontElement*>(castedThis->impl()); |
|
168 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::sizeAttr)); |
|
169 return result; |
|
170 } |
|
171 |
|
172 JSValue jsHTMLFontElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
173 { |
|
174 JSHTMLFontElement* domObject = static_cast<JSHTMLFontElement*>(asObject(slotBase)); |
|
175 return JSHTMLFontElement::getConstructor(exec, domObject->globalObject()); |
|
176 } |
|
177 void JSHTMLFontElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
178 { |
|
179 lookupPut<JSHTMLFontElement, Base>(exec, propertyName, value, &JSHTMLFontElementTable, this, slot); |
|
180 } |
|
181 |
|
182 void setJSHTMLFontElementColor(ExecState* exec, JSObject* thisObject, JSValue value) |
|
183 { |
|
184 JSHTMLFontElement* castedThis = static_cast<JSHTMLFontElement*>(thisObject); |
|
185 HTMLFontElement* imp = static_cast<HTMLFontElement*>(castedThis->impl()); |
|
186 imp->setAttribute(WebCore::HTMLNames::colorAttr, valueToStringWithNullCheck(exec, value)); |
|
187 } |
|
188 |
|
189 void setJSHTMLFontElementFace(ExecState* exec, JSObject* thisObject, JSValue value) |
|
190 { |
|
191 JSHTMLFontElement* castedThis = static_cast<JSHTMLFontElement*>(thisObject); |
|
192 HTMLFontElement* imp = static_cast<HTMLFontElement*>(castedThis->impl()); |
|
193 imp->setAttribute(WebCore::HTMLNames::faceAttr, valueToStringWithNullCheck(exec, value)); |
|
194 } |
|
195 |
|
196 void setJSHTMLFontElementSize(ExecState* exec, JSObject* thisObject, JSValue value) |
|
197 { |
|
198 JSHTMLFontElement* castedThis = static_cast<JSHTMLFontElement*>(thisObject); |
|
199 HTMLFontElement* imp = static_cast<HTMLFontElement*>(castedThis->impl()); |
|
200 imp->setAttribute(WebCore::HTMLNames::sizeAttr, valueToStringWithNullCheck(exec, value)); |
|
201 } |
|
202 |
|
203 JSValue JSHTMLFontElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
204 { |
|
205 return getDOMConstructor<JSHTMLFontElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
206 } |
|
207 |
|
208 |
|
209 } |