|
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 "JSHTMLMetaElement.h" |
|
23 |
|
24 #include "HTMLMetaElement.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(JSHTMLMetaElement); |
|
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 JSHTMLMetaElementTableValues[6] = |
|
44 { |
|
45 { "content", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMetaElementContent), (intptr_t)setJSHTMLMetaElementContent THUNK_GENERATOR(0) }, |
|
46 { "httpEquiv", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMetaElementHttpEquiv), (intptr_t)setJSHTMLMetaElementHttpEquiv THUNK_GENERATOR(0) }, |
|
47 { "name", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMetaElementName), (intptr_t)setJSHTMLMetaElementName THUNK_GENERATOR(0) }, |
|
48 { "scheme", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMetaElementScheme), (intptr_t)setJSHTMLMetaElementScheme THUNK_GENERATOR(0) }, |
|
49 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMetaElementConstructor), (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 JSHTMLMetaElementTable = { 17, 15, JSHTMLMetaElementTableValues, 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 JSHTMLMetaElementConstructorTableValues[1] = |
|
63 { |
|
64 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
65 }; |
|
66 |
|
67 #undef THUNK_GENERATOR |
|
68 static JSC_CONST_HASHTABLE HashTable JSHTMLMetaElementConstructorTable = { 1, 0, JSHTMLMetaElementConstructorTableValues, 0 }; |
|
69 class JSHTMLMetaElementConstructor : public DOMConstructorObject { |
|
70 public: |
|
71 JSHTMLMetaElementConstructor(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 JSHTMLMetaElementConstructor::s_info = { "HTMLMetaElementConstructor", 0, &JSHTMLMetaElementConstructorTable, 0 }; |
|
86 |
|
87 JSHTMLMetaElementConstructor::JSHTMLMetaElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
88 : DOMConstructorObject(JSHTMLMetaElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
89 { |
|
90 putDirect(exec->propertyNames().prototype, JSHTMLMetaElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
91 } |
|
92 |
|
93 bool JSHTMLMetaElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
94 { |
|
95 return getStaticValueSlot<JSHTMLMetaElementConstructor, DOMObject>(exec, &JSHTMLMetaElementConstructorTable, this, propertyName, slot); |
|
96 } |
|
97 |
|
98 bool JSHTMLMetaElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
99 { |
|
100 return getStaticValueDescriptor<JSHTMLMetaElementConstructor, DOMObject>(exec, &JSHTMLMetaElementConstructorTable, 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 JSHTMLMetaElementPrototypeTableValues[1] = |
|
111 { |
|
112 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
113 }; |
|
114 |
|
115 #undef THUNK_GENERATOR |
|
116 static JSC_CONST_HASHTABLE HashTable JSHTMLMetaElementPrototypeTable = { 1, 0, JSHTMLMetaElementPrototypeTableValues, 0 }; |
|
117 const ClassInfo JSHTMLMetaElementPrototype::s_info = { "HTMLMetaElementPrototype", 0, &JSHTMLMetaElementPrototypeTable, 0 }; |
|
118 |
|
119 JSObject* JSHTMLMetaElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
120 { |
|
121 return getDOMPrototype<JSHTMLMetaElement>(exec, globalObject); |
|
122 } |
|
123 |
|
124 const ClassInfo JSHTMLMetaElement::s_info = { "HTMLMetaElement", &JSHTMLElement::s_info, &JSHTMLMetaElementTable, 0 }; |
|
125 |
|
126 JSHTMLMetaElement::JSHTMLMetaElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLMetaElement> impl) |
|
127 : JSHTMLElement(structure, globalObject, impl) |
|
128 { |
|
129 } |
|
130 |
|
131 JSObject* JSHTMLMetaElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
132 { |
|
133 return new (exec) JSHTMLMetaElementPrototype(globalObject, JSHTMLMetaElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
134 } |
|
135 |
|
136 bool JSHTMLMetaElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
137 { |
|
138 return getStaticValueSlot<JSHTMLMetaElement, Base>(exec, &JSHTMLMetaElementTable, this, propertyName, slot); |
|
139 } |
|
140 |
|
141 bool JSHTMLMetaElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
142 { |
|
143 return getStaticValueDescriptor<JSHTMLMetaElement, Base>(exec, &JSHTMLMetaElementTable, this, propertyName, descriptor); |
|
144 } |
|
145 |
|
146 JSValue jsHTMLMetaElementContent(ExecState* exec, JSValue slotBase, const Identifier&) |
|
147 { |
|
148 JSHTMLMetaElement* castedThis = static_cast<JSHTMLMetaElement*>(asObject(slotBase)); |
|
149 UNUSED_PARAM(exec); |
|
150 HTMLMetaElement* imp = static_cast<HTMLMetaElement*>(castedThis->impl()); |
|
151 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::contentAttr)); |
|
152 return result; |
|
153 } |
|
154 |
|
155 JSValue jsHTMLMetaElementHttpEquiv(ExecState* exec, JSValue slotBase, const Identifier&) |
|
156 { |
|
157 JSHTMLMetaElement* castedThis = static_cast<JSHTMLMetaElement*>(asObject(slotBase)); |
|
158 UNUSED_PARAM(exec); |
|
159 HTMLMetaElement* imp = static_cast<HTMLMetaElement*>(castedThis->impl()); |
|
160 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::http_equivAttr)); |
|
161 return result; |
|
162 } |
|
163 |
|
164 JSValue jsHTMLMetaElementName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
165 { |
|
166 JSHTMLMetaElement* castedThis = static_cast<JSHTMLMetaElement*>(asObject(slotBase)); |
|
167 UNUSED_PARAM(exec); |
|
168 HTMLMetaElement* imp = static_cast<HTMLMetaElement*>(castedThis->impl()); |
|
169 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::nameAttr)); |
|
170 return result; |
|
171 } |
|
172 |
|
173 JSValue jsHTMLMetaElementScheme(ExecState* exec, JSValue slotBase, const Identifier&) |
|
174 { |
|
175 JSHTMLMetaElement* castedThis = static_cast<JSHTMLMetaElement*>(asObject(slotBase)); |
|
176 UNUSED_PARAM(exec); |
|
177 HTMLMetaElement* imp = static_cast<HTMLMetaElement*>(castedThis->impl()); |
|
178 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::schemeAttr)); |
|
179 return result; |
|
180 } |
|
181 |
|
182 JSValue jsHTMLMetaElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
183 { |
|
184 JSHTMLMetaElement* domObject = static_cast<JSHTMLMetaElement*>(asObject(slotBase)); |
|
185 return JSHTMLMetaElement::getConstructor(exec, domObject->globalObject()); |
|
186 } |
|
187 void JSHTMLMetaElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
188 { |
|
189 lookupPut<JSHTMLMetaElement, Base>(exec, propertyName, value, &JSHTMLMetaElementTable, this, slot); |
|
190 } |
|
191 |
|
192 void setJSHTMLMetaElementContent(ExecState* exec, JSObject* thisObject, JSValue value) |
|
193 { |
|
194 JSHTMLMetaElement* castedThis = static_cast<JSHTMLMetaElement*>(thisObject); |
|
195 HTMLMetaElement* imp = static_cast<HTMLMetaElement*>(castedThis->impl()); |
|
196 imp->setAttribute(WebCore::HTMLNames::contentAttr, valueToStringWithNullCheck(exec, value)); |
|
197 } |
|
198 |
|
199 void setJSHTMLMetaElementHttpEquiv(ExecState* exec, JSObject* thisObject, JSValue value) |
|
200 { |
|
201 JSHTMLMetaElement* castedThis = static_cast<JSHTMLMetaElement*>(thisObject); |
|
202 HTMLMetaElement* imp = static_cast<HTMLMetaElement*>(castedThis->impl()); |
|
203 imp->setAttribute(WebCore::HTMLNames::http_equivAttr, valueToStringWithNullCheck(exec, value)); |
|
204 } |
|
205 |
|
206 void setJSHTMLMetaElementName(ExecState* exec, JSObject* thisObject, JSValue value) |
|
207 { |
|
208 JSHTMLMetaElement* castedThis = static_cast<JSHTMLMetaElement*>(thisObject); |
|
209 HTMLMetaElement* imp = static_cast<HTMLMetaElement*>(castedThis->impl()); |
|
210 imp->setAttribute(WebCore::HTMLNames::nameAttr, valueToStringWithNullCheck(exec, value)); |
|
211 } |
|
212 |
|
213 void setJSHTMLMetaElementScheme(ExecState* exec, JSObject* thisObject, JSValue value) |
|
214 { |
|
215 JSHTMLMetaElement* castedThis = static_cast<JSHTMLMetaElement*>(thisObject); |
|
216 HTMLMetaElement* imp = static_cast<HTMLMetaElement*>(castedThis->impl()); |
|
217 imp->setAttribute(WebCore::HTMLNames::schemeAttr, valueToStringWithNullCheck(exec, value)); |
|
218 } |
|
219 |
|
220 JSValue JSHTMLMetaElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
221 { |
|
222 return getDOMConstructor<JSHTMLMetaElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
223 } |
|
224 |
|
225 |
|
226 } |